fulldev-ui 0.25.3 → 0.25.5

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 (179) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +7 -0
  3. package/liquid/assets/ui-manifest.json +3 -3
  4. package/liquid/assets/ui-typography.css +6 -0
  5. package/liquid/snippets/ui-badge.liquid +6 -0
  6. package/liquid/snippets/ui-button.liquid +6 -0
  7. package/package.json +8 -6
  8. package/public/r/liquid/badge.json +1 -1
  9. package/public/r/liquid/button.json +1 -1
  10. package/public/r/liquid/components.json +1 -1
  11. package/public/r/liquid/typography.json +1 -1
  12. package/public/r/react/styles/base-luma/typography.json +1 -1
  13. package/public/r/react/styles/base-lyra/typography.json +1 -1
  14. package/public/r/react/styles/base-maia/typography.json +1 -1
  15. package/public/r/react/styles/base-mira/typography.json +1 -1
  16. package/public/r/react/styles/base-nova/typography.json +1 -1
  17. package/public/r/react/styles/base-rhea/typography.json +1 -1
  18. package/public/r/react/styles/base-sera/typography.json +1 -1
  19. package/public/r/react/styles/base-vega/typography.json +1 -1
  20. package/public/r/styles/base-luma/article-1.json +1 -1
  21. package/public/r/styles/base-luma/articles-1.json +1 -1
  22. package/public/r/styles/base-luma/badge.json +1 -1
  23. package/public/r/styles/base-luma/button.json +1 -1
  24. package/public/r/styles/base-luma/checkbox-examples.json +3 -3
  25. package/public/r/styles/base-luma/content-1.json +1 -1
  26. package/public/r/styles/base-luma/content-2.json +1 -1
  27. package/public/r/styles/base-luma/content-4.json +1 -1
  28. package/public/r/styles/base-luma/cta-5.json +1 -1
  29. package/public/r/styles/base-luma/header-1.json +1 -1
  30. package/public/r/styles/base-luma/hero-1.json +1 -1
  31. package/public/r/styles/base-luma/hero-4.json +1 -1
  32. package/public/r/styles/base-luma/hero-5.json +1 -1
  33. package/public/r/styles/base-luma/hero-6.json +1 -1
  34. package/public/r/styles/base-luma/hero-7.json +1 -1
  35. package/public/r/styles/base-luma/hero-9.json +1 -1
  36. package/public/r/styles/base-luma/pricing-1.json +1 -1
  37. package/public/r/styles/base-luma/pricing-2.json +1 -1
  38. package/public/r/styles/base-luma/pricing-3.json +1 -1
  39. package/public/r/styles/base-luma/typography.json +1 -1
  40. package/public/r/styles/base-lyra/article-1.json +1 -1
  41. package/public/r/styles/base-lyra/articles-1.json +1 -1
  42. package/public/r/styles/base-lyra/badge.json +1 -1
  43. package/public/r/styles/base-lyra/button.json +1 -1
  44. package/public/r/styles/base-lyra/checkbox-examples.json +3 -3
  45. package/public/r/styles/base-lyra/content-1.json +1 -1
  46. package/public/r/styles/base-lyra/content-2.json +1 -1
  47. package/public/r/styles/base-lyra/content-4.json +1 -1
  48. package/public/r/styles/base-lyra/cta-5.json +1 -1
  49. package/public/r/styles/base-lyra/header-1.json +1 -1
  50. package/public/r/styles/base-lyra/hero-1.json +1 -1
  51. package/public/r/styles/base-lyra/hero-4.json +1 -1
  52. package/public/r/styles/base-lyra/hero-5.json +1 -1
  53. package/public/r/styles/base-lyra/hero-6.json +1 -1
  54. package/public/r/styles/base-lyra/hero-7.json +1 -1
  55. package/public/r/styles/base-lyra/hero-9.json +1 -1
  56. package/public/r/styles/base-lyra/pricing-1.json +1 -1
  57. package/public/r/styles/base-lyra/pricing-2.json +1 -1
  58. package/public/r/styles/base-lyra/pricing-3.json +1 -1
  59. package/public/r/styles/base-lyra/typography.json +1 -1
  60. package/public/r/styles/base-maia/article-1.json +1 -1
  61. package/public/r/styles/base-maia/articles-1.json +1 -1
  62. package/public/r/styles/base-maia/badge.json +1 -1
  63. package/public/r/styles/base-maia/button.json +1 -1
  64. package/public/r/styles/base-maia/checkbox-examples.json +3 -3
  65. package/public/r/styles/base-maia/content-1.json +1 -1
  66. package/public/r/styles/base-maia/content-2.json +1 -1
  67. package/public/r/styles/base-maia/content-4.json +1 -1
  68. package/public/r/styles/base-maia/cta-5.json +1 -1
  69. package/public/r/styles/base-maia/header-1.json +1 -1
  70. package/public/r/styles/base-maia/hero-1.json +1 -1
  71. package/public/r/styles/base-maia/hero-4.json +1 -1
  72. package/public/r/styles/base-maia/hero-5.json +1 -1
  73. package/public/r/styles/base-maia/hero-6.json +1 -1
  74. package/public/r/styles/base-maia/hero-7.json +1 -1
  75. package/public/r/styles/base-maia/hero-9.json +1 -1
  76. package/public/r/styles/base-maia/pricing-1.json +1 -1
  77. package/public/r/styles/base-maia/pricing-2.json +1 -1
  78. package/public/r/styles/base-maia/pricing-3.json +1 -1
  79. package/public/r/styles/base-maia/typography.json +1 -1
  80. package/public/r/styles/base-mira/article-1.json +1 -1
  81. package/public/r/styles/base-mira/articles-1.json +1 -1
  82. package/public/r/styles/base-mira/badge.json +1 -1
  83. package/public/r/styles/base-mira/button.json +1 -1
  84. package/public/r/styles/base-mira/checkbox-examples.json +3 -3
  85. package/public/r/styles/base-mira/content-1.json +1 -1
  86. package/public/r/styles/base-mira/content-2.json +1 -1
  87. package/public/r/styles/base-mira/content-4.json +1 -1
  88. package/public/r/styles/base-mira/cta-5.json +1 -1
  89. package/public/r/styles/base-mira/header-1.json +1 -1
  90. package/public/r/styles/base-mira/hero-1.json +1 -1
  91. package/public/r/styles/base-mira/hero-4.json +1 -1
  92. package/public/r/styles/base-mira/hero-5.json +1 -1
  93. package/public/r/styles/base-mira/hero-6.json +1 -1
  94. package/public/r/styles/base-mira/hero-7.json +1 -1
  95. package/public/r/styles/base-mira/hero-9.json +1 -1
  96. package/public/r/styles/base-mira/pricing-1.json +1 -1
  97. package/public/r/styles/base-mira/pricing-2.json +1 -1
  98. package/public/r/styles/base-mira/pricing-3.json +1 -1
  99. package/public/r/styles/base-mira/typography.json +1 -1
  100. package/public/r/styles/base-nova/article-1.json +1 -1
  101. package/public/r/styles/base-nova/articles-1.json +1 -1
  102. package/public/r/styles/base-nova/badge.json +1 -1
  103. package/public/r/styles/base-nova/button.json +1 -1
  104. package/public/r/styles/base-nova/checkbox-examples.json +3 -3
  105. package/public/r/styles/base-nova/content-1.json +1 -1
  106. package/public/r/styles/base-nova/content-2.json +1 -1
  107. package/public/r/styles/base-nova/content-4.json +1 -1
  108. package/public/r/styles/base-nova/cta-5.json +1 -1
  109. package/public/r/styles/base-nova/header-1.json +1 -1
  110. package/public/r/styles/base-nova/hero-1.json +1 -1
  111. package/public/r/styles/base-nova/hero-4.json +1 -1
  112. package/public/r/styles/base-nova/hero-5.json +1 -1
  113. package/public/r/styles/base-nova/hero-6.json +1 -1
  114. package/public/r/styles/base-nova/hero-7.json +1 -1
  115. package/public/r/styles/base-nova/hero-9.json +1 -1
  116. package/public/r/styles/base-nova/pricing-1.json +1 -1
  117. package/public/r/styles/base-nova/pricing-2.json +1 -1
  118. package/public/r/styles/base-nova/pricing-3.json +1 -1
  119. package/public/r/styles/base-nova/typography.json +1 -1
  120. package/public/r/styles/base-rhea/article-1.json +1 -1
  121. package/public/r/styles/base-rhea/articles-1.json +1 -1
  122. package/public/r/styles/base-rhea/badge.json +1 -1
  123. package/public/r/styles/base-rhea/button.json +1 -1
  124. package/public/r/styles/base-rhea/checkbox-examples.json +3 -3
  125. package/public/r/styles/base-rhea/content-1.json +1 -1
  126. package/public/r/styles/base-rhea/content-2.json +1 -1
  127. package/public/r/styles/base-rhea/content-4.json +1 -1
  128. package/public/r/styles/base-rhea/cta-5.json +1 -1
  129. package/public/r/styles/base-rhea/header-1.json +1 -1
  130. package/public/r/styles/base-rhea/hero-1.json +1 -1
  131. package/public/r/styles/base-rhea/hero-4.json +1 -1
  132. package/public/r/styles/base-rhea/hero-5.json +1 -1
  133. package/public/r/styles/base-rhea/hero-6.json +1 -1
  134. package/public/r/styles/base-rhea/hero-7.json +1 -1
  135. package/public/r/styles/base-rhea/hero-9.json +1 -1
  136. package/public/r/styles/base-rhea/pricing-1.json +1 -1
  137. package/public/r/styles/base-rhea/pricing-2.json +1 -1
  138. package/public/r/styles/base-rhea/pricing-3.json +1 -1
  139. package/public/r/styles/base-rhea/typography.json +1 -1
  140. package/public/r/styles/base-sera/article-1.json +1 -1
  141. package/public/r/styles/base-sera/articles-1.json +1 -1
  142. package/public/r/styles/base-sera/badge.json +1 -1
  143. package/public/r/styles/base-sera/button.json +1 -1
  144. package/public/r/styles/base-sera/checkbox-examples.json +3 -3
  145. package/public/r/styles/base-sera/content-1.json +1 -1
  146. package/public/r/styles/base-sera/content-2.json +1 -1
  147. package/public/r/styles/base-sera/content-4.json +1 -1
  148. package/public/r/styles/base-sera/cta-5.json +1 -1
  149. package/public/r/styles/base-sera/header-1.json +1 -1
  150. package/public/r/styles/base-sera/hero-1.json +1 -1
  151. package/public/r/styles/base-sera/hero-4.json +1 -1
  152. package/public/r/styles/base-sera/hero-5.json +1 -1
  153. package/public/r/styles/base-sera/hero-6.json +1 -1
  154. package/public/r/styles/base-sera/hero-7.json +1 -1
  155. package/public/r/styles/base-sera/hero-9.json +1 -1
  156. package/public/r/styles/base-sera/pricing-1.json +1 -1
  157. package/public/r/styles/base-sera/pricing-2.json +1 -1
  158. package/public/r/styles/base-sera/pricing-3.json +1 -1
  159. package/public/r/styles/base-sera/typography.json +1 -1
  160. package/public/r/styles/base-vega/article-1.json +1 -1
  161. package/public/r/styles/base-vega/articles-1.json +1 -1
  162. package/public/r/styles/base-vega/badge.json +1 -1
  163. package/public/r/styles/base-vega/button.json +1 -1
  164. package/public/r/styles/base-vega/checkbox-examples.json +3 -3
  165. package/public/r/styles/base-vega/content-1.json +1 -1
  166. package/public/r/styles/base-vega/content-2.json +1 -1
  167. package/public/r/styles/base-vega/content-4.json +1 -1
  168. package/public/r/styles/base-vega/cta-5.json +1 -1
  169. package/public/r/styles/base-vega/header-1.json +1 -1
  170. package/public/r/styles/base-vega/hero-1.json +1 -1
  171. package/public/r/styles/base-vega/hero-4.json +1 -1
  172. package/public/r/styles/base-vega/hero-5.json +1 -1
  173. package/public/r/styles/base-vega/hero-6.json +1 -1
  174. package/public/r/styles/base-vega/hero-7.json +1 -1
  175. package/public/r/styles/base-vega/hero-9.json +1 -1
  176. package/public/r/styles/base-vega/pricing-1.json +1 -1
  177. package/public/r/styles/base-vega/pricing-2.json +1 -1
  178. package/public/r/styles/base-vega/pricing-3.json +1 -1
  179. package/public/r/styles/base-vega/typography.json +1 -1
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/ui/typography.tsx",
13
- "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n \"font-medium text-primary underline underline-offset-4\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded-md bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-2xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
13
+ "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n // shadcn/ui's typography link uses text-primary, below 4.5:1 in dark\n // mode with most theme colors. There a lighter step of the primary\n // keeps 4.5:1, as in the Astro Button's link variant.\n \"font-medium text-(--fd-link,var(--primary)) underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded-md bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-2xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
14
14
  "type": "registry:ui"
15
15
  },
16
16
  {
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/ui/typography.tsx",
13
- "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n \"font-medium text-primary underline underline-offset-4\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-lg border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
13
+ "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n // shadcn/ui's typography link uses text-primary, below 4.5:1 in dark\n // mode with most theme colors. There a lighter step of the primary\n // keeps 4.5:1, as in the Astro Button's link variant.\n \"font-medium text-(--fd-link,var(--primary)) underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-lg border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
14
14
  "type": "registry:ui"
15
15
  },
16
16
  {
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/ui/typography.tsx",
13
- "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n \"font-medium text-primary underline underline-offset-4\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
13
+ "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n // shadcn/ui's typography link uses text-primary, below 4.5:1 in dark\n // mode with most theme colors. There a lighter step of the primary\n // keeps 4.5:1, as in the Astro Button's link variant.\n \"font-medium text-(--fd-link,var(--primary)) underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
14
14
  "type": "registry:ui"
15
15
  },
16
16
  {
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/ui/typography.tsx",
13
- "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n \"font-medium text-primary underline underline-offset-4\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded-md bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-2xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
13
+ "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-medium tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n // shadcn/ui's typography link uses text-primary, below 4.5:1 in dark\n // mode with most theme colors. There a lighter step of the primary\n // keeps 4.5:1, as in the Astro Button's link variant.\n \"font-medium text-(--fd-link,var(--primary)) underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded-md bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-2xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
14
14
  "type": "registry:ui"
15
15
  },
16
16
  {
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/ui/typography.tsx",
13
- "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-wider uppercase scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-wider uppercase scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n \"font-medium text-primary underline underline-offset-4\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded-none bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-none border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
13
+ "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-wider uppercase scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-wider uppercase scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n // shadcn/ui's typography link uses text-primary, below 4.5:1 in dark\n // mode with most theme colors. There a lighter step of the primary\n // keeps 4.5:1, as in the Astro Button's link variant.\n \"font-medium text-(--fd-link,var(--primary)) underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded-none bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-none border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
14
14
  "type": "registry:ui"
15
15
  },
16
16
  {
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/ui/typography.tsx",
13
- "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n \"font-medium text-primary underline underline-offset-4\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
13
+ "content": "import * as React from \"react\"\nimport { mergeProps } from \"@base-ui/react/merge-props\"\nimport { useRender } from \"@base-ui/react/use-render\"\nimport { cn } from \"cn\"\n\nimport \"./typeset.css\"\n\ntype TypographySize = \"sm\" | \"default\" | \"lg\"\n\nconst sizes = (sm: string, md: string, lg: string) => ({\n sm,\n default: md,\n lg,\n})\n\nfunction Typography({\n className,\n size = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"div\"> & { size?: TypographySize }) {\n return useRender({\n defaultTagName: \"div\",\n props: mergeProps<\"div\">(\n {\n className: cn(\n \"typeset\",\n sizes(\n \"[--typeset-flow:1.125em] [--typeset-leading:1.7] [--typeset-size:0.875rem]\",\n \"[--typeset-flow:1.25em] [--typeset-leading:1.75] [--typeset-size:1rem]\",\n \"[--typeset-flow:1.5em] [--typeset-leading:1.8] [--typeset-size:1.125rem]\"\n )[size],\n className\n ),\n },\n props\n ),\n render,\n state: {\n slot: \"typography\",\n size,\n },\n })\n}\n\nconst typographyH1Sizes = sizes(\"text-3xl\", \"text-4xl\", \"text-5xl\")\n\nfunction TypographyH1({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h1\"> & { size?: TypographySize }) {\n return (\n <h1\n data-slot=\"typography-h1\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading text-balance\",\n typographyH1Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH2Sizes = sizes(\"text-2xl\", \"text-3xl\", \"text-4xl\")\n\nfunction TypographyH2({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h2\"> & { size?: TypographySize }) {\n return (\n <h2\n data-slot=\"typography-h2\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading first:mt-0\",\n typographyH2Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH3Sizes = sizes(\"text-xl\", \"text-2xl\", \"text-3xl\")\n\nfunction TypographyH3({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h3\"> & { size?: TypographySize }) {\n return (\n <h3\n data-slot=\"typography-h3\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH3Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyH4Sizes = sizes(\"text-lg\", \"text-xl\", \"text-2xl\")\n\nfunction TypographyH4({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"h4\"> & { size?: TypographySize }) {\n return (\n <h4\n data-slot=\"typography-h4\"\n data-size={size}\n className={cn(\n \"font-semibold tracking-tight scroll-m-20 font-heading\",\n typographyH4Sizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyPSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyP({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-p\"\n data-size={size}\n className={cn(\n \"leading-7 [&:not(:first-child)]:mt-6\",\n typographyPSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyLeadSizes = sizes(\"text-base\", \"text-lg\", \"text-xl\")\n\nfunction TypographyLead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"p\"> & { size?: TypographySize }) {\n return (\n <p\n data-slot=\"typography-lead\"\n data-size={size}\n className={cn(\n \"text-muted-foreground\",\n typographyLeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyASizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyA({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"a\"> & { size?: TypographySize }) {\n return (\n <a\n data-slot=\"typography-a\"\n data-size={size}\n className={cn(\n // shadcn/ui's typography link uses text-primary, below 4.5:1 in dark\n // mode with most theme colors. There a lighter step of the primary\n // keeps 4.5:1, as in the Astro Button's link variant.\n \"font-medium text-(--fd-link,var(--primary)) underline underline-offset-4 dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)]\",\n typographyASizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyBlockquoteSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyBlockquote({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"blockquote\"> & { size?: TypographySize }) {\n return (\n <blockquote\n data-slot=\"typography-blockquote\"\n data-size={size}\n className={cn(\n \"mt-6 border-s-2 ps-6 italic\",\n typographyBlockquoteSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyInlineCodeSizes = sizes(\"text-xs\", \"text-sm\", \"text-base\")\n\nfunction TypographyInlineCode({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"code\"> & { size?: TypographySize }) {\n return (\n <code\n data-slot=\"typography-inline-code\"\n data-size={size}\n className={cn(\n \"rounded bg-muted font-mono font-semibold relative px-[0.3rem] py-[0.2rem]\",\n typographyInlineCodeSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListItemSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyListItem({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { size?: TypographySize }) {\n return (\n <li\n data-slot=\"typography-list-item\"\n data-size={size}\n className={cn(\"mt-2\", typographyListItemSizes[size], className)}\n {...props}\n />\n )\n}\n\nconst typographyTableRowSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableRow({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"tr\"> & { size?: TypographySize }) {\n return (\n <tr\n data-slot=\"typography-table-row\"\n data-size={size}\n className={cn(\n \"m-0 border-t p-0 even:bg-muted\",\n typographyTableRowSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableHeadSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableHead({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"th\"> & { size?: TypographySize }) {\n return (\n <th\n data-slot=\"typography-table-head\"\n data-size={size}\n className={cn(\n \"border-b border-border px-4 py-3 text-start font-semibold [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableHeadSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableCellSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTableCell({\n className,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"td\"> & { size?: TypographySize }) {\n return (\n <td\n data-slot=\"typography-table-cell\"\n data-size={size}\n className={cn(\n \"border-t border-border px-4 py-3 text-start align-middle [&[align=center]]:text-center [&[align=left]]:text-left [&[align=right]]:text-right\",\n typographyTableCellSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyListSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\n// The list type changes its markers, so it is a prop instead of a render.\nfunction TypographyList({\n className,\n as = \"ul\",\n size = \"default\",\n ...props\n}: React.ComponentProps<\"ol\"> & {\n as?: \"ul\" | \"ol\"\n size?: TypographySize\n}) {\n // A <ul> takes the attributes of an <ol> except start and reversed.\n const Tag = as as \"ol\"\n return (\n <Tag\n data-slot=\"typography-list\"\n data-size={size}\n data-ordered={as === \"ol\" ? \"\" : undefined}\n className={cn(\n \"my-6 ms-6\",\n as === \"ol\" ? \"list-decimal\" : \"list-disc\",\n typographyListSizes[size],\n className\n )}\n {...props}\n />\n )\n}\n\nconst typographyTableSizes = sizes(\"text-sm\", \"text-base\", \"text-lg\")\n\nfunction TypographyTable({\n className,\n containerClassName,\n size = \"default\",\n ...props\n}: React.ComponentProps<\"table\"> & {\n containerClassName?: string\n size?: TypographySize\n}) {\n return (\n <div\n data-slot=\"typography-table-container\"\n data-size={size}\n className={cn(\n \"rounded-xl border border-border my-6 w-full overflow-x-auto\",\n containerClassName\n )}\n >\n <table\n data-slot=\"typography-table\"\n data-size={size}\n className={cn(\n \"w-full border-collapse\",\n typographyTableSizes[size],\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nexport {\n Typography,\n TypographyA,\n TypographyBlockquote,\n TypographyH1,\n TypographyH2,\n TypographyH3,\n TypographyH4,\n TypographyInlineCode,\n TypographyLead,\n TypographyList,\n TypographyListItem,\n TypographyP,\n TypographyTable,\n TypographyTableCell,\n TypographyTableHead,\n TypographyTableRow,\n}\n",
14
14
  "type": "registry:ui"
15
15
  },
16
16
  {
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/blocks/article-1.astro",
13
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Section, SectionContainer } from \"@/components/ui/section\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n author: {\n image?: ImageMetadata\n initials: string\n name: string\n date: string\n }\n image: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n author,\n image,\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"max-w-2xl\">\n <article class=\"flex flex-col gap-8\">\n <header class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <h1 class=\"text-4xl leading-tight font-semibold tracking-tight text-balance sm:text-5xl\">\n {title}\n </h1>\n <p class=\"text-muted-foreground text-lg leading-8 text-balance\">\n {description}\n </p>\n </div>\n <div class=\"flex items-center gap-3\">\n <Avatar size=\"lg\" aria-hidden=\"true\">\n <AvatarImage src={author.image} />\n <AvatarFallback>{author.initials}</AvatarFallback>\n </Avatar>\n <div class=\"flex flex-col\">\n <p class=\"text-sm font-medium\">{author.name}</p>\n <p class=\"text-muted-foreground text-xs\">{author.date}</p>\n </div>\n </div>\n </header>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-[16/10] w-full rounded-xl object-cover\"\n widths={[640, 960, 1280]}\n sizes=\"(min-width: 42rem) 42rem, 100vw\"\n loading=\"eager\"\n fetchpriority=\"high\"\n />\n <div class=\"flex flex-col gap-6 text-base leading-8\">\n <slot />\n </div>\n </article>\n </SectionContainer>\n</Section>\n",
13
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Picture } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport { Section, SectionContainer } from \"@/components/ui/section\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n author: {\n image?: ImageMetadata\n initials: string\n name: string\n date: string\n }\n image: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n author,\n image,\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"max-w-2xl\">\n <article class=\"flex flex-col gap-8\">\n <header class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <h1 class=\"text-4xl leading-tight font-semibold tracking-tight text-balance sm:text-5xl\">\n {title}\n </h1>\n <p class=\"text-muted-foreground text-lg leading-8 text-balance\">\n {description}\n </p>\n </div>\n <div class=\"flex items-center gap-3\">\n <Avatar size=\"lg\" aria-hidden=\"true\">\n <AvatarImage src={author.image} />\n <AvatarFallback>{author.initials}</AvatarFallback>\n </Avatar>\n <div class=\"flex flex-col\">\n <p class=\"text-sm font-medium\">{author.name}</p>\n <p class=\"text-muted-foreground text-xs\">{author.date}</p>\n </div>\n </div>\n </header>\n <Picture\n src={image.src}\n alt={image.alt}\n formats={\n [\"svg\", \"gif\"].includes(image.src.format)\n ? [image.src.format as \"svg\" | \"gif\"]\n : [\"avif\", \"webp\"]\n }\n fallbackFormat={\n [\"svg\", \"gif\"].includes(image.src.format)\n ? (image.src.format as \"svg\" | \"gif\")\n : \"webp\"\n }\n pictureAttributes={{ class: \"contents [&>source]:hidden\" }}\n class=\"aspect-[16/10] w-full rounded-xl object-cover\"\n widths={[640, 960, 1280]}\n sizes=\"(min-width: 42rem) 42rem, 100vw\"\n loading=\"eager\"\n fetchpriority=\"high\"\n />\n <div class=\"flex flex-col gap-6 text-base leading-8\">\n <slot />\n </div>\n </article>\n </SectionContainer>\n</Section>\n",
14
14
  "type": "registry:block"
15
15
  }
16
16
  ],
@@ -10,7 +10,7 @@
10
10
  "files": [
11
11
  {
12
12
  "path": "src/components/blocks/articles-1.astro",
13
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport {\n Section,\n SectionContainer,\n SectionTitle,\n} from \"@/components/ui/section\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n articles: {\n image: {\n src: ImageMetadata\n alt: string\n }\n category: string\n title: string\n description: string\n href?: string\n author: {\n image?: ImageMetadata\n initials: string\n name: string\n date: string\n }\n }[]\n}\n\nconst { class: className, title, description, articles, ...props } = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"flex flex-col gap-8\">\n <div class=\"flex max-w-2xl flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <p class=\"text-muted-foreground text-base leading-7\">{description}</p>\n </div>\n\n <div class=\"grid gap-6 md:grid-cols-2 lg:grid-cols-3\">\n {articles.map((article) => {\n const Wrapper = article.href != null ? \"a\" : \"div\"\n return (\n <Wrapper\n href={article.href}\n class={cn(\n \"flex h-full flex-col gap-4 rounded-xl p-4\",\n article.href != null &&\n \"group hover:bg-muted/50 focus-visible:ring-ring/50 transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n )}\n >\n <Image\n src={article.image.src}\n alt={article.image.alt}\n class=\"-mx-4 -mt-4 aspect-[16/9] w-[calc(100%+2rem)] max-w-none rounded-lg object-cover transition-opacity group-hover:opacity-85\"\n widths={[480, 720, 960]}\n sizes=\"(min-width: 64rem) 26rem, (min-width: 48rem) 50vw, 100vw\"\n />\n <div class=\"flex flex-col gap-2\">\n <p class=\"text-muted-foreground text-sm font-medium\">\n {article.category}\n </p>\n <h3 class=\"text-foreground line-clamp-2 text-xl leading-snug font-semibold\">\n {article.title}\n </h3>\n <p class=\"text-muted-foreground line-clamp-2 text-sm leading-6\">\n {article.description}\n </p>\n </div>\n <div class=\"mt-auto flex items-center gap-3\">\n <Avatar aria-hidden=\"true\">\n <AvatarImage src={article.author.image} />\n <AvatarFallback>{article.author.initials}</AvatarFallback>\n </Avatar>\n <div class=\"flex flex-col\">\n <p class=\"text-sm font-medium\">{article.author.name}</p>\n <p class=\"text-muted-foreground text-xs\">\n {article.author.date}\n </p>\n </div>\n </div>\n </Wrapper>\n )\n })}\n </div>\n </SectionContainer>\n</Section>\n",
13
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Picture } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/components/ui/avatar\"\nimport {\n Section,\n SectionContainer,\n SectionTitle,\n} from \"@/components/ui/section\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n articles: {\n image: {\n src: ImageMetadata\n alt: string\n }\n category: string\n title: string\n description: string\n href?: string\n author: {\n image?: ImageMetadata\n initials: string\n name: string\n date: string\n }\n }[]\n}\n\nconst { class: className, title, description, articles, ...props } = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"flex flex-col gap-8\">\n <div class=\"flex max-w-2xl flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <p class=\"text-muted-foreground text-base leading-7\">{description}</p>\n </div>\n\n <div class=\"grid gap-6 md:grid-cols-2 lg:grid-cols-3\">\n {articles.map((article) => {\n const Wrapper = article.href != null ? \"a\" : \"div\"\n return (\n <Wrapper\n href={article.href}\n class={cn(\n \"flex h-full flex-col gap-4 rounded-xl p-4\",\n article.href != null &&\n \"group hover:bg-muted/50 focus-visible:ring-ring/50 transition-colors focus-visible:ring-2 focus-visible:outline-none\"\n )}\n >\n <Picture\n src={article.image.src}\n alt={article.image.alt}\n formats={\n [\"svg\", \"gif\"].includes(article.image.src.format)\n ? [article.image.src.format as \"svg\" | \"gif\"]\n : [\"avif\", \"webp\"]\n }\n fallbackFormat={\n [\"svg\", \"gif\"].includes(article.image.src.format)\n ? (article.image.src.format as \"svg\" | \"gif\")\n : \"webp\"\n }\n pictureAttributes={{ class: \"contents [&>source]:hidden\" }}\n class=\"-mx-4 -mt-4 aspect-[16/9] w-[calc(100%+2rem)] max-w-none rounded-lg object-cover transition-opacity group-hover:opacity-85\"\n widths={[480, 720, 960]}\n sizes=\"(min-width: 64rem) 26rem, (min-width: 48rem) 50vw, 100vw\"\n />\n <div class=\"flex flex-col gap-2\">\n <p class=\"text-muted-foreground text-sm font-medium\">\n {article.category}\n </p>\n <h3 class=\"text-foreground line-clamp-2 text-xl leading-snug font-semibold\">\n {article.title}\n </h3>\n <p class=\"text-muted-foreground line-clamp-2 text-sm leading-6\">\n {article.description}\n </p>\n </div>\n <div class=\"mt-auto flex items-center gap-3\">\n <Avatar aria-hidden=\"true\">\n <AvatarImage src={article.author.image} />\n <AvatarFallback>{article.author.initials}</AvatarFallback>\n </Avatar>\n <div class=\"flex flex-col\">\n <p class=\"text-sm font-medium\">{article.author.name}</p>\n <p class=\"text-muted-foreground text-xs\">\n {article.author.date}\n </p>\n </div>\n </div>\n </Wrapper>\n )\n })}\n </div>\n </SectionContainer>\n</Section>\n",
14
14
  "type": "registry:block"
15
15
  }
16
16
  ],
@@ -6,7 +6,7 @@
6
6
  "files": [
7
7
  {
8
8
  "path": "src/components/ui/badge/badge-variants.ts",
9
- "content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-3xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
9
+ "content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const badgeVariants = cva(\n \"h-5 gap-1 rounded-3xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a]:hover:bg-primary/80\",\n secondary: \"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80\",\n destructive: \"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20\",\n outline: \"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground\",\n ghost: \"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nexport type BadgeVariantProps = VariantProps<typeof badgeVariants>\n",
10
10
  "type": "registry:ui"
11
11
  },
12
12
  {
@@ -6,7 +6,7 @@
6
6
  "files": [
7
7
  {
8
8
  "path": "src/components/ui/button/button-variants.ts",
9
- "content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-4xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background dark:bg-transparent hover:bg-muted hover:text-foreground dark:hover:bg-input/30 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
9
+ "content": "import { cva, type VariantProps } from \"class-variance-authority\"\n\nexport const buttonVariants = cva(\n \"focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-4xl border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 active:not-aria-[haspopup]:translate-y-px [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline: \"border-border bg-background dark:bg-transparent hover:bg-muted hover:text-foreground dark:hover:bg-input/30 aria-expanded:bg-muted aria-expanded:text-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost: \"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground\",\n // shadcn/ui uses text-destructive, about 4:1 on the button's tint.\n // Mixing in a fifth of the foreground keeps 4.5:1, as the native Liquid\n // button does.\n destructive: \"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-[color-mix(in_oklab,var(--destructive)_80%,var(--foreground))] focus-visible:border-destructive/40 dark:hover:bg-destructive/30\",\n // shadcn/ui uses text-primary, below 4.5:1 in dark mode with most theme\n // colors. A lighter step of the primary keeps 4.5:1 there.\n link: \"text-(--fd-link,var(--primary)) dark:supports-[color:oklch(from_red_l_c_h)]:[--fd-link:oklch(from_var(--primary)_max(l,0.7)_calc(c*1.2)_h)] underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5\",\n xs: \"h-6 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1 px-3 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n lg: \"h-10 gap-1.5 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\nexport type ButtonVariantProps = VariantProps<typeof buttonVariants>\n",
10
10
  "type": "registry:ui"
11
11
  },
12
12
  {
@@ -17,7 +17,7 @@
17
17
  },
18
18
  {
19
19
  "path": "src/components/examples/checkbox/checkbox-demo.astro",
20
- "content": "---\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n Field,\n FieldContent,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldTitle,\n} from \"@/components/ui/field\"\nimport { Label } from \"@/components/ui/label\"\n---\n\n<FieldGroup class=\"max-w-sm\">\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox\" name=\"terms-checkbox\" />\n <Label for=\"terms-checkbox\">Accept terms and conditions</Label>\n </Field>\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox-2\" name=\"terms-checkbox-2\" checked />\n <FieldContent>\n <FieldLabel for=\"terms-checkbox-2\">\n Accept terms and conditions\n </FieldLabel>\n <FieldDescription>\n By clicking this checkbox, you agree to the terms.\n </FieldDescription>\n </FieldContent>\n </Field>\n <Field orientation=\"horizontal\" data-disabled>\n <Checkbox id=\"toggle-checkbox\" name=\"toggle-checkbox\" disabled />\n <FieldLabel for=\"toggle-checkbox\">Enable notifications</FieldLabel>\n </Field>\n <FieldLabel>\n <Field as=\"span\" orientation=\"horizontal\">\n <Checkbox id=\"toggle-checkbox-2\" name=\"toggle-checkbox-2\" />\n <FieldContent as=\"span\">\n <FieldTitle as=\"span\">Enable notifications</FieldTitle>\n <FieldDescription as=\"span\">\n You can enable or disable notifications at any time.\n </FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n</FieldGroup>\n",
20
+ "content": "---\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n Field,\n FieldContent,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldTitle,\n} from \"@/components/ui/field\"\nimport { Label } from \"@/components/ui/label\"\n---\n\n<FieldGroup class=\"max-w-sm\">\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox\" name=\"terms-checkbox\" />\n <Label for=\"terms-checkbox\">Accept terms and conditions</Label>\n </Field>\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox-2\" name=\"terms-checkbox-2\" checked />\n <FieldContent>\n <FieldLabel for=\"terms-checkbox-2\">\n Accept terms and conditions\n </FieldLabel>\n <FieldDescription>\n By clicking this checkbox, you agree to the terms.\n </FieldDescription>\n </FieldContent>\n </Field>\n <Field orientation=\"horizontal\" data-disabled>\n <Checkbox id=\"toggle-checkbox\" name=\"toggle-checkbox\" disabled />\n <FieldLabel for=\"toggle-checkbox\">Enable notifications</FieldLabel>\n </Field>\n <FieldLabel for=\"toggle-checkbox-2\">\n <Field as=\"span\" orientation=\"horizontal\">\n <Checkbox\n id=\"toggle-checkbox-2\"\n name=\"toggle-checkbox-2\"\n aria-labelledby=\"toggle-checkbox-2-title\"\n aria-describedby=\"toggle-checkbox-2-description\"\n />\n <FieldContent as=\"span\">\n <FieldTitle as=\"span\" id=\"toggle-checkbox-2-title\">\n Enable notifications\n </FieldTitle>\n <FieldDescription as=\"span\" id=\"toggle-checkbox-2-description\">\n You can enable or disable notifications at any time.\n </FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n</FieldGroup>\n",
21
21
  "type": "registry:component"
22
22
  },
23
23
  {
@@ -42,12 +42,12 @@
42
42
  },
43
43
  {
44
44
  "path": "src/components/examples/checkbox/checkbox-rtl.astro",
45
- "content": "---\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n Field,\n FieldContent,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldTitle,\n} from \"@/components/ui/field\"\nimport { Label } from \"@/components/ui/label\"\n\nconst translations = {\n en: {\n dir: \"ltr\",\n values: {\n acceptTerms: \"Accept terms and conditions\",\n acceptTermsDescription:\n \"By clicking this checkbox, you agree to the terms.\",\n enableNotifications: \"Enable notifications\",\n enableNotificationsDescription:\n \"You can enable or disable notifications at any time.\",\n },\n },\n ar: {\n dir: \"rtl\",\n values: {\n acceptTerms: \"قبول الشروط والأحكام\",\n acceptTermsDescription: \"بالنقر على هذا المربع، فإنك توافق على الشروط.\",\n enableNotifications: \"تفعيل الإشعارات\",\n enableNotificationsDescription:\n \"يمكنك تفعيل أو إلغاء تفعيل الإشعارات في أي وقت.\",\n },\n },\n he: {\n dir: \"rtl\",\n values: {\n acceptTerms: \"קבל תנאים והגבלות\",\n acceptTermsDescription:\n \"על ידי לחיצה על תיבת הסימון הזו, אתה מסכים לתנאים.\",\n enableNotifications: \"הפעל התראות\",\n enableNotificationsDescription:\n \"אתה יכול להפעיל או להשבית התראות בכל עת.\",\n },\n },\n}\n\nconst { dir, values: t } = translations.ar\n---\n\n<FieldGroup class=\"max-w-sm\" dir={dir}>\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox-rtl\" name=\"terms-checkbox\" />\n <Label for=\"terms-checkbox-rtl\">{t.acceptTerms}</Label>\n </Field>\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox-2-rtl\" name=\"terms-checkbox-2\" checked />\n <FieldContent>\n <FieldLabel for=\"terms-checkbox-2-rtl\">{t.acceptTerms}</FieldLabel>\n <FieldDescription>{t.acceptTermsDescription}</FieldDescription>\n </FieldContent>\n </Field>\n <Field orientation=\"horizontal\" data-disabled>\n <Checkbox id=\"toggle-checkbox-rtl\" name=\"toggle-checkbox\" disabled />\n <FieldLabel for=\"toggle-checkbox-rtl\">{t.enableNotifications}</FieldLabel>\n </Field>\n <FieldLabel>\n <Field as=\"span\" orientation=\"horizontal\">\n <Checkbox id=\"toggle-checkbox-rtl-2\" name=\"toggle-checkbox-2\" />\n <FieldContent as=\"span\">\n <FieldTitle as=\"span\">{t.enableNotifications}</FieldTitle>\n <FieldDescription as=\"span\">\n {t.enableNotificationsDescription}\n </FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n</FieldGroup>\n",
45
+ "content": "---\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n Field,\n FieldContent,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n FieldTitle,\n} from \"@/components/ui/field\"\nimport { Label } from \"@/components/ui/label\"\n\nconst translations = {\n en: {\n dir: \"ltr\",\n values: {\n acceptTerms: \"Accept terms and conditions\",\n acceptTermsDescription:\n \"By clicking this checkbox, you agree to the terms.\",\n enableNotifications: \"Enable notifications\",\n enableNotificationsDescription:\n \"You can enable or disable notifications at any time.\",\n },\n },\n ar: {\n dir: \"rtl\",\n values: {\n acceptTerms: \"قبول الشروط والأحكام\",\n acceptTermsDescription: \"بالنقر على هذا المربع، فإنك توافق على الشروط.\",\n enableNotifications: \"تفعيل الإشعارات\",\n enableNotificationsDescription:\n \"يمكنك تفعيل أو إلغاء تفعيل الإشعارات في أي وقت.\",\n },\n },\n he: {\n dir: \"rtl\",\n values: {\n acceptTerms: \"קבל תנאים והגבלות\",\n acceptTermsDescription:\n \"על ידי לחיצה על תיבת הסימון הזו, אתה מסכים לתנאים.\",\n enableNotifications: \"הפעל התראות\",\n enableNotificationsDescription:\n \"אתה יכול להפעיל או להשבית התראות בכל עת.\",\n },\n },\n}\n\nconst { dir, values: t } = translations.ar\n---\n\n<FieldGroup class=\"max-w-sm\" dir={dir}>\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox-rtl\" name=\"terms-checkbox\" />\n <Label for=\"terms-checkbox-rtl\">{t.acceptTerms}</Label>\n </Field>\n <Field orientation=\"horizontal\">\n <Checkbox id=\"terms-checkbox-2-rtl\" name=\"terms-checkbox-2\" checked />\n <FieldContent>\n <FieldLabel for=\"terms-checkbox-2-rtl\">{t.acceptTerms}</FieldLabel>\n <FieldDescription>{t.acceptTermsDescription}</FieldDescription>\n </FieldContent>\n </Field>\n <Field orientation=\"horizontal\" data-disabled>\n <Checkbox id=\"toggle-checkbox-rtl\" name=\"toggle-checkbox\" disabled />\n <FieldLabel for=\"toggle-checkbox-rtl\">{t.enableNotifications}</FieldLabel>\n </Field>\n <FieldLabel for=\"toggle-checkbox-rtl-2\">\n <Field as=\"span\" orientation=\"horizontal\">\n <Checkbox\n id=\"toggle-checkbox-rtl-2\"\n name=\"toggle-checkbox-2\"\n aria-labelledby=\"toggle-checkbox-rtl-2-title\"\n aria-describedby=\"toggle-checkbox-rtl-2-description\"\n />\n <FieldContent as=\"span\">\n <FieldTitle as=\"span\" id=\"toggle-checkbox-rtl-2-title\">\n {t.enableNotifications}\n </FieldTitle>\n <FieldDescription as=\"span\" id=\"toggle-checkbox-rtl-2-description\">\n {t.enableNotificationsDescription}\n </FieldDescription>\n </FieldContent>\n </Field>\n </FieldLabel>\n</FieldGroup>\n",
46
46
  "type": "registry:component"
47
47
  },
48
48
  {
49
49
  "path": "src/components/examples/checkbox/checkbox-table.astro",
50
- "content": "---\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"@/components/ui/table\"\n\nconst tableData = [\n {\n id: \"1\",\n name: \"Sarah Chen\",\n email: \"sarah.chen@example.com\",\n role: \"Admin\",\n },\n {\n id: \"2\",\n name: \"Marcus Rodriguez\",\n email: \"marcus.rodriguez@example.com\",\n role: \"User\",\n },\n {\n id: \"3\",\n name: \"Priya Patel\",\n email: \"priya.patel@example.com\",\n role: \"User\",\n },\n {\n id: \"4\",\n name: \"David Kim\",\n email: \"david.kim@example.com\",\n role: \"Editor\",\n },\n]\n\nconst selectedRows = new Set([\"1\"])\n---\n\n<Table data-checkbox-table>\n <TableHeader>\n <TableRow>\n <TableHead class=\"w-8\">\n <Checkbox\n id=\"select-all-checkbox\"\n name=\"select-all-checkbox\"\n checked={selectedRows.size === tableData.length}\n data-select-all\n />\n </TableHead>\n <TableHead>Name</TableHead>\n <TableHead>Email</TableHead>\n <TableHead>Role</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {tableData.map((row) => (\n <TableRow data-state={selectedRows.has(row.id) ? \"selected\" : undefined}>\n <TableCell>\n <Checkbox\n id={`row-${row.id}-checkbox`}\n name={`row-${row.id}-checkbox`}\n checked={selectedRows.has(row.id)}\n data-select-row\n />\n </TableCell>\n <TableCell class=\"font-medium\">{row.name}</TableCell>\n <TableCell>{row.email}</TableCell>\n <TableCell>{row.role}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n</Table>\n\n<script>\n const initialize = () => {\n for (const table of document.querySelectorAll(\"[data-checkbox-table]\")) {\n if (table.hasAttribute(\"data-bound\")) continue\n table.setAttribute(\"data-bound\", \"\")\n const all = table.querySelector<HTMLInputElement>(\"[data-select-all]\")\n const rows = [\n ...table.querySelectorAll<HTMLInputElement>(\"[data-select-row]\"),\n ]\n const update = () => {\n for (const row of rows) {\n const tr = row.closest(\"tr\")\n if (row.checked) tr?.setAttribute(\"data-state\", \"selected\")\n else tr?.removeAttribute(\"data-state\")\n }\n if (all) all.checked = rows.every((row) => row.checked)\n }\n all?.addEventListener(\"change\", () => {\n for (const row of rows) row.checked = all.checked\n update()\n })\n for (const row of rows) row.addEventListener(\"change\", update)\n }\n }\n\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n</script>\n",
50
+ "content": "---\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"@/components/ui/table\"\n\nconst tableData = [\n {\n id: \"1\",\n name: \"Sarah Chen\",\n email: \"sarah.chen@example.com\",\n role: \"Admin\",\n },\n {\n id: \"2\",\n name: \"Marcus Rodriguez\",\n email: \"marcus.rodriguez@example.com\",\n role: \"User\",\n },\n {\n id: \"3\",\n name: \"Priya Patel\",\n email: \"priya.patel@example.com\",\n role: \"User\",\n },\n {\n id: \"4\",\n name: \"David Kim\",\n email: \"david.kim@example.com\",\n role: \"Editor\",\n },\n]\n\nconst selectedRows = new Set([\"1\"])\n---\n\n<Table data-checkbox-table>\n <TableHeader>\n <TableRow>\n <TableHead class=\"w-8\">\n <Checkbox\n id=\"select-all-checkbox\"\n name=\"select-all-checkbox\"\n aria-label=\"Select all rows\"\n checked={selectedRows.size === tableData.length}\n data-select-all\n />\n </TableHead>\n <TableHead>Name</TableHead>\n <TableHead>Email</TableHead>\n <TableHead>Role</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {tableData.map((row) => (\n <TableRow data-state={selectedRows.has(row.id) ? \"selected\" : undefined}>\n <TableCell>\n <Checkbox\n id={`row-${row.id}-checkbox`}\n name={`row-${row.id}-checkbox`}\n aria-label={`Select ${row.name}`}\n checked={selectedRows.has(row.id)}\n data-select-row\n />\n </TableCell>\n <TableCell class=\"font-medium\">{row.name}</TableCell>\n <TableCell>{row.email}</TableCell>\n <TableCell>{row.role}</TableCell>\n </TableRow>\n ))}\n </TableBody>\n</Table>\n\n<script>\n const initialize = () => {\n for (const table of document.querySelectorAll(\"[data-checkbox-table]\")) {\n if (table.hasAttribute(\"data-bound\")) continue\n table.setAttribute(\"data-bound\", \"\")\n const all = table.querySelector<HTMLInputElement>(\"[data-select-all]\")\n const rows = [\n ...table.querySelectorAll<HTMLInputElement>(\"[data-select-row]\"),\n ]\n const update = () => {\n for (const row of rows) {\n const tr = row.closest(\"tr\")\n if (row.checked) tr?.setAttribute(\"data-state\", \"selected\")\n else tr?.removeAttribute(\"data-state\")\n }\n if (all) all.checked = rows.every((row) => row.checked)\n }\n all?.addEventListener(\"change\", () => {\n for (const row of rows) row.checked = all.checked\n update()\n })\n for (const row of rows) row.addEventListener(\"change\", update)\n }\n }\n\n initialize()\n document.addEventListener(\"astro:page-load\", initialize)\n</script>\n",
51
51
  "type": "registry:component"
52
52
  }
53
53
  ],
@@ -13,7 +13,7 @@
13
13
  "files": [
14
14
  {
15
15
  "path": "src/components/blocks/content-1.astro",
16
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport { CheckIcon } from \"@lucide/astro\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Section,\n SectionContainer,\n SectionDescription,\n SectionTitle,\n} from \"@/components/ui/section\"\nimport PlaceholderImage from \"@/assets/placeholder.svg\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n features: string[]\n buttons: {\n label: string\n href: string\n }[]\n image?: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n features,\n buttons,\n image = { src: PlaceholderImage, alt: \"\" },\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <SectionDescription>{description}</SectionDescription>\n </div>\n <ul class=\"flex flex-col gap-3\">\n {features.map((feature) => (\n <li class=\"flex items-start gap-3 text-sm\">\n <CheckIcon class=\"text-primary mt-0.5 size-4 shrink-0\" />\n {feature}\n </li>\n ))}\n </ul>\n <div class=\"flex flex-wrap gap-3\">\n {buttons.map(({ href, label }, index) => (\n <Button\n as=\"a\"\n href={href}\n size=\"lg\"\n variant={index === 0 ? \"default\" : \"secondary\"}\n >\n {label}\n </Button>\n ))}\n </div>\n </SectionContainer>\n <SectionContainer>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-video w-full rounded-xl border object-cover\"\n widths={[640, 960, 1280, 1536]}\n sizes=\"(min-width: 80rem) 80rem, 100vw\"\n />\n </SectionContainer>\n</Section>\n",
16
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport CheckIcon from \"@lucide/astro/icons/check\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Section,\n SectionContainer,\n SectionDescription,\n SectionTitle,\n} from \"@/components/ui/section\"\nimport PlaceholderImage from \"@/assets/placeholder.svg\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n features: string[]\n buttons: {\n label: string\n href: string\n }[]\n image?: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n features,\n buttons,\n image = { src: PlaceholderImage, alt: \"\" },\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <SectionDescription>{description}</SectionDescription>\n </div>\n <ul class=\"flex flex-col gap-3\">\n {features.map((feature) => (\n <li class=\"flex items-start gap-3 text-sm\">\n <CheckIcon class=\"text-primary mt-0.5 size-4 shrink-0\" />\n {feature}\n </li>\n ))}\n </ul>\n <div class=\"flex flex-wrap gap-3\">\n {buttons.map(({ href, label }, index) => (\n <Button\n as=\"a\"\n href={href}\n size=\"lg\"\n variant={index === 0 ? \"default\" : \"secondary\"}\n >\n {label}\n </Button>\n ))}\n </div>\n </SectionContainer>\n <SectionContainer>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-video w-full rounded-xl border object-cover\"\n widths={[640, 960, 1280, 1536]}\n sizes=\"(min-width: 80rem) 80rem, 100vw\"\n />\n </SectionContainer>\n</Section>\n",
17
17
  "type": "registry:block"
18
18
  },
19
19
  {
@@ -13,7 +13,7 @@
13
13
  "files": [
14
14
  {
15
15
  "path": "src/components/blocks/content-2.astro",
16
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport { CheckIcon } from \"@lucide/astro\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Section,\n SectionContainer,\n SectionDescription,\n SectionTitle,\n} from \"@/components/ui/section\"\nimport PlaceholderImage from \"@/assets/placeholder.svg\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n features: string[]\n buttons: {\n label: string\n href: string\n }[]\n image?: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n features,\n buttons,\n image = { src: PlaceholderImage, alt: \"\" },\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"grid gap-12 lg:grid-cols-2 lg:items-center\">\n <div class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <SectionDescription>{description}</SectionDescription>\n </div>\n <ul class=\"flex flex-col gap-3\">\n {features.map((feature) => (\n <li class=\"flex items-start gap-3 text-sm\">\n <CheckIcon class=\"text-primary mt-0.5 size-4 shrink-0\" />\n {feature}\n </li>\n ))}\n </ul>\n <div class=\"flex flex-wrap gap-3\">\n {buttons.map(({ href, label }, index) => (\n <Button\n as=\"a\"\n href={href}\n size=\"lg\"\n variant={index === 0 ? \"default\" : \"secondary\"}\n >\n {label}\n </Button>\n ))}\n </div>\n </div>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-[4/3] w-full rounded-xl border object-cover\"\n widths={[640, 960, 1280]}\n sizes=\"(min-width: 80rem) 600px, (min-width: 64rem) 50vw, 100vw\"\n />\n </SectionContainer>\n</Section>\n",
16
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport CheckIcon from \"@lucide/astro/icons/check\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Section,\n SectionContainer,\n SectionDescription,\n SectionTitle,\n} from \"@/components/ui/section\"\nimport PlaceholderImage from \"@/assets/placeholder.svg\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n features: string[]\n buttons: {\n label: string\n href: string\n }[]\n image?: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n features,\n buttons,\n image = { src: PlaceholderImage, alt: \"\" },\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer class=\"grid gap-12 lg:grid-cols-2 lg:items-center\">\n <div class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <SectionDescription>{description}</SectionDescription>\n </div>\n <ul class=\"flex flex-col gap-3\">\n {features.map((feature) => (\n <li class=\"flex items-start gap-3 text-sm\">\n <CheckIcon class=\"text-primary mt-0.5 size-4 shrink-0\" />\n {feature}\n </li>\n ))}\n </ul>\n <div class=\"flex flex-wrap gap-3\">\n {buttons.map(({ href, label }, index) => (\n <Button\n as=\"a\"\n href={href}\n size=\"lg\"\n variant={index === 0 ? \"default\" : \"secondary\"}\n >\n {label}\n </Button>\n ))}\n </div>\n </div>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-[4/3] w-full rounded-xl border object-cover\"\n widths={[640, 960, 1280]}\n sizes=\"(min-width: 80rem) 600px, (min-width: 64rem) 50vw, 100vw\"\n />\n </SectionContainer>\n</Section>\n",
17
17
  "type": "registry:block"
18
18
  },
19
19
  {
@@ -13,7 +13,7 @@
13
13
  "files": [
14
14
  {
15
15
  "path": "src/components/blocks/content-4.astro",
16
- "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport { CheckIcon } from \"@lucide/astro\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Section,\n SectionContainer,\n SectionDescription,\n SectionTitle,\n} from \"@/components/ui/section\"\nimport PlaceholderImage from \"@/assets/placeholder.svg\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n features: string[]\n buttons: {\n label: string\n href: string\n }[]\n image?: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n features,\n buttons,\n image = { src: PlaceholderImage, alt: \"\" },\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer>\n <div class=\"grid gap-12 lg:grid-cols-[1fr_2fr] lg:items-center\">\n <div class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <SectionDescription>{description}</SectionDescription>\n </div>\n <ul class=\"flex flex-col gap-3\">\n {features.map((feature) => (\n <li class=\"flex items-start gap-3 text-sm\">\n <CheckIcon class=\"text-primary mt-0.5 size-4 shrink-0\" />\n {feature}\n </li>\n ))}\n </ul>\n <div class=\"flex flex-wrap gap-3\">\n {buttons.map(({ href, label }, index) => (\n <Button\n as=\"a\"\n href={href}\n size=\"lg\"\n variant={index === 0 ? \"default\" : \"secondary\"}\n >\n {label}\n </Button>\n ))}\n </div>\n </div>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-[4/3] w-full rounded-xl border object-cover\"\n widths={[640, 960, 1280]}\n sizes=\"(min-width: 80rem) 800px, (min-width: 64rem) 66vw, 100vw\"\n />\n </div>\n </SectionContainer>\n</Section>\n",
16
+ "content": "---\nimport type { ImageMetadata } from \"astro\"\nimport { Image } from \"astro:assets\"\nimport type { HTMLAttributes } from \"astro/types\"\nimport CheckIcon from \"@lucide/astro/icons/check\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/components/ui/button\"\nimport {\n Section,\n SectionContainer,\n SectionDescription,\n SectionTitle,\n} from \"@/components/ui/section\"\nimport PlaceholderImage from \"@/assets/placeholder.svg\"\n\ntype Props = HTMLAttributes<\"section\"> & {\n title: string\n description: string\n features: string[]\n buttons: {\n label: string\n href: string\n }[]\n image?: {\n src: ImageMetadata\n alt: string\n }\n}\n\nconst {\n class: className,\n title,\n description,\n features,\n buttons,\n image = { src: PlaceholderImage, alt: \"\" },\n ...props\n} = Astro.props\n---\n\n<Section class={cn(\"\", className)} {...props}>\n <SectionContainer>\n <div class=\"grid gap-12 lg:grid-cols-[1fr_2fr] lg:items-center\">\n <div class=\"flex flex-col gap-6\">\n <div class=\"flex flex-col gap-4\">\n <SectionTitle>{title}</SectionTitle>\n <SectionDescription>{description}</SectionDescription>\n </div>\n <ul class=\"flex flex-col gap-3\">\n {features.map((feature) => (\n <li class=\"flex items-start gap-3 text-sm\">\n <CheckIcon class=\"text-primary mt-0.5 size-4 shrink-0\" />\n {feature}\n </li>\n ))}\n </ul>\n <div class=\"flex flex-wrap gap-3\">\n {buttons.map(({ href, label }, index) => (\n <Button\n as=\"a\"\n href={href}\n size=\"lg\"\n variant={index === 0 ? \"default\" : \"secondary\"}\n >\n {label}\n </Button>\n ))}\n </div>\n </div>\n <Image\n src={image.src}\n alt={image.alt}\n class=\"aspect-[4/3] w-full rounded-xl border object-cover\"\n widths={[640, 960, 1280]}\n sizes=\"(min-width: 80rem) 800px, (min-width: 64rem) 66vw, 100vw\"\n />\n </div>\n </SectionContainer>\n</Section>\n",
17
17
  "type": "registry:block"
18
18
  },
19
19
  {