@deckai/deck-ui 0.0.22 → 0.0.23

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 (249) hide show
  1. package/README.md +0 -1
  2. package/dist/components/AboutCard.cjs +3 -3
  3. package/dist/components/AboutCard.cjs.map +1 -1
  4. package/dist/components/AboutCard.d.cts +1 -1
  5. package/dist/components/AboutCard.d.ts +1 -1
  6. package/dist/components/AboutCard.js +3 -3
  7. package/dist/components/AboutCard.js.map +1 -1
  8. package/dist/components/Accordion.cjs +2 -2
  9. package/dist/components/Accordion.cjs.map +1 -1
  10. package/dist/components/Accordion.js +2 -2
  11. package/dist/components/Accordion.js.map +1 -1
  12. package/dist/components/AddWorkCard.cjs +4 -4
  13. package/dist/components/AddWorkCard.cjs.map +1 -1
  14. package/dist/components/AddWorkCard.d.cts +1 -1
  15. package/dist/components/AddWorkCard.d.ts +1 -1
  16. package/dist/components/AddWorkCard.js +4 -4
  17. package/dist/components/AddWorkCard.js.map +1 -1
  18. package/dist/components/AutocompleteInput.cjs +4 -4
  19. package/dist/components/AutocompleteInput.cjs.map +1 -1
  20. package/dist/components/AutocompleteInput.d.cts +6 -6
  21. package/dist/components/AutocompleteInput.d.ts +6 -6
  22. package/dist/components/AutocompleteInput.js +4 -4
  23. package/dist/components/AutocompleteInput.js.map +1 -1
  24. package/dist/components/Avatar.cjs +1 -1
  25. package/dist/components/Avatar.cjs.map +1 -1
  26. package/dist/components/Avatar.d.cts +2 -2
  27. package/dist/components/Avatar.d.ts +2 -2
  28. package/dist/components/Avatar.js +1 -1
  29. package/dist/components/Avatar.js.map +1 -1
  30. package/dist/components/Badge.cjs +4 -4
  31. package/dist/components/Badge.cjs.map +1 -1
  32. package/dist/components/Badge.d.cts +2 -2
  33. package/dist/components/Badge.d.ts +2 -2
  34. package/dist/components/Badge.js +4 -4
  35. package/dist/components/Badge.js.map +1 -1
  36. package/dist/components/Breadcrumbs.cjs +2 -2
  37. package/dist/components/Breadcrumbs.cjs.map +1 -1
  38. package/dist/components/Breadcrumbs.js +2 -2
  39. package/dist/components/Breadcrumbs.js.map +1 -1
  40. package/dist/components/Button.cjs +5 -5
  41. package/dist/components/Button.cjs.map +1 -1
  42. package/dist/components/Button.d.cts +5 -5
  43. package/dist/components/Button.d.ts +5 -5
  44. package/dist/components/Button.js +5 -5
  45. package/dist/components/Button.js.map +1 -1
  46. package/dist/components/Carousel.cjs +1 -1
  47. package/dist/components/Carousel.cjs.map +1 -1
  48. package/dist/components/Carousel.d.cts +1 -1
  49. package/dist/components/Carousel.d.ts +1 -1
  50. package/dist/components/Carousel.js +1 -1
  51. package/dist/components/Carousel.js.map +1 -1
  52. package/dist/components/Collapsible.cjs +2 -2
  53. package/dist/components/Collapsible.cjs.map +1 -1
  54. package/dist/components/Collapsible.d.cts +4 -4
  55. package/dist/components/Collapsible.d.ts +4 -4
  56. package/dist/components/Collapsible.js +2 -2
  57. package/dist/components/Collapsible.js.map +1 -1
  58. package/dist/components/Combobox.cjs +4 -4
  59. package/dist/components/Combobox.cjs.map +1 -1
  60. package/dist/components/Combobox.d.cts +5 -2
  61. package/dist/components/Combobox.d.ts +5 -2
  62. package/dist/components/Combobox.js +4 -4
  63. package/dist/components/Combobox.js.map +1 -1
  64. package/dist/components/ContactItem.cjs +3 -3
  65. package/dist/components/ContactItem.cjs.map +1 -1
  66. package/dist/components/ContactItem.d.cts +1 -1
  67. package/dist/components/ContactItem.d.ts +1 -1
  68. package/dist/components/ContactItem.js +3 -3
  69. package/dist/components/ContactItem.js.map +1 -1
  70. package/dist/components/Dropdown.cjs +3 -3
  71. package/dist/components/Dropdown.cjs.map +1 -1
  72. package/dist/components/Dropdown.js +3 -3
  73. package/dist/components/Dropdown.js.map +1 -1
  74. package/dist/components/EditButton.cjs +5 -5
  75. package/dist/components/EditButton.cjs.map +1 -1
  76. package/dist/components/EditButton.d.cts +4 -4
  77. package/dist/components/EditButton.d.ts +4 -4
  78. package/dist/components/EditButton.js +5 -5
  79. package/dist/components/EditButton.js.map +1 -1
  80. package/dist/components/Fallback.cjs +1 -1
  81. package/dist/components/Fallback.cjs.map +1 -1
  82. package/dist/components/Fallback.js +1 -1
  83. package/dist/components/Fallback.js.map +1 -1
  84. package/dist/components/Icon.cjs +1 -1
  85. package/dist/components/Icon.cjs.map +1 -1
  86. package/dist/components/Icon.js +1 -1
  87. package/dist/components/Icon.js.map +1 -1
  88. package/dist/components/IconRenderer.cjs +1 -1
  89. package/dist/components/IconRenderer.cjs.map +1 -1
  90. package/dist/components/IconRenderer.d.cts +4 -4
  91. package/dist/components/IconRenderer.d.ts +4 -4
  92. package/dist/components/IconRenderer.js +1 -1
  93. package/dist/components/IconRenderer.js.map +1 -1
  94. package/dist/components/Input.cjs +3 -3
  95. package/dist/components/Input.cjs.map +1 -1
  96. package/dist/components/Input.d.cts +11 -11
  97. package/dist/components/Input.d.ts +11 -11
  98. package/dist/components/Input.js +3 -3
  99. package/dist/components/Input.js.map +1 -1
  100. package/dist/components/Link.cjs +4 -4
  101. package/dist/components/Link.cjs.map +1 -1
  102. package/dist/components/Link.d.cts +1 -1
  103. package/dist/components/Link.d.ts +1 -1
  104. package/dist/components/Link.js +4 -4
  105. package/dist/components/Link.js.map +1 -1
  106. package/dist/components/Logo.cjs +1 -1
  107. package/dist/components/Logo.cjs.map +1 -1
  108. package/dist/components/Logo.d.cts +1 -1
  109. package/dist/components/Logo.d.ts +1 -1
  110. package/dist/components/Logo.js +1 -1
  111. package/dist/components/Logo.js.map +1 -1
  112. package/dist/components/Modal.cjs +1 -1
  113. package/dist/components/Modal.cjs.map +1 -1
  114. package/dist/components/Modal.d.cts +4 -4
  115. package/dist/components/Modal.d.ts +4 -4
  116. package/dist/components/Modal.js +1 -1
  117. package/dist/components/Modal.js.map +1 -1
  118. package/dist/components/MultiSelectCombobox.cjs +2 -2
  119. package/dist/components/MultiSelectCombobox.cjs.map +1 -1
  120. package/dist/components/MultiSelectCombobox.d.cts +1 -1
  121. package/dist/components/MultiSelectCombobox.d.ts +1 -1
  122. package/dist/components/MultiSelectCombobox.js +2 -2
  123. package/dist/components/MultiSelectCombobox.js.map +1 -1
  124. package/dist/components/Navbar.cjs +7 -7
  125. package/dist/components/Navbar.cjs.map +1 -1
  126. package/dist/components/Navbar.d.cts +1 -1
  127. package/dist/components/Navbar.d.ts +1 -1
  128. package/dist/components/Navbar.js +7 -7
  129. package/dist/components/Navbar.js.map +1 -1
  130. package/dist/components/NavbarItem.cjs +4 -4
  131. package/dist/components/NavbarItem.cjs.map +1 -1
  132. package/dist/components/NavbarItem.d.cts +1 -1
  133. package/dist/components/NavbarItem.d.ts +1 -1
  134. package/dist/components/NavbarItem.js +4 -4
  135. package/dist/components/NavbarItem.js.map +1 -1
  136. package/dist/components/Option.cjs +2 -2
  137. package/dist/components/Option.cjs.map +1 -1
  138. package/dist/components/Option.js +2 -2
  139. package/dist/components/Option.js.map +1 -1
  140. package/dist/components/Pressable.cjs +1 -1
  141. package/dist/components/Pressable.cjs.map +1 -1
  142. package/dist/components/Pressable.js +1 -1
  143. package/dist/components/Pressable.js.map +1 -1
  144. package/dist/components/ProfileCard.cjs +2 -2
  145. package/dist/components/ProfileCard.cjs.map +1 -1
  146. package/dist/components/ProfileCard.d.cts +1 -1
  147. package/dist/components/ProfileCard.d.ts +1 -1
  148. package/dist/components/ProfileCard.js +2 -2
  149. package/dist/components/ProfileCard.js.map +1 -1
  150. package/dist/components/ProgressBar.cjs +3 -3
  151. package/dist/components/ProgressBar.cjs.map +1 -1
  152. package/dist/components/ProgressBar.js +3 -3
  153. package/dist/components/ProgressBar.js.map +1 -1
  154. package/dist/components/RadioGroup.cjs +3 -3
  155. package/dist/components/RadioGroup.cjs.map +1 -1
  156. package/dist/components/RadioGroup.js +3 -3
  157. package/dist/components/RadioGroup.js.map +1 -1
  158. package/dist/components/SegmentedTabs.cjs +4 -4
  159. package/dist/components/SegmentedTabs.cjs.map +1 -1
  160. package/dist/components/SegmentedTabs.js +4 -4
  161. package/dist/components/SegmentedTabs.js.map +1 -1
  162. package/dist/components/Sidebar.cjs +1 -1
  163. package/dist/components/Sidebar.cjs.map +1 -1
  164. package/dist/components/Sidebar.d.cts +1 -1
  165. package/dist/components/Sidebar.d.ts +1 -1
  166. package/dist/components/Sidebar.js +1 -1
  167. package/dist/components/Sidebar.js.map +1 -1
  168. package/dist/components/SlideButton.cjs +1 -1
  169. package/dist/components/SlideButton.cjs.map +1 -1
  170. package/dist/components/SlideButton.js +1 -1
  171. package/dist/components/SlideButton.js.map +1 -1
  172. package/dist/components/Slider.cjs.map +1 -1
  173. package/dist/components/Slider.js.map +1 -1
  174. package/dist/components/SocialCard.cjs +4 -4
  175. package/dist/components/SocialCard.cjs.map +1 -1
  176. package/dist/components/SocialCard.d.cts +1 -1
  177. package/dist/components/SocialCard.d.ts +1 -1
  178. package/dist/components/SocialCard.js +4 -4
  179. package/dist/components/SocialCard.js.map +1 -1
  180. package/dist/components/Spinner.cjs +1 -1
  181. package/dist/components/Spinner.cjs.map +1 -1
  182. package/dist/components/Spinner.d.cts +2 -2
  183. package/dist/components/Spinner.d.ts +2 -2
  184. package/dist/components/Spinner.js +1 -1
  185. package/dist/components/Spinner.js.map +1 -1
  186. package/dist/components/Switch.cjs.map +1 -1
  187. package/dist/components/Switch.d.cts +2 -2
  188. package/dist/components/Switch.d.ts +2 -2
  189. package/dist/components/Switch.js.map +1 -1
  190. package/dist/components/Tabs.cjs +3 -3
  191. package/dist/components/Tabs.cjs.map +1 -1
  192. package/dist/components/Tabs.js +3 -3
  193. package/dist/components/Tabs.js.map +1 -1
  194. package/dist/components/Tag.cjs +3 -3
  195. package/dist/components/Tag.cjs.map +1 -1
  196. package/dist/components/Tag.d.cts +1 -1
  197. package/dist/components/Tag.d.ts +1 -1
  198. package/dist/components/Tag.js +3 -3
  199. package/dist/components/Tag.js.map +1 -1
  200. package/dist/components/Text.cjs +1 -1
  201. package/dist/components/Text.cjs.map +1 -1
  202. package/dist/components/Text.d.cts +1 -1
  203. package/dist/components/Text.d.ts +1 -1
  204. package/dist/components/Text.js +1 -1
  205. package/dist/components/Text.js.map +1 -1
  206. package/dist/components/TextArea.cjs +4 -4
  207. package/dist/components/TextArea.cjs.map +1 -1
  208. package/dist/components/TextArea.d.cts +1 -1
  209. package/dist/components/TextArea.d.ts +1 -1
  210. package/dist/components/TextArea.js +4 -4
  211. package/dist/components/TextArea.js.map +1 -1
  212. package/dist/components/Toast.cjs +3 -3
  213. package/dist/components/Toast.cjs.map +1 -1
  214. package/dist/components/Toast.d.cts +7 -7
  215. package/dist/components/Toast.d.ts +7 -7
  216. package/dist/components/Toast.js +3 -3
  217. package/dist/components/Toast.js.map +1 -1
  218. package/dist/components/ToastProvider.cjs +1 -1
  219. package/dist/components/ToastProvider.cjs.map +1 -1
  220. package/dist/components/ToastProvider.d.cts +1 -1
  221. package/dist/components/ToastProvider.d.ts +1 -1
  222. package/dist/components/ToastProvider.js +1 -1
  223. package/dist/components/ToastProvider.js.map +1 -1
  224. package/dist/components/Tooltip.cjs +3 -3
  225. package/dist/components/Tooltip.cjs.map +1 -1
  226. package/dist/components/Tooltip.d.cts +1 -1
  227. package/dist/components/Tooltip.d.ts +1 -1
  228. package/dist/components/Tooltip.js +3 -3
  229. package/dist/components/Tooltip.js.map +1 -1
  230. package/dist/components/VideoPlayer.cjs +2 -2
  231. package/dist/components/VideoPlayer.cjs.map +1 -1
  232. package/dist/components/VideoPlayer.d.cts +4 -4
  233. package/dist/components/VideoPlayer.d.ts +4 -4
  234. package/dist/components/VideoPlayer.js +2 -2
  235. package/dist/components/VideoPlayer.js.map +1 -1
  236. package/dist/components/WorkCard.cjs +3 -3
  237. package/dist/components/WorkCard.cjs.map +1 -1
  238. package/dist/components/WorkCard.d.cts +1 -1
  239. package/dist/components/WorkCard.d.ts +1 -1
  240. package/dist/components/WorkCard.js +3 -3
  241. package/dist/components/WorkCard.js.map +1 -1
  242. package/dist/index.cjs +8 -8
  243. package/dist/index.cjs.map +1 -1
  244. package/dist/index.d.cts +39 -39
  245. package/dist/index.d.ts +39 -39
  246. package/dist/index.js +8 -8
  247. package/dist/index.js.map +1 -1
  248. package/dist/styles/styles.css +1 -1
  249. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/utils/responsive.ts","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/Input.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStylesCoerced","BASE_SIZES","RESPONSIVE_SIZES","getSizeKey","size","getResponsiveSize","baseSize","classes","styles","key","baseKey","responsiveClasses","s","breakpoint","valueStr","value","valueKey","COLOR_MAP","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","responsiveSizeClasses","responsiveSizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Input","end","iconName","label","labelClassName","id","forceShowFocusRing","error","errorMessage","helperText","showCharacterCount","maxLength","defaultValue","onChange","disabled","currentValue","setCurrentValue","handleChange","e","newValue","characterCount","showCount"],"mappings":"seAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCyEO,IAAMG,CAAyB,CAAA,yBAAA,CC5DtC,IAAMC,EAAsC,CAC1C,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACN,CAAA,EAAA,CAAM,mBACN,CAAA,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACN,CAAA,EAAA,CAAM,mBACN,CAAA,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACR,CAAA,CAEMC,EAAgE,CACpE,EAAA,CAAI,CACF,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAA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CACEuB,CAAAA,CAAAA,CAAAA,EAAOC,CACP,GAAArC,YAAA,CAAA,aAAA,CAAC,OAAI,SAAU,CAAA,8CAAA,CAAA,CACZqC,CACC,CAAArC,YAAA,CAAA,aAAA,CAACM,CAAA,CAAA,CACC,IAAM+B,CAAAA,CAAAA,CACN,MAAOK,CAAQ,CAAA,QAAA,CAAW,WAC1B,CAAA,IAAA,CAAMlD,CACN,CAAA,KAAA,CAAOkB,CACT,CAAA,CAAA,CAEA0B,CAEJ,CAEJ,CACCP,CAAAA,CACH,CACA,CAAA7B,YAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,8BACX0C,CAASC,EAAAA,CAAAA,EAAiBC,CAC1B,CAAA5C,YAAA,CAAA,aAAA,CAAC2B,CAAA,CAAA,CACC,OAAQ,CAAA,UAAA,CACR,KAAOe,CAAAA,CAAAA,CAAQ,QAAW,CAAA,WAAA,CAC1B,SAAU,CAAA,MAAA,CAAA,CAETA,CAAQC,CAAAA,CAAAA,CAAeC,CAC1B,CACE,CAAA,IAAA,CACHY,CACC,EAAAxD,YAAA,CAAA,aAAA,CAAC2B,CAAA,CAAA,CACC,OAAQ,CAAA,UAAA,CACR,KAAOe,CAAAA,CAAAA,CAAQ,QAAW,CAAA,WAAA,CAC1B,SAAU,CAAA,iBAAA,CAAA,CAEV1C,YAAC2B,CAAAA,aAAAA,CAAAA,CAAAA,CAAA,CACC,OAAQ,CAAA,UAAA,CACR,EAAG,CAAA,MAAA,CACH,KAAM,CAAA,aAAA,CACN,SAAU,CAAA,WAAA,CAAA,CAET4B,CACH,CACCT,CAAAA,CAAAA,EAAa,CAAIA,CAAAA,EAAAA,CAAS,CAAG,CAAA,CAAA,aAChC,CAEJ,CACF,CAEJ,CACF","file":"Input.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const sizes = [\"24\", \"42\", \"48\", \"64\", \"72\"]; // Add all the sizes you need\n\n const safelist: (string | { pattern: RegExp; variants: string[] })[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n // Generate size classes with responsive variants\n const sizeClasses = sizes.flatMap((size) => [\n `h-[${size}px]`,\n `w-[${size}px]`,\n ...breakpoints.flatMap((bp) => [\n `${bp}:h-[${size}px]`,\n `${bp}:w-[${size}px]`\n ])\n ]);\n\n return [...typographyClasses, ...responsiveTypographyClasses, ...sizeClasses];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100\";\nexport const focusRingWithinStyles =\n \"focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-100\";\nexport const focusRingStylesCoerced = \"ring-2 ring-primary-100\";\n","export type Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type ResponsiveSize = number | `${Breakpoint}:${number}`;\n\ntype SizeKey =\n | \"12\"\n | \"16\"\n | \"18\"\n | \"20\"\n | \"24\"\n | \"32\"\n | \"36\"\n | \"40\"\n | \"42\"\n | \"48\"\n | \"64\"\n | \"72\";\n\n// These constants help Tailwind identify the classes during compilation\nconst BASE_SIZES: Record<SizeKey, string> = {\n \"12\": \"h-[12px] w-[12px]\",\n \"16\": \"h-[16px] w-[16px]\",\n \"18\": \"h-[18px] w-[18px]\",\n \"20\": \"h-[20px] w-[20px]\",\n \"24\": \"h-[24px] w-[24px]\",\n \"32\": \"h-[32px] w-[32px]\",\n \"36\": \"h-[36px] w-[36px]\",\n \"40\": \"h-[40px] w-[40px]\",\n \"42\": \"h-[42px] w-[42px]\",\n \"48\": \"h-[48px] w-[48px]\",\n \"64\": \"h-[64px] w-[64px]\",\n \"72\": \"h-[72px] w-[72px]\"\n};\n\nconst RESPONSIVE_SIZES: Record<Breakpoint, Record<SizeKey, string>> = {\n sm: {\n \"12\": \"sm:h-[12px] sm:w-[12px]\",\n \"16\": \"sm:h-[16px] sm:w-[16px]\",\n \"18\": \"sm:h-[18px] sm:w-[18px]\",\n \"20\": \"sm:h-[20px] sm:w-[20px]\",\n \"24\": \"sm:h-[24px] sm:w-[24px]\",\n \"32\": \"sm:h-[32px] sm:w-[32px]\",\n \"36\": \"sm:h-[36px] sm:w-[36px]\",\n \"40\": \"sm:h-[40px] sm:w-[40px]\",\n \"42\": \"sm:h-[42px] sm:w-[42px]\",\n \"48\": \"sm:h-[48px] sm:w-[48px]\",\n \"64\": \"sm:h-[64px] sm:w-[64px]\",\n \"72\": \"sm:h-[72px] sm:w-[72px]\"\n },\n md: {\n \"12\": \"md:h-[12px] md:w-[12px]\",\n \"16\": \"md:h-[16px] md:w-[16px]\",\n \"18\": \"md:h-[18px] md:w-[18px]\",\n \"20\": \"md:h-[20px] md:w-[20px]\",\n \"24\": \"md:h-[24px] md:w-[24px]\",\n \"32\": \"md:h-[32px] md:w-[32px]\",\n \"36\": \"md:h-[36px] md:w-[36px]\",\n \"40\": \"md:h-[40px] md:w-[40px]\",\n \"42\": \"md:h-[42px] md:w-[42px]\",\n \"48\": \"md:h-[48px] md:w-[48px]\",\n \"64\": \"md:h-[64px] md:w-[64px]\",\n \"72\": \"md:h-[72px] md:w-[72px]\"\n },\n lg: {\n \"12\": \"lg:h-[12px] lg:w-[12px]\",\n \"16\": \"lg:h-[16px] lg:w-[16px]\",\n \"18\": \"lg:h-[18px] lg:w-[18px]\",\n \"20\": \"lg:h-[20px] lg:w-[20px]\",\n \"24\": \"lg:h-[24px] lg:w-[24px]\",\n \"32\": \"lg:h-[32px] lg:w-[32px]\",\n \"36\": \"lg:h-[36px] lg:w-[36px]\",\n \"40\": \"lg:h-[40px] lg:w-[40px]\",\n \"42\": \"lg:h-[42px] lg:w-[42px]\",\n \"48\": \"lg:h-[48px] lg:w-[48px]\",\n \"64\": \"lg:h-[64px] lg:w-[64px]\",\n \"72\": \"lg:h-[72px] lg:w-[72px]\"\n },\n xl: {\n \"12\": \"xl:h-[12px] xl:w-[12px]\",\n \"16\": \"xl:h-[16px] xl:w-[16px]\",\n \"18\": \"xl:h-[18px] xl:w-[18px]\",\n \"20\": \"xl:h-[20px] xl:w-[20px]\",\n \"24\": \"xl:h-[24px] xl:w-[24px]\",\n \"32\": \"xl:h-[32px] xl:w-[32px]\",\n \"36\": \"xl:h-[36px] xl:w-[36px]\",\n \"40\": \"xl:h-[40px] xl:w-[40px]\",\n \"42\": \"xl:h-[42px] xl:w-[42px]\",\n \"48\": \"xl:h-[48px] xl:w-[48px]\",\n \"64\": \"xl:h-[64px] xl:w-[64px]\",\n \"72\": \"xl:h-[72px] xl:w-[72px]\"\n },\n \"2xl\": {\n \"12\": \"2xl:h-[12px] 2xl:w-[12px]\",\n \"16\": \"2xl:h-[16px] 2xl:w-[16px]\",\n \"18\": \"2xl:h-[18px] 2xl:w-[18px]\",\n \"20\": \"2xl:h-[20px] 2xl:w-[20px]\",\n \"24\": \"2xl:h-[24px] 2xl:w-[24px]\",\n \"32\": \"2xl:h-[32px] 2xl:w-[32px]\",\n \"36\": \"2xl:h-[36px] 2xl:w-[36px]\",\n \"40\": \"2xl:h-[40px] 2xl:w-[40px]\",\n \"42\": \"2xl:h-[42px] 2xl:w-[42px]\",\n \"48\": \"2xl:h-[48px] 2xl:w-[48px]\",\n \"64\": \"2xl:h-[64px] 2xl:w-[64px]\",\n \"72\": \"2xl:h-[72px] 2xl:w-[72px]\"\n }\n};\n\nconst getSizeKey = (size: number): SizeKey | undefined => {\n return String(size) as SizeKey;\n};\n\nexport const getResponsiveSize = (\n size: ResponsiveSize | ResponsiveSize[] | undefined,\n baseSize: number = 24\n): {\n responsiveSizeClasses: string;\n responsiveSizeStyles: Record<string, string>;\n} => {\n const classes: string[] = [];\n const styles: Record<string, string> = {};\n\n // If no size provided, use baseSize\n if (size === undefined) {\n const key = getSizeKey(baseSize);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${baseSize}px`;\n styles.width = `${baseSize}px`;\n }\n }\n\n // If size is a number, use that directly\n if (typeof size === \"number\") {\n const key = getSizeKey(size);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${size}px`;\n styles.width = `${size}px`;\n }\n }\n\n // If array of responsive sizes, generate responsive classes\n if (Array.isArray(size)) {\n const baseKey = getSizeKey(baseSize);\n const responsiveClasses = [\n (baseKey && BASE_SIZES[baseKey]) || `h-[${baseSize}px] w-[${baseSize}px]`\n ];\n\n size.forEach((s) => {\n if (typeof s === \"string\") {\n const [breakpoint, valueStr] = s.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const key = getSizeKey(value);\n classes.push(\n (key && RESPONSIVE_SIZES[breakpoint]?.[key]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n });\n\n classes.push(...responsiveClasses);\n }\n\n if (typeof size === \"string\") {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const valueKey = getSizeKey(value);\n classes.push(\n (valueKey && RESPONSIVE_SIZES[breakpoint]?.[valueKey]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n\n return {\n responsiveSizeClasses: classes.join(\" \"),\n responsiveSizeStyles: styles\n };\n};\n","import { IconMap, IconName } from \"@deckai/icons\";\nimport React, { SVGProps } from \"react\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\nimport { ResponsiveSize, getResponsiveSize } from \"../utils/responsive\";\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\n// Using CSS variables to support dark mode\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"var(--color-primary)\",\n secondary: \"var(--color-secondary)\",\n white: \"var(--color-white)\",\n primaryBlue: \"var(--color-primary-100)\",\n disabled: \"var(--color-disabled)\",\n danger: \"var(--color-danger)\"\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const { responsiveSizeClasses, responsiveSizeStyles } = getResponsiveSize(\n size,\n 24\n );\n\n return (\n <div\n className={cn(\n \"flex justify-center items-center\",\n responsiveSizeClasses,\n className\n )}\n style={{\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...responsiveSizeStyles,\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\nimport { Breakpoint } from \"../utils/responsive\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\"\n | \"primary-100\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles using Tailwind classes that reference CSS variables\n const colorClasses = color === \"inherit\" ? \"text-inherit\" : `text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`\n font-sans antialiased\n ${typographyClasses}\n ${colorClasses}\n ${weight && `!${fontWeight[weight]}`}\n ${className}\n `}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import { IconName } from \"@deckai/icons\";\nimport * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\nimport { Icon, IconProps } from \"./Icon\";\nimport { Text } from \"./Text\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Forces the focus ring to show regardless of focus state */\n forceShowFocusRing?: boolean;\n /** Error state for the input */\n error?: boolean;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Character count display */\n showCharacterCount?: boolean;\n /** Maximum number of characters */\n maxLength?: number;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n children,\n forceShowFocusRing,\n error,\n errorMessage,\n helperText,\n showCharacterCount,\n maxLength,\n value,\n defaultValue,\n onChange,\n disabled,\n ...props\n },\n ref\n ) => {\n const [currentValue, setCurrentValue] = React.useState(\n value?.toString() || defaultValue?.toString() || \"\"\n );\n\n // Update internal value when prop changes\n React.useEffect(() => {\n if (value !== undefined) {\n setCurrentValue(value.toString());\n }\n }, [value]);\n\n const handleChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setCurrentValue(newValue);\n onChange?.(e);\n },\n [onChange]\n );\n\n const characterCount = currentValue.length;\n const showCount = showCharacterCount || !!maxLength;\n\n return (\n <div className=\"gap-1 flex flex-col\">\n {label && (\n <Text\n variant=\"label-default\"\n htmlFor={id}\n as=\"label\"\n color={error ? \"danger\" : \"primary\"}\n className={cn(labelClassName)}\n >\n {label}\n </Text>\n )}\n <div\n className={cn(\n \"relative flex flex-col gap-2 w-full rounded-lg border bg-background-0 px-3 md:py-3 py-2 text-secondary transition-colors duration-150\",\n !error && !forceShowFocusRing && \"border-secondary-50\",\n error && \"border-tertiary-10\",\n disabled && \"cursor-not-allowed opacity-50\",\n \"focus-within:ring-2 focus-within:ring-primary-100\",\n forceShowFocusRing && focusRingStylesCoerced\n )}\n >\n <div className=\"flex relative\">\n <input\n ref={ref}\n id={id}\n className={cn(\n \"font-sans text-sm flex w-full bg-background-0 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-primary disabled:cursor-not-allowed focus:outline-none rounded-lg\",\n end && \"pr-10\",\n className\n )}\n value={currentValue}\n maxLength={maxLength}\n onChange={handleChange}\n aria-invalid={error}\n disabled={disabled}\n {...props}\n />\n {(end || iconName) && (\n <div className=\"absolute inset-y-0 right-0 flex items-center\">\n {iconName ? (\n <Icon\n name={iconName}\n color={error ? \"danger\" : \"secondary\"}\n size={size}\n title={title}\n />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n {children}\n </div>\n <div className=\"flex justify-between gap-2\">\n {(error && errorMessage) || helperText ? (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"mt-1\"\n >\n {error ? errorMessage : helperText}\n </Text>\n ) : null}\n {showCount && (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"text-right mt-1\"\n >\n <Text\n variant=\"body-xxs\"\n as=\"span\"\n color=\"primary-100\"\n className=\"font-bold\"\n >\n {characterCount}\n </Text>\n {maxLength && `/${maxLength}`} characters\n </Text>\n )}\n </div>\n </div>\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/utils/responsive.ts","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/Input.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStylesCoerced","BASE_SIZES","RESPONSIVE_SIZES","getSizeKey","size","getResponsiveSize","baseSize","classes","styles","key","baseKey","responsiveClasses","s","breakpoint","valueStr","value","valueKey","COLOR_MAP","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","responsiveSizeClasses","responsiveSizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Input","end","iconName","label","labelClassName","id","forceShowFocusRing","error","errorMessage","helperText","showCharacterCount","maxLength","defaultValue","onChange","disabled","currentValue","setCurrentValue","handleChange","e","newValue","characterCount","showCount"],"mappings":"seAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCyEO,IAAMG,CAAyB,CAAA,yBAAA,CC5DtC,IAAMC,EAAsC,CAC1C,EAAA,CAAM,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AAC2B,EAAA,CAAK,OAAA,CAAQ,UAAW,CAAA,EAAA,CAAG,MAAO,CAAA,SAAA,CAAU,WAC1C4B,CAAAA,CAAAA,CACH,CACCT,CAAAA,CAAAA,EAAa,CAAIA,CAAAA,EAAAA,CAAS,CAAG,CAAA,CAAA,aAChC,CAEJ,CACF,CAEJ,CACF","file":"Input.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import type { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const sizes = [\"24\", \"42\", \"48\", \"64\", \"72\"]; // Add all the sizes you need\n\n const safelist: (string | { pattern: RegExp; variants: string[] })[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n // Generate size classes with responsive variants\n const sizeClasses = sizes.flatMap((size) => [\n `h-[${size}px]`,\n `w-[${size}px]`,\n ...breakpoints.flatMap((bp) => [\n `${bp}:h-[${size}px]`,\n `${bp}:w-[${size}px]`\n ])\n ]);\n\n return [...typographyClasses, ...responsiveTypographyClasses, ...sizeClasses];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100\";\nexport const focusRingWithinStyles =\n \"focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-100\";\nexport const focusRingStylesCoerced = \"ring-2 ring-primary-100\";\n","export type Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type ResponsiveSize = number | `${Breakpoint}:${number}`;\n\ntype SizeKey =\n | \"12\"\n | \"16\"\n | \"18\"\n | \"20\"\n | \"24\"\n | \"32\"\n | \"36\"\n | \"40\"\n | \"42\"\n | \"48\"\n | \"64\"\n | \"72\";\n\n// These constants help Tailwind identify the classes during compilation\nconst BASE_SIZES: Record<SizeKey, string> = {\n \"12\": \"h-[12px] w-[12px]\",\n \"16\": \"h-[16px] w-[16px]\",\n \"18\": \"h-[18px] w-[18px]\",\n \"20\": \"h-[20px] w-[20px]\",\n \"24\": \"h-[24px] w-[24px]\",\n \"32\": \"h-[32px] w-[32px]\",\n \"36\": \"h-[36px] w-[36px]\",\n \"40\": \"h-[40px] w-[40px]\",\n \"42\": \"h-[42px] w-[42px]\",\n \"48\": \"h-[48px] w-[48px]\",\n \"64\": \"h-[64px] w-[64px]\",\n \"72\": \"h-[72px] w-[72px]\"\n};\n\nconst RESPONSIVE_SIZES: Record<Breakpoint, Record<SizeKey, string>> = {\n sm: {\n \"12\": \"sm:h-[12px] sm:w-[12px]\",\n \"16\": \"sm:h-[16px] sm:w-[16px]\",\n \"18\": \"sm:h-[18px] sm:w-[18px]\",\n \"20\": \"sm:h-[20px] sm:w-[20px]\",\n \"24\": \"sm:h-[24px] sm:w-[24px]\",\n \"32\": \"sm:h-[32px] sm:w-[32px]\",\n \"36\": \"sm:h-[36px] sm:w-[36px]\",\n \"40\": \"sm:h-[40px] sm:w-[40px]\",\n \"42\": \"sm:h-[42px] sm:w-[42px]\",\n \"48\": \"sm:h-[48px] sm:w-[48px]\",\n \"64\": \"sm:h-[64px] sm:w-[64px]\",\n \"72\": \"sm:h-[72px] sm:w-[72px]\"\n },\n md: {\n \"12\": \"md:h-[12px] md:w-[12px]\",\n \"16\": \"md:h-[16px] md:w-[16px]\",\n \"18\": \"md:h-[18px] md:w-[18px]\",\n \"20\": \"md:h-[20px] md:w-[20px]\",\n \"24\": \"md:h-[24px] md:w-[24px]\",\n \"32\": \"md:h-[32px] md:w-[32px]\",\n \"36\": \"md:h-[36px] md:w-[36px]\",\n \"40\": \"md:h-[40px] md:w-[40px]\",\n \"42\": \"md:h-[42px] md:w-[42px]\",\n \"48\": \"md:h-[48px] md:w-[48px]\",\n \"64\": \"md:h-[64px] md:w-[64px]\",\n \"72\": \"md:h-[72px] md:w-[72px]\"\n },\n lg: {\n \"12\": \"lg:h-[12px] lg:w-[12px]\",\n \"16\": \"lg:h-[16px] lg:w-[16px]\",\n \"18\": \"lg:h-[18px] lg:w-[18px]\",\n \"20\": \"lg:h-[20px] lg:w-[20px]\",\n \"24\": \"lg:h-[24px] lg:w-[24px]\",\n \"32\": \"lg:h-[32px] lg:w-[32px]\",\n \"36\": \"lg:h-[36px] lg:w-[36px]\",\n \"40\": \"lg:h-[40px] lg:w-[40px]\",\n \"42\": \"lg:h-[42px] lg:w-[42px]\",\n \"48\": \"lg:h-[48px] lg:w-[48px]\",\n \"64\": \"lg:h-[64px] lg:w-[64px]\",\n \"72\": \"lg:h-[72px] lg:w-[72px]\"\n },\n xl: {\n \"12\": \"xl:h-[12px] xl:w-[12px]\",\n \"16\": \"xl:h-[16px] xl:w-[16px]\",\n \"18\": \"xl:h-[18px] xl:w-[18px]\",\n \"20\": \"xl:h-[20px] xl:w-[20px]\",\n \"24\": \"xl:h-[24px] xl:w-[24px]\",\n \"32\": \"xl:h-[32px] xl:w-[32px]\",\n \"36\": \"xl:h-[36px] xl:w-[36px]\",\n \"40\": \"xl:h-[40px] xl:w-[40px]\",\n \"42\": \"xl:h-[42px] xl:w-[42px]\",\n \"48\": \"xl:h-[48px] xl:w-[48px]\",\n \"64\": \"xl:h-[64px] xl:w-[64px]\",\n \"72\": \"xl:h-[72px] xl:w-[72px]\"\n },\n \"2xl\": {\n \"12\": \"2xl:h-[12px] 2xl:w-[12px]\",\n \"16\": \"2xl:h-[16px] 2xl:w-[16px]\",\n \"18\": \"2xl:h-[18px] 2xl:w-[18px]\",\n \"20\": \"2xl:h-[20px] 2xl:w-[20px]\",\n \"24\": \"2xl:h-[24px] 2xl:w-[24px]\",\n \"32\": \"2xl:h-[32px] 2xl:w-[32px]\",\n \"36\": \"2xl:h-[36px] 2xl:w-[36px]\",\n \"40\": \"2xl:h-[40px] 2xl:w-[40px]\",\n \"42\": \"2xl:h-[42px] 2xl:w-[42px]\",\n \"48\": \"2xl:h-[48px] 2xl:w-[48px]\",\n \"64\": \"2xl:h-[64px] 2xl:w-[64px]\",\n \"72\": \"2xl:h-[72px] 2xl:w-[72px]\"\n }\n};\n\nconst getSizeKey = (size: number): SizeKey | undefined => {\n return String(size) as SizeKey;\n};\n\nexport const getResponsiveSize = (\n size: ResponsiveSize | ResponsiveSize[] | undefined,\n baseSize: number = 24\n): {\n responsiveSizeClasses: string;\n responsiveSizeStyles: Record<string, string>;\n} => {\n const classes: string[] = [];\n const styles: Record<string, string> = {};\n\n // If no size provided, use baseSize\n if (size === undefined) {\n const key = getSizeKey(baseSize);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${baseSize}px`;\n styles.width = `${baseSize}px`;\n }\n }\n\n // If size is a number, use that directly\n if (typeof size === \"number\") {\n const key = getSizeKey(size);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${size}px`;\n styles.width = `${size}px`;\n }\n }\n\n // If array of responsive sizes, generate responsive classes\n if (Array.isArray(size)) {\n const baseKey = getSizeKey(baseSize);\n const responsiveClasses = [\n (baseKey && BASE_SIZES[baseKey]) || `h-[${baseSize}px] w-[${baseSize}px]`\n ];\n\n size.forEach((s) => {\n if (typeof s === \"string\") {\n const [breakpoint, valueStr] = s.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const key = getSizeKey(value);\n classes.push(\n (key && RESPONSIVE_SIZES[breakpoint]?.[key]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n });\n\n classes.push(...responsiveClasses);\n }\n\n if (typeof size === \"string\") {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const valueKey = getSizeKey(value);\n classes.push(\n (valueKey && RESPONSIVE_SIZES[breakpoint]?.[valueKey]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n\n return {\n responsiveSizeClasses: classes.join(\" \"),\n responsiveSizeStyles: styles\n };\n};\n","import type { IconName } from \"@deckai/icons\";\nimport { IconMap } from \"@deckai/icons\";\nimport type { SVGProps } from \"react\";\nimport React from \"react\";\n\nimport type { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\nimport type { ResponsiveSize } from \"../utils/responsive\";\nimport { getResponsiveSize } from \"../utils/responsive\";\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\n// Using CSS variables to support dark mode\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"var(--color-primary)\",\n secondary: \"var(--color-secondary)\",\n white: \"var(--color-white)\",\n primaryBlue: \"var(--color-primary-100)\",\n disabled: \"var(--color-disabled)\",\n danger: \"var(--color-danger)\"\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const { responsiveSizeClasses, responsiveSizeStyles } = getResponsiveSize(\n size,\n 24\n );\n\n return (\n <div\n className={cn(\n \"flex justify-center items-center\",\n responsiveSizeClasses,\n className\n )}\n style={{\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...responsiveSizeStyles,\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React from \"react\";\n\nimport type { Typography } from \"../types/tailwind\";\nimport type { Breakpoint } from \"../utils/responsive\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\"\n | \"primary-100\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles using Tailwind classes that reference CSS variables\n const colorClasses = color === \"inherit\" ? \"text-inherit\" : `text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`\n font-sans antialiased\n ${typographyClasses}\n ${colorClasses}\n ${weight && `!${fontWeight[weight]}`}\n ${className}\n `}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import type { IconName } from \"@deckai/icons\";\nimport * as React from \"react\";\n\nimport { cn } from \"../utils\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\nimport type { IconProps } from \"./Icon\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Forces the focus ring to show regardless of focus state */\n forceShowFocusRing?: boolean;\n /** Error state for the input */\n error?: boolean;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Character count display */\n showCharacterCount?: boolean;\n /** Maximum number of characters */\n maxLength?: number;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n children,\n forceShowFocusRing,\n error,\n errorMessage,\n helperText,\n showCharacterCount,\n maxLength,\n value,\n defaultValue,\n onChange,\n disabled,\n ...props\n },\n ref\n ) => {\n const [currentValue, setCurrentValue] = React.useState(\n value?.toString() || defaultValue?.toString() || \"\"\n );\n\n // Update internal value when prop changes\n React.useEffect(() => {\n if (value !== undefined) {\n setCurrentValue(value?.toString() || \"\");\n }\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setCurrentValue(newValue);\n onChange?.(e);\n };\n\n const characterCount = currentValue.length;\n const showCount = showCharacterCount || !!maxLength;\n\n return (\n <div className=\"gap-1 flex flex-col\">\n {label && (\n <Text\n variant=\"label-default\"\n htmlFor={id}\n as=\"label\"\n color={error ? \"danger\" : \"primary\"}\n className={cn(labelClassName)}\n >\n {label}\n </Text>\n )}\n <div\n className={cn(\n \"relative flex flex-col gap-2 w-full rounded-lg border bg-background-0 px-3 md:py-3 py-2 text-secondary transition-colors duration-150\",\n !error && !forceShowFocusRing && \"border-secondary-50\",\n error && \"border-tertiary-10\",\n disabled && \"cursor-not-allowed opacity-50\",\n \"focus-within:ring-2 focus-within:ring-primary-100\",\n forceShowFocusRing && focusRingStylesCoerced\n )}\n >\n <div className=\"flex relative\">\n <input\n ref={ref}\n id={id}\n className={cn(\n \"font-sans text-sm flex w-full bg-background-0 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-primary disabled:cursor-not-allowed focus:outline-none rounded-lg\",\n end && \"pr-10\",\n className\n )}\n value={currentValue}\n maxLength={maxLength}\n onChange={handleChange}\n aria-invalid={error}\n disabled={disabled}\n {...props}\n />\n {(end || iconName) && (\n <div className=\"absolute inset-y-0 right-0 flex items-center\">\n {iconName ? (\n <Icon\n name={iconName}\n color={error ? \"danger\" : \"secondary\"}\n size={size}\n title={title}\n />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n {children}\n </div>\n <div className=\"flex justify-between gap-2\">\n {(error && errorMessage) || helperText ? (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"mt-1\"\n >\n {error ? errorMessage : helperText}\n </Text>\n ) : null}\n {showCount && (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"text-right mt-1\"\n >\n <Text variant=\"body-xxs\" as=\"span\" className=\"font-bold\">\n {characterCount}\n </Text>\n {maxLength && `/${maxLength}`} characters\n </Text>\n )}\n </div>\n </div>\n );\n }\n);\n"]}
@@ -27,26 +27,26 @@ type InputProps = {
27
27
  maxLength?: number;
28
28
  } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "color" | "size" | "title">;
29
29
  declare const Input: React.ForwardRefExoticComponent<{
30
- className?: string;
30
+ className?: string | undefined;
31
31
  end?: React.ReactNode;
32
32
  /** renders an icon in the end slot */
33
- iconName?: IconName;
33
+ iconName?: IconName | undefined;
34
34
  /** Label text for the input */
35
- label?: string;
35
+ label?: string | undefined;
36
36
  /** Additional classes for the label */
37
- labelClassName?: string;
37
+ labelClassName?: string | undefined;
38
38
  /** Forces the focus ring to show regardless of focus state */
39
- forceShowFocusRing?: boolean;
39
+ forceShowFocusRing?: boolean | undefined;
40
40
  /** Error state for the input */
41
- error?: boolean;
41
+ error?: boolean | undefined;
42
42
  /** Error message to display below the input */
43
- errorMessage?: string;
43
+ errorMessage?: string | undefined;
44
44
  /** Helper text displayed below the input */
45
- helperText?: string;
45
+ helperText?: string | undefined;
46
46
  /** Character count display */
47
- showCharacterCount?: boolean;
47
+ showCharacterCount?: boolean | undefined;
48
48
  /** Maximum number of characters */
49
- maxLength?: number;
50
- } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "title" | "color" | "size"> & React.RefAttributes<HTMLInputElement>>;
49
+ maxLength?: number | undefined;
50
+ } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "color" | "title" | "size"> & React.RefAttributes<HTMLInputElement>>;
51
51
 
52
52
  export { Input, type InputProps };
@@ -27,26 +27,26 @@ type InputProps = {
27
27
  maxLength?: number;
28
28
  } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "color" | "size" | "title">;
29
29
  declare const Input: React.ForwardRefExoticComponent<{
30
- className?: string;
30
+ className?: string | undefined;
31
31
  end?: React.ReactNode;
32
32
  /** renders an icon in the end slot */
33
- iconName?: IconName;
33
+ iconName?: IconName | undefined;
34
34
  /** Label text for the input */
35
- label?: string;
35
+ label?: string | undefined;
36
36
  /** Additional classes for the label */
37
- labelClassName?: string;
37
+ labelClassName?: string | undefined;
38
38
  /** Forces the focus ring to show regardless of focus state */
39
- forceShowFocusRing?: boolean;
39
+ forceShowFocusRing?: boolean | undefined;
40
40
  /** Error state for the input */
41
- error?: boolean;
41
+ error?: boolean | undefined;
42
42
  /** Error message to display below the input */
43
- errorMessage?: string;
43
+ errorMessage?: string | undefined;
44
44
  /** Helper text displayed below the input */
45
- helperText?: string;
45
+ helperText?: string | undefined;
46
46
  /** Character count display */
47
- showCharacterCount?: boolean;
47
+ showCharacterCount?: boolean | undefined;
48
48
  /** Maximum number of characters */
49
- maxLength?: number;
50
- } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "title" | "color" | "size"> & React.RefAttributes<HTMLInputElement>>;
49
+ maxLength?: number | undefined;
50
+ } & React.InputHTMLAttributes<HTMLInputElement> & Pick<IconProps, "color" | "title" | "size"> & React.RefAttributes<HTMLInputElement>>;
51
51
 
52
52
  export { Input, type InputProps };
@@ -1,8 +1,8 @@
1
- import*as s from'react';import s__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function h(...e){return twMerge(clsx(e))}var S="ring-2 ring-primary-100";var T={12:"h-[12px] w-[12px]",16:"h-[16px] w-[16px]",18:"h-[18px] w-[18px]",20:"h-[20px] w-[20px]",24:"h-[24px] w-[24px]",32:"h-[32px] w-[32px]",36:"h-[36px] w-[36px]",40:"h-[40px] w-[40px]",42:"h-[42px] w-[42px]",48:"h-[48px] w-[48px]",64:"h-[64px] w-[64px]",72:"h-[72px] w-[72px]"},C={sm:{12:"sm:h-[12px] sm:w-[12px]",16:"sm:h-[16px] sm:w-[16px]",18:"sm:h-[18px] sm:w-[18px]",20:"sm:h-[20px] sm:w-[20px]",24:"sm:h-[24px] sm:w-[24px]",32:"sm:h-[32px] sm:w-[32px]",36:"sm:h-[36px] sm:w-[36px]",40:"sm:h-[40px] sm:w-[40px]",42:"sm:h-[42px] sm:w-[42px]",48:"sm:h-[48px] sm:w-[48px]",64:"sm:h-[64px] sm:w-[64px]",72:"sm:h-[72px] sm:w-[72px]"},md:{12:"md:h-[12px] md:w-[12px]",16:"md:h-[16px] md:w-[16px]",18:"md:h-[18px] md:w-[18px]",20:"md:h-[20px] md:w-[20px]",24:"md:h-[24px] md:w-[24px]",32:"md:h-[32px] md:w-[32px]",36:"md:h-[36px] md:w-[36px]",40:"md:h-[40px] md:w-[40px]",42:"md:h-[42px] md:w-[42px]",48:"md:h-[48px] md:w-[48px]",64:"md:h-[64px] md:w-[64px]",72:"md:h-[72px] md:w-[72px]"},lg:{12:"lg:h-[12px] lg:w-[12px]",16:"lg:h-[16px] lg:w-[16px]",18:"lg:h-[18px] lg:w-[18px]",20:"lg:h-[20px] lg:w-[20px]",24:"lg:h-[24px] lg:w-[24px]",32:"lg:h-[32px] lg:w-[32px]",36:"lg:h-[36px] lg:w-[36px]",40:"lg:h-[40px] lg:w-[40px]",42:"lg:h-[42px] lg:w-[42px]",48:"lg:h-[48px] lg:w-[48px]",64:"lg:h-[64px] lg:w-[64px]",72:"lg:h-[72px] lg:w-[72px]"},xl:{12:"xl:h-[12px] xl:w-[12px]",16:"xl:h-[16px] xl:w-[16px]",18:"xl:h-[18px] xl:w-[18px]",20:"xl:h-[20px] xl:w-[20px]",24:"xl:h-[24px] xl:w-[24px]",32:"xl:h-[32px] xl:w-[32px]",36:"xl:h-[36px] xl:w-[36px]",40:"xl:h-[40px] xl:w-[40px]",42:"xl:h-[42px] xl:w-[42px]",48:"xl:h-[48px] xl:w-[48px]",64:"xl:h-[64px] xl:w-[64px]",72:"xl:h-[72px] xl:w-[72px]"},"2xl":{12:"2xl:h-[12px] 2xl:w-[12px]",16:"2xl:h-[16px] 2xl:w-[16px]",18:"2xl:h-[18px] 2xl:w-[18px]",20:"2xl:h-[20px] 2xl:w-[20px]",24:"2xl:h-[24px] 2xl:w-[24px]",32:"2xl:h-[32px] 2xl:w-[32px]",36:"2xl:h-[36px] 2xl:w-[36px]",40:"2xl:h-[40px] 2xl:w-[40px]",42:"2xl:h-[42px] 2xl:w-[42px]",48:"2xl:h-[48px] 2xl:w-[48px]",64:"2xl:h-[64px] 2xl:w-[64px]",72:"2xl:h-[72px] 2xl:w-[72px]"}},g=e=>String(e),A=(e,p=24)=>{let t=[],n={};if(e===undefined){let r=g(p);r?t.push(T[r]):(n.height=`${p}px`,n.width=`${p}px`);}if(typeof e=="number"){let r=g(e);r?t.push(T[r]):(n.height=`${e}px`,n.width=`${e}px`);}if(Array.isArray(e)){let r=g(p),l=[r&&T[r]||`h-[${p}px] w-[${p}px]`];e.forEach(o=>{if(typeof o=="string"){let[a,m]=o.split(":"),x=parseInt(m,10),c=g(x);t.push(c&&C[a]?.[c]||`${a}:h-[${x}px] ${a}:w-[${x}px]`);}}),t.push(...l);}if(typeof e=="string"){let[r,l]=e.split(":"),o=parseInt(l,10),a=g(o);t.push(a&&C[r]?.[a]||`${r}:h-[${o}px] ${r}:w-[${o}px]`);}return {responsiveSizeClasses:t.join(" "),responsiveSizeStyles:n}};var k={primary:"var(--color-primary)",secondary:"var(--color-secondary)",white:"var(--color-white)",primaryBlue:"var(--color-primary-100)",disabled:"var(--color-disabled)",danger:"var(--color-danger)"},b=s__default.forwardRef(({name:e,size:p=24,color:t="primary",title:n,className:r,style:l={},...o},a)=>{let m=IconMap[e],{responsiveSizeClasses:x,responsiveSizeStyles:c}=A(p,24);return s__default.createElement("div",{className:h("flex justify-center items-center",x,r),style:{"--icon-stroke":k[t],...c,...l}},s__default.createElement(m,{ref:a,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?undefined:k[t],...o}))});b.displayName="Icon";var _={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},F=e=>{let[p,t]=e.split("-");return p==="heading"?_[t]||"p":p==="label"?"label":"p"},q={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},Q=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,r]=t.split(":");return `${n}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",d=s__default.forwardRef(({variant:e="body-default",color:p="primary",as:t,className:n,children:r,weight:l,...o},a)=>{let m=Q(e),x=p==="inherit"?"text-inherit":`text-${p}`,c=s__default.useMemo(()=>{let y=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return F(y)},[e]);return s__default.createElement(t||c,{ref:a,className:`
1
+ import*as s from'react';import s__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function h(...e){return twMerge(clsx(e))}var v="ring-2 ring-primary-100";var T={12:"h-[12px] w-[12px]",16:"h-[16px] w-[16px]",18:"h-[18px] w-[18px]",20:"h-[20px] w-[20px]",24:"h-[24px] w-[24px]",32:"h-[32px] w-[32px]",36:"h-[36px] w-[36px]",40:"h-[40px] w-[40px]",42:"h-[42px] w-[42px]",48:"h-[48px] w-[48px]",64:"h-[64px] w-[64px]",72:"h-[72px] w-[72px]"},S={sm:{12:"sm:h-[12px] sm:w-[12px]",16:"sm:h-[16px] sm:w-[16px]",18:"sm:h-[18px] sm:w-[18px]",20:"sm:h-[20px] sm:w-[20px]",24:"sm:h-[24px] sm:w-[24px]",32:"sm:h-[32px] sm:w-[32px]",36:"sm:h-[36px] sm:w-[36px]",40:"sm:h-[40px] sm:w-[40px]",42:"sm:h-[42px] sm:w-[42px]",48:"sm:h-[48px] sm:w-[48px]",64:"sm:h-[64px] sm:w-[64px]",72:"sm:h-[72px] sm:w-[72px]"},md:{12:"md:h-[12px] md:w-[12px]",16:"md:h-[16px] md:w-[16px]",18:"md:h-[18px] md:w-[18px]",20:"md:h-[20px] md:w-[20px]",24:"md:h-[24px] md:w-[24px]",32:"md:h-[32px] md:w-[32px]",36:"md:h-[36px] md:w-[36px]",40:"md:h-[40px] md:w-[40px]",42:"md:h-[42px] md:w-[42px]",48:"md:h-[48px] md:w-[48px]",64:"md:h-[64px] md:w-[64px]",72:"md:h-[72px] md:w-[72px]"},lg:{12:"lg:h-[12px] lg:w-[12px]",16:"lg:h-[16px] lg:w-[16px]",18:"lg:h-[18px] lg:w-[18px]",20:"lg:h-[20px] lg:w-[20px]",24:"lg:h-[24px] lg:w-[24px]",32:"lg:h-[32px] lg:w-[32px]",36:"lg:h-[36px] lg:w-[36px]",40:"lg:h-[40px] lg:w-[40px]",42:"lg:h-[42px] lg:w-[42px]",48:"lg:h-[48px] lg:w-[48px]",64:"lg:h-[64px] lg:w-[64px]",72:"lg:h-[72px] lg:w-[72px]"},xl:{12:"xl:h-[12px] xl:w-[12px]",16:"xl:h-[16px] xl:w-[16px]",18:"xl:h-[18px] xl:w-[18px]",20:"xl:h-[20px] xl:w-[20px]",24:"xl:h-[24px] xl:w-[24px]",32:"xl:h-[32px] xl:w-[32px]",36:"xl:h-[36px] xl:w-[36px]",40:"xl:h-[40px] xl:w-[40px]",42:"xl:h-[42px] xl:w-[42px]",48:"xl:h-[48px] xl:w-[48px]",64:"xl:h-[64px] xl:w-[64px]",72:"xl:h-[72px] xl:w-[72px]"},"2xl":{12:"2xl:h-[12px] 2xl:w-[12px]",16:"2xl:h-[16px] 2xl:w-[16px]",18:"2xl:h-[18px] 2xl:w-[18px]",20:"2xl:h-[20px] 2xl:w-[20px]",24:"2xl:h-[24px] 2xl:w-[24px]",32:"2xl:h-[32px] 2xl:w-[32px]",36:"2xl:h-[36px] 2xl:w-[36px]",40:"2xl:h-[40px] 2xl:w-[40px]",42:"2xl:h-[42px] 2xl:w-[42px]",48:"2xl:h-[48px] 2xl:w-[48px]",64:"2xl:h-[64px] 2xl:w-[64px]",72:"2xl:h-[72px] 2xl:w-[72px]"}},g=e=>String(e),C=(e,p=24)=>{let t=[],o={};if(e===void 0){let r=g(p);r?t.push(T[r]):(o.height=`${p}px`,o.width=`${p}px`);}if(typeof e=="number"){let r=g(e);r?t.push(T[r]):(o.height=`${e}px`,o.width=`${e}px`);}if(Array.isArray(e)){let r=g(p),l=[r&&T[r]||`h-[${p}px] w-[${p}px]`];e.forEach(n=>{if(typeof n=="string"){let[a,m]=n.split(":"),x=parseInt(m,10),c=g(x);t.push(c&&S[a]?.[c]||`${a}:h-[${x}px] ${a}:w-[${x}px]`);}}),t.push(...l);}if(typeof e=="string"){let[r,l]=e.split(":"),n=parseInt(l,10),a=g(n);t.push(a&&S[r]?.[a]||`${r}:h-[${n}px] ${r}:w-[${n}px]`);}return {responsiveSizeClasses:t.join(" "),responsiveSizeStyles:o}};var A={primary:"var(--color-primary)",secondary:"var(--color-secondary)",white:"var(--color-white)",primaryBlue:"var(--color-primary-100)",disabled:"var(--color-disabled)",danger:"var(--color-danger)"},b=s__default.forwardRef(({name:e,size:p=24,color:t="primary",title:o,className:r,style:l={},...n},a)=>{let m=IconMap[e],{responsiveSizeClasses:x,responsiveSizeStyles:c}=C(p,24);return s__default.createElement("div",{className:h("flex justify-center items-center",x,r),style:{"--icon-stroke":A[t],...c,...l}},s__default.createElement(m,{ref:a,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:A[t],...n}))});b.displayName="Icon";var _={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},F=e=>{let[p,t]=e.split("-");return p==="heading"?_[t]||"p":p==="label"?"label":"p"},q={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},Q=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[o,r]=t.split(":");return `${o}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",d=s__default.forwardRef(({variant:e="body-default",color:p="primary",as:t,className:o,children:r,weight:l,...n},a)=>{let m=Q(e),x=p==="inherit"?"text-inherit":`text-${p}`,c=s__default.useMemo(()=>{let y=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return F(y)},[e]);return s__default.createElement(t||c,{ref:a,className:`
2
2
  font-sans antialiased
3
3
  ${m}
4
4
  ${x}
5
5
  ${l&&`!${q[l]}`}
6
- ${n}
7
- `,...o},r)});d.displayName="Text";var de=s.forwardRef(({className:e,end:p,iconName:t,color:n,size:r,title:l,label:o,labelClassName:a,id:m,children:x,forceShowFocusRing:c,error:i,errorMessage:y,helperText:H,showCharacterCount:I,maxLength:u,value:f,defaultValue:N,onChange:M,disabled:L,...V},P)=>{let[R,$]=s.useState(f?.toString()||N?.toString()||"");s.useEffect(()=>{f!==undefined&&$(f.toString());},[f]);let K=s.useCallback(v=>{let O=v.target.value;$(O),M?.(v);},[M]),j=R.length,B=I||!!u;return s.createElement("div",{className:"gap-1 flex flex-col"},o&&s.createElement(d,{variant:"label-default",htmlFor:m,as:"label",color:i?"danger":"primary",className:h(a)},o),s.createElement("div",{className:h("relative flex flex-col gap-2 w-full rounded-lg border bg-background-0 px-3 md:py-3 py-2 text-secondary transition-colors duration-150",!i&&!c&&"border-secondary-50",i&&"border-tertiary-10",L&&"cursor-not-allowed opacity-50","focus-within:ring-2 focus-within:ring-primary-100",c&&S)},s.createElement("div",{className:"flex relative"},s.createElement("input",{ref:P,id:m,className:h("font-sans text-sm flex w-full bg-background-0 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-primary disabled:cursor-not-allowed focus:outline-none rounded-lg",p&&"pr-10",e),value:R,maxLength:u,onChange:K,"aria-invalid":i,disabled:L,...V}),(p||t)&&s.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center"},t?s.createElement(b,{name:t,color:i?"danger":"secondary",size:r,title:l}):p)),x),s.createElement("div",{className:"flex justify-between gap-2"},i&&y||H?s.createElement(d,{variant:"body-xxs",color:i?"danger":"secondary",className:"mt-1"},i?y:H):null,B&&s.createElement(d,{variant:"body-xxs",color:i?"danger":"secondary",className:"text-right mt-1"},s.createElement(d,{variant:"body-xxs",as:"span",color:"primary-100",className:"font-bold"},j),u&&`/${u}`," characters")))});export{de as Input};//# sourceMappingURL=Input.js.map
6
+ ${o}
7
+ `,...n},r)});d.displayName="Text";var xe=s.forwardRef(({className:e,end:p,iconName:t,color:o,size:r,title:l,label:n,labelClassName:a,id:m,children:x,forceShowFocusRing:c,error:i,errorMessage:y,helperText:H,showCharacterCount:k,maxLength:u,value:f,defaultValue:I,onChange:N,disabled:M,...V},P)=>{let[L,R]=s.useState(f?.toString()||I?.toString()||"");s.useEffect(()=>{f!==void 0&&R(f?.toString()||"");},[f]);let K=$=>{let O=$.target.value;R(O),N?.($);},j=L.length,B=k||!!u;return s.createElement("div",{className:"gap-1 flex flex-col"},n&&s.createElement(d,{variant:"label-default",htmlFor:m,as:"label",color:i?"danger":"primary",className:h(a)},n),s.createElement("div",{className:h("relative flex flex-col gap-2 w-full rounded-lg border bg-background-0 px-3 md:py-3 py-2 text-secondary transition-colors duration-150",!i&&!c&&"border-secondary-50",i&&"border-tertiary-10",M&&"cursor-not-allowed opacity-50","focus-within:ring-2 focus-within:ring-primary-100",c&&v)},s.createElement("div",{className:"flex relative"},s.createElement("input",{ref:P,id:m,className:h("font-sans text-sm flex w-full bg-background-0 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-primary disabled:cursor-not-allowed focus:outline-none rounded-lg",p&&"pr-10",e),value:L,maxLength:u,onChange:K,"aria-invalid":i,disabled:M,...V}),(p||t)&&s.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center"},t?s.createElement(b,{name:t,color:i?"danger":"secondary",size:r,title:l}):p)),x),s.createElement("div",{className:"flex justify-between gap-2"},i&&y||H?s.createElement(d,{variant:"body-xxs",color:i?"danger":"secondary",className:"mt-1"},i?y:H):null,B&&s.createElement(d,{variant:"body-xxs",color:i?"danger":"secondary",className:"text-right mt-1"},s.createElement(d,{variant:"body-xxs",as:"span",className:"font-bold"},j),u&&`/${u}`," characters")))});export{xe as Input};//# sourceMappingURL=Input.js.map
8
8
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/utils/responsive.ts","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/Input.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStylesCoerced","BASE_SIZES","RESPONSIVE_SIZES","getSizeKey","size","getResponsiveSize","baseSize","classes","styles","key","baseKey","responsiveClasses","s","breakpoint","valueStr","value","valueKey","COLOR_MAP","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","responsiveSizeClasses","responsiveSizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Input","end","iconName","label","labelClassName","id","forceShowFocusRing","error","errorMessage","helperText","showCharacterCount","maxLength","defaultValue","onChange","disabled","currentValue","setCurrentValue","handleChange","e","newValue","characterCount","showCount"],"mappings":"uJAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCyEO,IAAMG,CAAyB,CAAA,yBAAA,CC5DtC,IAAMC,EAAsC,CAC1C,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACN,CAAA,EAAA,CAAM,mBACN,CAAA,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACN,CAAA,EAAA,CAAM,mBACN,CAAA,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACR,CAAA,CAEMC,EAAgE,CACpE,EAAA,CAAI,CACF,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,yBACN,CAAA,EAAA,CAAM,yBACR,CACA,CAAA,EAAA,CAAI,CACF,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,yBACR,CACA,CAAA,EAAA,CAAI,CACF,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,EAAM,CAAA,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AAeC,CAC1B,CACE,CAAA,IAAA,CACHY,CACC,EAAA,CAAA,CAAA,aAAA,CAAC7B,CAAA,CAAA,CACC,OAAQ,CAAA,UAAA,CACR,KAAOe,CAAAA,CAAAA,CAAQ,QAAW,CAAA,WAAA,CAC1B,SAAU,CAAA,iBAAA,CAAA,CAEV,CAACf,CAAAA,aAAAA,CAAAA,CAAAA,CAAA,CACC,OAAQ,CAAA,UAAA,CACR,EAAG,CAAA,MAAA,CACH,KAAM,CAAA,aAAA,CACN,SAAU,CAAA,WAAA,CAAA,CAET4B,CACH,CACCT,CAAAA,CAAAA,EAAa,CAAIA,CAAAA,EAAAA,CAAS,CAAG,CAAA,CAAA,aAChC,CAEJ,CACF,CAEJ,CACF","file":"Input.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const sizes = [\"24\", \"42\", \"48\", \"64\", \"72\"]; // Add all the sizes you need\n\n const safelist: (string | { pattern: RegExp; variants: string[] })[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n // Generate size classes with responsive variants\n const sizeClasses = sizes.flatMap((size) => [\n `h-[${size}px]`,\n `w-[${size}px]`,\n ...breakpoints.flatMap((bp) => [\n `${bp}:h-[${size}px]`,\n `${bp}:w-[${size}px]`\n ])\n ]);\n\n return [...typographyClasses, ...responsiveTypographyClasses, ...sizeClasses];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100\";\nexport const focusRingWithinStyles =\n \"focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-100\";\nexport const focusRingStylesCoerced = \"ring-2 ring-primary-100\";\n","export type Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type ResponsiveSize = number | `${Breakpoint}:${number}`;\n\ntype SizeKey =\n | \"12\"\n | \"16\"\n | \"18\"\n | \"20\"\n | \"24\"\n | \"32\"\n | \"36\"\n | \"40\"\n | \"42\"\n | \"48\"\n | \"64\"\n | \"72\";\n\n// These constants help Tailwind identify the classes during compilation\nconst BASE_SIZES: Record<SizeKey, string> = {\n \"12\": \"h-[12px] w-[12px]\",\n \"16\": \"h-[16px] w-[16px]\",\n \"18\": \"h-[18px] w-[18px]\",\n \"20\": \"h-[20px] w-[20px]\",\n \"24\": \"h-[24px] w-[24px]\",\n \"32\": \"h-[32px] w-[32px]\",\n \"36\": \"h-[36px] w-[36px]\",\n \"40\": \"h-[40px] w-[40px]\",\n \"42\": \"h-[42px] w-[42px]\",\n \"48\": \"h-[48px] w-[48px]\",\n \"64\": \"h-[64px] w-[64px]\",\n \"72\": \"h-[72px] w-[72px]\"\n};\n\nconst RESPONSIVE_SIZES: Record<Breakpoint, Record<SizeKey, string>> = {\n sm: {\n \"12\": \"sm:h-[12px] sm:w-[12px]\",\n \"16\": \"sm:h-[16px] sm:w-[16px]\",\n \"18\": \"sm:h-[18px] sm:w-[18px]\",\n \"20\": \"sm:h-[20px] sm:w-[20px]\",\n \"24\": \"sm:h-[24px] sm:w-[24px]\",\n \"32\": \"sm:h-[32px] sm:w-[32px]\",\n \"36\": \"sm:h-[36px] sm:w-[36px]\",\n \"40\": \"sm:h-[40px] sm:w-[40px]\",\n \"42\": \"sm:h-[42px] sm:w-[42px]\",\n \"48\": \"sm:h-[48px] sm:w-[48px]\",\n \"64\": \"sm:h-[64px] sm:w-[64px]\",\n \"72\": \"sm:h-[72px] sm:w-[72px]\"\n },\n md: {\n \"12\": \"md:h-[12px] md:w-[12px]\",\n \"16\": \"md:h-[16px] md:w-[16px]\",\n \"18\": \"md:h-[18px] md:w-[18px]\",\n \"20\": \"md:h-[20px] md:w-[20px]\",\n \"24\": \"md:h-[24px] md:w-[24px]\",\n \"32\": \"md:h-[32px] md:w-[32px]\",\n \"36\": \"md:h-[36px] md:w-[36px]\",\n \"40\": \"md:h-[40px] md:w-[40px]\",\n \"42\": \"md:h-[42px] md:w-[42px]\",\n \"48\": \"md:h-[48px] md:w-[48px]\",\n \"64\": \"md:h-[64px] md:w-[64px]\",\n \"72\": \"md:h-[72px] md:w-[72px]\"\n },\n lg: {\n \"12\": \"lg:h-[12px] lg:w-[12px]\",\n \"16\": \"lg:h-[16px] lg:w-[16px]\",\n \"18\": \"lg:h-[18px] lg:w-[18px]\",\n \"20\": \"lg:h-[20px] lg:w-[20px]\",\n \"24\": \"lg:h-[24px] lg:w-[24px]\",\n \"32\": \"lg:h-[32px] lg:w-[32px]\",\n \"36\": \"lg:h-[36px] lg:w-[36px]\",\n \"40\": \"lg:h-[40px] lg:w-[40px]\",\n \"42\": \"lg:h-[42px] lg:w-[42px]\",\n \"48\": \"lg:h-[48px] lg:w-[48px]\",\n \"64\": \"lg:h-[64px] lg:w-[64px]\",\n \"72\": \"lg:h-[72px] lg:w-[72px]\"\n },\n xl: {\n \"12\": \"xl:h-[12px] xl:w-[12px]\",\n \"16\": \"xl:h-[16px] xl:w-[16px]\",\n \"18\": \"xl:h-[18px] xl:w-[18px]\",\n \"20\": \"xl:h-[20px] xl:w-[20px]\",\n \"24\": \"xl:h-[24px] xl:w-[24px]\",\n \"32\": \"xl:h-[32px] xl:w-[32px]\",\n \"36\": \"xl:h-[36px] xl:w-[36px]\",\n \"40\": \"xl:h-[40px] xl:w-[40px]\",\n \"42\": \"xl:h-[42px] xl:w-[42px]\",\n \"48\": \"xl:h-[48px] xl:w-[48px]\",\n \"64\": \"xl:h-[64px] xl:w-[64px]\",\n \"72\": \"xl:h-[72px] xl:w-[72px]\"\n },\n \"2xl\": {\n \"12\": \"2xl:h-[12px] 2xl:w-[12px]\",\n \"16\": \"2xl:h-[16px] 2xl:w-[16px]\",\n \"18\": \"2xl:h-[18px] 2xl:w-[18px]\",\n \"20\": \"2xl:h-[20px] 2xl:w-[20px]\",\n \"24\": \"2xl:h-[24px] 2xl:w-[24px]\",\n \"32\": \"2xl:h-[32px] 2xl:w-[32px]\",\n \"36\": \"2xl:h-[36px] 2xl:w-[36px]\",\n \"40\": \"2xl:h-[40px] 2xl:w-[40px]\",\n \"42\": \"2xl:h-[42px] 2xl:w-[42px]\",\n \"48\": \"2xl:h-[48px] 2xl:w-[48px]\",\n \"64\": \"2xl:h-[64px] 2xl:w-[64px]\",\n \"72\": \"2xl:h-[72px] 2xl:w-[72px]\"\n }\n};\n\nconst getSizeKey = (size: number): SizeKey | undefined => {\n return String(size) as SizeKey;\n};\n\nexport const getResponsiveSize = (\n size: ResponsiveSize | ResponsiveSize[] | undefined,\n baseSize: number = 24\n): {\n responsiveSizeClasses: string;\n responsiveSizeStyles: Record<string, string>;\n} => {\n const classes: string[] = [];\n const styles: Record<string, string> = {};\n\n // If no size provided, use baseSize\n if (size === undefined) {\n const key = getSizeKey(baseSize);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${baseSize}px`;\n styles.width = `${baseSize}px`;\n }\n }\n\n // If size is a number, use that directly\n if (typeof size === \"number\") {\n const key = getSizeKey(size);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${size}px`;\n styles.width = `${size}px`;\n }\n }\n\n // If array of responsive sizes, generate responsive classes\n if (Array.isArray(size)) {\n const baseKey = getSizeKey(baseSize);\n const responsiveClasses = [\n (baseKey && BASE_SIZES[baseKey]) || `h-[${baseSize}px] w-[${baseSize}px]`\n ];\n\n size.forEach((s) => {\n if (typeof s === \"string\") {\n const [breakpoint, valueStr] = s.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const key = getSizeKey(value);\n classes.push(\n (key && RESPONSIVE_SIZES[breakpoint]?.[key]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n });\n\n classes.push(...responsiveClasses);\n }\n\n if (typeof size === \"string\") {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const valueKey = getSizeKey(value);\n classes.push(\n (valueKey && RESPONSIVE_SIZES[breakpoint]?.[valueKey]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n\n return {\n responsiveSizeClasses: classes.join(\" \"),\n responsiveSizeStyles: styles\n };\n};\n","import { IconMap, IconName } from \"@deckai/icons\";\nimport React, { SVGProps } from \"react\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\nimport { ResponsiveSize, getResponsiveSize } from \"../utils/responsive\";\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\n// Using CSS variables to support dark mode\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"var(--color-primary)\",\n secondary: \"var(--color-secondary)\",\n white: \"var(--color-white)\",\n primaryBlue: \"var(--color-primary-100)\",\n disabled: \"var(--color-disabled)\",\n danger: \"var(--color-danger)\"\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const { responsiveSizeClasses, responsiveSizeStyles } = getResponsiveSize(\n size,\n 24\n );\n\n return (\n <div\n className={cn(\n \"flex justify-center items-center\",\n responsiveSizeClasses,\n className\n )}\n style={{\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...responsiveSizeStyles,\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\nimport { Breakpoint } from \"../utils/responsive\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\"\n | \"primary-100\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles using Tailwind classes that reference CSS variables\n const colorClasses = color === \"inherit\" ? \"text-inherit\" : `text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`\n font-sans antialiased\n ${typographyClasses}\n ${colorClasses}\n ${weight && `!${fontWeight[weight]}`}\n ${className}\n `}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import { IconName } from \"@deckai/icons\";\nimport * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\nimport { Icon, IconProps } from \"./Icon\";\nimport { Text } from \"./Text\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Forces the focus ring to show regardless of focus state */\n forceShowFocusRing?: boolean;\n /** Error state for the input */\n error?: boolean;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Character count display */\n showCharacterCount?: boolean;\n /** Maximum number of characters */\n maxLength?: number;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n children,\n forceShowFocusRing,\n error,\n errorMessage,\n helperText,\n showCharacterCount,\n maxLength,\n value,\n defaultValue,\n onChange,\n disabled,\n ...props\n },\n ref\n ) => {\n const [currentValue, setCurrentValue] = React.useState(\n value?.toString() || defaultValue?.toString() || \"\"\n );\n\n // Update internal value when prop changes\n React.useEffect(() => {\n if (value !== undefined) {\n setCurrentValue(value.toString());\n }\n }, [value]);\n\n const handleChange = React.useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setCurrentValue(newValue);\n onChange?.(e);\n },\n [onChange]\n );\n\n const characterCount = currentValue.length;\n const showCount = showCharacterCount || !!maxLength;\n\n return (\n <div className=\"gap-1 flex flex-col\">\n {label && (\n <Text\n variant=\"label-default\"\n htmlFor={id}\n as=\"label\"\n color={error ? \"danger\" : \"primary\"}\n className={cn(labelClassName)}\n >\n {label}\n </Text>\n )}\n <div\n className={cn(\n \"relative flex flex-col gap-2 w-full rounded-lg border bg-background-0 px-3 md:py-3 py-2 text-secondary transition-colors duration-150\",\n !error && !forceShowFocusRing && \"border-secondary-50\",\n error && \"border-tertiary-10\",\n disabled && \"cursor-not-allowed opacity-50\",\n \"focus-within:ring-2 focus-within:ring-primary-100\",\n forceShowFocusRing && focusRingStylesCoerced\n )}\n >\n <div className=\"flex relative\">\n <input\n ref={ref}\n id={id}\n className={cn(\n \"font-sans text-sm flex w-full bg-background-0 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-primary disabled:cursor-not-allowed focus:outline-none rounded-lg\",\n end && \"pr-10\",\n className\n )}\n value={currentValue}\n maxLength={maxLength}\n onChange={handleChange}\n aria-invalid={error}\n disabled={disabled}\n {...props}\n />\n {(end || iconName) && (\n <div className=\"absolute inset-y-0 right-0 flex items-center\">\n {iconName ? (\n <Icon\n name={iconName}\n color={error ? \"danger\" : \"secondary\"}\n size={size}\n title={title}\n />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n {children}\n </div>\n <div className=\"flex justify-between gap-2\">\n {(error && errorMessage) || helperText ? (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"mt-1\"\n >\n {error ? errorMessage : helperText}\n </Text>\n ) : null}\n {showCount && (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"text-right mt-1\"\n >\n <Text\n variant=\"body-xxs\"\n as=\"span\"\n color=\"primary-100\"\n className=\"font-bold\"\n >\n {characterCount}\n </Text>\n {maxLength && `/${maxLength}`} characters\n </Text>\n )}\n </div>\n </div>\n );\n }\n);\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/utils/responsive.ts","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/Input.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStylesCoerced","BASE_SIZES","RESPONSIVE_SIZES","getSizeKey","size","getResponsiveSize","baseSize","classes","styles","key","baseKey","responsiveClasses","s","breakpoint","valueStr","value","valueKey","COLOR_MAP","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","responsiveSizeClasses","responsiveSizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Input","end","iconName","label","labelClassName","id","forceShowFocusRing","error","errorMessage","helperText","showCharacterCount","maxLength","defaultValue","onChange","disabled","currentValue","setCurrentValue","handleChange","e","newValue","characterCount","showCount"],"mappings":"uJAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCyEO,IAAMG,CAAyB,CAAA,yBAAA,CC5DtC,IAAMC,EAAsC,CAC1C,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACN,CAAA,EAAA,CAAM,mBACN,CAAA,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACN,CAAA,EAAA,CAAM,mBACN,CAAA,EAAA,CAAM,oBACN,EAAM,CAAA,mBAAA,CACN,GAAM,mBACR,CAAA,CAEMC,EAAgE,CACpE,EAAA,CAAI,CACF,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EAAA,CAAM,yBACN,CAAA,EAAA,CAAM,yBACR,CACA,CAAA,EAAA,CAAI,CACF,EAAA,CAAM,0BACN,EAAM,CAAA,yBAAA,CACN,EAAM,CAAA,yBAAA,CACN,GAAM,yBACN,CAAA,EA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AAAA,CAEJ,CAEJ,CAAA,CACCP,CACH,CAAA,CACA,CAAC,CAAA,aAAA,CAAA,KAAA,CAAA,CAAI,UAAU,4BACXa,CAAAA,CAAAA,CAAAA,EAASC,CAAiBC,EAAAA,CAAAA,CAC1B,CAACjB,CAAAA,aAAAA,CAAAA,CAAAA,CAAA,CACC,OAAA,CAAQ,UACR,CAAA,KAAA,CAAOe,CAAQ,CAAA,QAAA,CAAW,WAC1B,CAAA,SAAA,CAAU,MAETA,CAAAA,CAAAA,CAAAA,CAAQC,EAAeC,CAC1B,CAAA,CACE,IACHY,CAAAA,CAAAA,EACC,CAAC7B,CAAAA,aAAAA,CAAAA,CAAAA,CAAA,CACC,OAAA,CAAQ,UACR,CAAA,KAAA,CAAOe,CAAQ,CAAA,QAAA,CAAW,WAC1B,CAAA,SAAA,CAAU,iBAEV,CAAA,CAAA,CAAA,CAAA,aAAA,CAACf,EAAA,CAAK,OAAA,CAAQ,UAAW,CAAA,EAAA,CAAG,MAAO,CAAA,SAAA,CAAU,WAC1C4B,CAAAA,CAAAA,CACH,CACCT,CAAAA,CAAAA,EAAa,CAAIA,CAAAA,EAAAA,CAAS,CAAG,CAAA,CAAA,aAChC,CAEJ,CACF,CAEJ,CACF","file":"Input.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import type { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const sizes = [\"24\", \"42\", \"48\", \"64\", \"72\"]; // Add all the sizes you need\n\n const safelist: (string | { pattern: RegExp; variants: string[] })[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n // Generate size classes with responsive variants\n const sizeClasses = sizes.flatMap((size) => [\n `h-[${size}px]`,\n `w-[${size}px]`,\n ...breakpoints.flatMap((bp) => [\n `${bp}:h-[${size}px]`,\n `${bp}:w-[${size}px]`\n ])\n ]);\n\n return [...typographyClasses, ...responsiveTypographyClasses, ...sizeClasses];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100\";\nexport const focusRingWithinStyles =\n \"focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-100\";\nexport const focusRingStylesCoerced = \"ring-2 ring-primary-100\";\n","export type Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\nexport type ResponsiveSize = number | `${Breakpoint}:${number}`;\n\ntype SizeKey =\n | \"12\"\n | \"16\"\n | \"18\"\n | \"20\"\n | \"24\"\n | \"32\"\n | \"36\"\n | \"40\"\n | \"42\"\n | \"48\"\n | \"64\"\n | \"72\";\n\n// These constants help Tailwind identify the classes during compilation\nconst BASE_SIZES: Record<SizeKey, string> = {\n \"12\": \"h-[12px] w-[12px]\",\n \"16\": \"h-[16px] w-[16px]\",\n \"18\": \"h-[18px] w-[18px]\",\n \"20\": \"h-[20px] w-[20px]\",\n \"24\": \"h-[24px] w-[24px]\",\n \"32\": \"h-[32px] w-[32px]\",\n \"36\": \"h-[36px] w-[36px]\",\n \"40\": \"h-[40px] w-[40px]\",\n \"42\": \"h-[42px] w-[42px]\",\n \"48\": \"h-[48px] w-[48px]\",\n \"64\": \"h-[64px] w-[64px]\",\n \"72\": \"h-[72px] w-[72px]\"\n};\n\nconst RESPONSIVE_SIZES: Record<Breakpoint, Record<SizeKey, string>> = {\n sm: {\n \"12\": \"sm:h-[12px] sm:w-[12px]\",\n \"16\": \"sm:h-[16px] sm:w-[16px]\",\n \"18\": \"sm:h-[18px] sm:w-[18px]\",\n \"20\": \"sm:h-[20px] sm:w-[20px]\",\n \"24\": \"sm:h-[24px] sm:w-[24px]\",\n \"32\": \"sm:h-[32px] sm:w-[32px]\",\n \"36\": \"sm:h-[36px] sm:w-[36px]\",\n \"40\": \"sm:h-[40px] sm:w-[40px]\",\n \"42\": \"sm:h-[42px] sm:w-[42px]\",\n \"48\": \"sm:h-[48px] sm:w-[48px]\",\n \"64\": \"sm:h-[64px] sm:w-[64px]\",\n \"72\": \"sm:h-[72px] sm:w-[72px]\"\n },\n md: {\n \"12\": \"md:h-[12px] md:w-[12px]\",\n \"16\": \"md:h-[16px] md:w-[16px]\",\n \"18\": \"md:h-[18px] md:w-[18px]\",\n \"20\": \"md:h-[20px] md:w-[20px]\",\n \"24\": \"md:h-[24px] md:w-[24px]\",\n \"32\": \"md:h-[32px] md:w-[32px]\",\n \"36\": \"md:h-[36px] md:w-[36px]\",\n \"40\": \"md:h-[40px] md:w-[40px]\",\n \"42\": \"md:h-[42px] md:w-[42px]\",\n \"48\": \"md:h-[48px] md:w-[48px]\",\n \"64\": \"md:h-[64px] md:w-[64px]\",\n \"72\": \"md:h-[72px] md:w-[72px]\"\n },\n lg: {\n \"12\": \"lg:h-[12px] lg:w-[12px]\",\n \"16\": \"lg:h-[16px] lg:w-[16px]\",\n \"18\": \"lg:h-[18px] lg:w-[18px]\",\n \"20\": \"lg:h-[20px] lg:w-[20px]\",\n \"24\": \"lg:h-[24px] lg:w-[24px]\",\n \"32\": \"lg:h-[32px] lg:w-[32px]\",\n \"36\": \"lg:h-[36px] lg:w-[36px]\",\n \"40\": \"lg:h-[40px] lg:w-[40px]\",\n \"42\": \"lg:h-[42px] lg:w-[42px]\",\n \"48\": \"lg:h-[48px] lg:w-[48px]\",\n \"64\": \"lg:h-[64px] lg:w-[64px]\",\n \"72\": \"lg:h-[72px] lg:w-[72px]\"\n },\n xl: {\n \"12\": \"xl:h-[12px] xl:w-[12px]\",\n \"16\": \"xl:h-[16px] xl:w-[16px]\",\n \"18\": \"xl:h-[18px] xl:w-[18px]\",\n \"20\": \"xl:h-[20px] xl:w-[20px]\",\n \"24\": \"xl:h-[24px] xl:w-[24px]\",\n \"32\": \"xl:h-[32px] xl:w-[32px]\",\n \"36\": \"xl:h-[36px] xl:w-[36px]\",\n \"40\": \"xl:h-[40px] xl:w-[40px]\",\n \"42\": \"xl:h-[42px] xl:w-[42px]\",\n \"48\": \"xl:h-[48px] xl:w-[48px]\",\n \"64\": \"xl:h-[64px] xl:w-[64px]\",\n \"72\": \"xl:h-[72px] xl:w-[72px]\"\n },\n \"2xl\": {\n \"12\": \"2xl:h-[12px] 2xl:w-[12px]\",\n \"16\": \"2xl:h-[16px] 2xl:w-[16px]\",\n \"18\": \"2xl:h-[18px] 2xl:w-[18px]\",\n \"20\": \"2xl:h-[20px] 2xl:w-[20px]\",\n \"24\": \"2xl:h-[24px] 2xl:w-[24px]\",\n \"32\": \"2xl:h-[32px] 2xl:w-[32px]\",\n \"36\": \"2xl:h-[36px] 2xl:w-[36px]\",\n \"40\": \"2xl:h-[40px] 2xl:w-[40px]\",\n \"42\": \"2xl:h-[42px] 2xl:w-[42px]\",\n \"48\": \"2xl:h-[48px] 2xl:w-[48px]\",\n \"64\": \"2xl:h-[64px] 2xl:w-[64px]\",\n \"72\": \"2xl:h-[72px] 2xl:w-[72px]\"\n }\n};\n\nconst getSizeKey = (size: number): SizeKey | undefined => {\n return String(size) as SizeKey;\n};\n\nexport const getResponsiveSize = (\n size: ResponsiveSize | ResponsiveSize[] | undefined,\n baseSize: number = 24\n): {\n responsiveSizeClasses: string;\n responsiveSizeStyles: Record<string, string>;\n} => {\n const classes: string[] = [];\n const styles: Record<string, string> = {};\n\n // If no size provided, use baseSize\n if (size === undefined) {\n const key = getSizeKey(baseSize);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${baseSize}px`;\n styles.width = `${baseSize}px`;\n }\n }\n\n // If size is a number, use that directly\n if (typeof size === \"number\") {\n const key = getSizeKey(size);\n if (key) {\n classes.push(BASE_SIZES[key]);\n } else {\n styles.height = `${size}px`;\n styles.width = `${size}px`;\n }\n }\n\n // If array of responsive sizes, generate responsive classes\n if (Array.isArray(size)) {\n const baseKey = getSizeKey(baseSize);\n const responsiveClasses = [\n (baseKey && BASE_SIZES[baseKey]) || `h-[${baseSize}px] w-[${baseSize}px]`\n ];\n\n size.forEach((s) => {\n if (typeof s === \"string\") {\n const [breakpoint, valueStr] = s.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const key = getSizeKey(value);\n classes.push(\n (key && RESPONSIVE_SIZES[breakpoint]?.[key]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n });\n\n classes.push(...responsiveClasses);\n }\n\n if (typeof size === \"string\") {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n const valueKey = getSizeKey(value);\n classes.push(\n (valueKey && RESPONSIVE_SIZES[breakpoint]?.[valueKey]) ||\n `${breakpoint}:h-[${value}px] ${breakpoint}:w-[${value}px]`\n );\n }\n\n return {\n responsiveSizeClasses: classes.join(\" \"),\n responsiveSizeStyles: styles\n };\n};\n","import type { IconName } from \"@deckai/icons\";\nimport { IconMap } from \"@deckai/icons\";\nimport type { SVGProps } from \"react\";\nimport React from \"react\";\n\nimport type { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\nimport type { ResponsiveSize } from \"../utils/responsive\";\nimport { getResponsiveSize } from \"../utils/responsive\";\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\n// Using CSS variables to support dark mode\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"var(--color-primary)\",\n secondary: \"var(--color-secondary)\",\n white: \"var(--color-white)\",\n primaryBlue: \"var(--color-primary-100)\",\n disabled: \"var(--color-disabled)\",\n danger: \"var(--color-danger)\"\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const { responsiveSizeClasses, responsiveSizeStyles } = getResponsiveSize(\n size,\n 24\n );\n\n return (\n <div\n className={cn(\n \"flex justify-center items-center\",\n responsiveSizeClasses,\n className\n )}\n style={{\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...responsiveSizeStyles,\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React from \"react\";\n\nimport type { Typography } from \"../types/tailwind\";\nimport type { Breakpoint } from \"../utils/responsive\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\"\n | \"primary-100\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles using Tailwind classes that reference CSS variables\n const colorClasses = color === \"inherit\" ? \"text-inherit\" : `text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`\n font-sans antialiased\n ${typographyClasses}\n ${colorClasses}\n ${weight && `!${fontWeight[weight]}`}\n ${className}\n `}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import type { IconName } from \"@deckai/icons\";\nimport * as React from \"react\";\n\nimport { cn } from \"../utils\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\nimport type { IconProps } from \"./Icon\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Forces the focus ring to show regardless of focus state */\n forceShowFocusRing?: boolean;\n /** Error state for the input */\n error?: boolean;\n /** Error message to display below the input */\n errorMessage?: string;\n /** Helper text displayed below the input */\n helperText?: string;\n /** Character count display */\n showCharacterCount?: boolean;\n /** Maximum number of characters */\n maxLength?: number;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n (\n {\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n children,\n forceShowFocusRing,\n error,\n errorMessage,\n helperText,\n showCharacterCount,\n maxLength,\n value,\n defaultValue,\n onChange,\n disabled,\n ...props\n },\n ref\n ) => {\n const [currentValue, setCurrentValue] = React.useState(\n value?.toString() || defaultValue?.toString() || \"\"\n );\n\n // Update internal value when prop changes\n React.useEffect(() => {\n if (value !== undefined) {\n setCurrentValue(value?.toString() || \"\");\n }\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n setCurrentValue(newValue);\n onChange?.(e);\n };\n\n const characterCount = currentValue.length;\n const showCount = showCharacterCount || !!maxLength;\n\n return (\n <div className=\"gap-1 flex flex-col\">\n {label && (\n <Text\n variant=\"label-default\"\n htmlFor={id}\n as=\"label\"\n color={error ? \"danger\" : \"primary\"}\n className={cn(labelClassName)}\n >\n {label}\n </Text>\n )}\n <div\n className={cn(\n \"relative flex flex-col gap-2 w-full rounded-lg border bg-background-0 px-3 md:py-3 py-2 text-secondary transition-colors duration-150\",\n !error && !forceShowFocusRing && \"border-secondary-50\",\n error && \"border-tertiary-10\",\n disabled && \"cursor-not-allowed opacity-50\",\n \"focus-within:ring-2 focus-within:ring-primary-100\",\n forceShowFocusRing && focusRingStylesCoerced\n )}\n >\n <div className=\"flex relative\">\n <input\n ref={ref}\n id={id}\n className={cn(\n \"font-sans text-sm flex w-full bg-background-0 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-primary disabled:cursor-not-allowed focus:outline-none rounded-lg\",\n end && \"pr-10\",\n className\n )}\n value={currentValue}\n maxLength={maxLength}\n onChange={handleChange}\n aria-invalid={error}\n disabled={disabled}\n {...props}\n />\n {(end || iconName) && (\n <div className=\"absolute inset-y-0 right-0 flex items-center\">\n {iconName ? (\n <Icon\n name={iconName}\n color={error ? \"danger\" : \"secondary\"}\n size={size}\n title={title}\n />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n {children}\n </div>\n <div className=\"flex justify-between gap-2\">\n {(error && errorMessage) || helperText ? (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"mt-1\"\n >\n {error ? errorMessage : helperText}\n </Text>\n ) : null}\n {showCount && (\n <Text\n variant=\"body-xxs\"\n color={error ? \"danger\" : \"secondary\"}\n className=\"text-right mt-1\"\n >\n <Text variant=\"body-xxs\" as=\"span\" className=\"font-bold\">\n {characterCount}\n </Text>\n {maxLength && `/${maxLength}`} characters\n </Text>\n )}\n </div>\n </div>\n );\n }\n);\n"]}
@@ -1,8 +1,8 @@
1
- 'use strict';var a=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);var H={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},f=e=>{let[r,t]=e.split("-");return r==="heading"?H[t]||"p":r==="label"?"label":"p"},M={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},d=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,o]=t.split(":");return `${n}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",i=a__default.default.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:n,children:o,weight:s,...T},m)=>{let y=d(e),h=r==="inherit"?"text-inherit":`text-${r}`,g=a__default.default.useMemo(()=>{let u=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return f(u)},[e]);return a__default.default.createElement(t||g,{ref:m,className:`
1
+ 'use strict';var a=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);function p(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var l="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var d={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},M=e=>{let[r,t]=e.split("-");return r==="heading"?d[t]||"p":r==="label"?"label":"p"},L={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},b=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,o]=t.split(":");return `${n}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",i=a__default.default.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:n,children:o,weight:s,...T},y)=>{let m=b(e),h=r==="inherit"?"text-inherit":`text-${r}`,g=a__default.default.useMemo(()=>{let u=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return M(u)},[e]);return a__default.default.createElement(t||g,{ref:y,className:`
2
2
  font-sans antialiased
3
- ${y}
3
+ ${m}
4
4
  ${h}
5
- ${s&&`!${M[s]}`}
5
+ ${s&&`!${L[s]}`}
6
6
  ${n}
7
- `,...T},o)});i.displayName="Text";function p(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var l="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var j=({children:e,color:r="inherit",variant:t="body-default-semibold",href:n,className:o,...s})=>a__default.default.createElement(i,{variant:t,color:r},a__default.default.createElement("a",{href:n,className:p("hover:opacity-80 transition-all ease-in-out active:scale-95 hover:underline",l,o),...s},e));exports.Link=j;//# sourceMappingURL=Link.cjs.map
7
+ `,...T},o)});i.displayName="Text";function S({children:e,color:r="inherit",variant:t="body-default-semibold",href:n,className:o,...s}){return a__default.default.createElement(i,{variant:t,color:r},a__default.default.createElement("a",{href:n,className:p("hover:opacity-80 transition-all ease-in-out active:scale-95 hover:underline text-ellipsis",l,o),...s},e))}exports.Link=S;//# sourceMappingURL=Link.cjs.map
8
8
  //# sourceMappingURL=Link.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/Text.tsx","../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Link.tsx"],"names":["HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","size","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","React","color","as","className","children","weight","props","ref","typographyClasses","colorClasses","suggestedElement","baseVariant","cn","inputs","twMerge","clsx","focusRingStyles","Link","href"],"mappings":"iNAwEA,IAAMA,EAAmD,CACvD,EAAA,CAAI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A,SAAA,CAAWN,CACT,CAAA,6EAAA,CACAI,EACAb,CACF,CAAA,CACC,GAAGG,CAAAA,CAAAA,CAEHF,CACH,CACF","file":"Link.cjs","sourcesContent":["import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\nimport { Breakpoint } from \"../utils/responsive\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\"\n | \"primary-100\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles using Tailwind classes that reference CSS variables\n const colorClasses = color === \"inherit\" ? \"text-inherit\" : `text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`\n font-sans antialiased\n ${typographyClasses}\n ${colorClasses}\n ${weight && `!${fontWeight[weight]}`}\n ${className}\n `}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const sizes = [\"24\", \"42\", \"48\", \"64\", \"72\"]; // Add all the sizes you need\n\n const safelist: (string | { pattern: RegExp; variants: string[] })[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n // Generate size classes with responsive variants\n const sizeClasses = sizes.flatMap((size) => [\n `h-[${size}px]`,\n `w-[${size}px]`,\n ...breakpoints.flatMap((bp) => [\n `${bp}:h-[${size}px]`,\n `${bp}:w-[${size}px]`\n ])\n ]);\n\n return [...typographyClasses, ...responsiveTypographyClasses, ...sizeClasses];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100\";\nexport const focusRingWithinStyles =\n \"focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-100\";\nexport const focusRingStylesCoerced = \"ring-2 ring-primary-100\";\n","import React from \"react\";\nimport { Text, TextProps } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type LinkProps = {\n href: string;\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n} & Pick<TextProps, \"variant\" | \"color\"> &\n React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nexport const Link = ({\n children,\n color = \"inherit\",\n variant = \"body-default-semibold\",\n href,\n className,\n ...props\n}: LinkProps) => (\n <Text variant={variant} color={color}>\n <a\n href={href}\n className={cn(\n \"hover:opacity-80 transition-all ease-in-out active:scale-95 hover:underline\",\n focusRingStyles,\n className\n )}\n {...props}\n >\n {children}\n </a>\n </Text>\n);\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Text.tsx","../../src/components/Link.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","size","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","React","color","as","className","children","weight","props","ref","typographyClasses","colorClasses","suggestedElement","baseVariant","Link","href"],"mappings":"iNAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCqEO,IAAMG,CACX,CAAA,gFAAA,CCFF,IAAMC,CAAmD,CAAA,CACvD,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,KACJ,EAAI,CAAA,IACN,EAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,MAAM,GAAG,CAAA,CAE1C,OAAIC,CAAa,GAAA,SAAA,CACRH,EAAoBI,CAAI,CAAA,EAAK,GAGlCD,CAAAA,CAAAA,GAAa,OACR,CAAA,OAAA,CAGF,GACT,CAIME,CAAAA,CAAAA,CAAqC,CACzC,KAAO,CAAA,YAAA,CACP,QAAS,cACT,CAAA,QAAA,CAAU,eACV,CAAA,IAAA,CAAM,WACR,CAAA,CAwBMC,EACJC,CAEKA,EAAAA,CAAAA,CAAAA,CAEgB,MAAM,OAAQA,CAAAA,CAAQ,EAAIA,CAAW,CAAA,CAACA,CAAQ,CAAA,EAGhE,GAAKL,CAAAA,CAAAA,EAAY,CAChB,GAAIA,CAAAA,CAAQ,SAAS,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AA;AAAA,UAAA,EAClCF,CAAS;AAAA,QAEZ,CAAA,CAAA,GAAGG,CAEHF,CAAAA,CAAAA,CACH,CAEJ,CACF,EAEAL,CAAK,CAAA,WAAA,CAAc,MCnLZ,CAAA,SAASa,CAAK,CAAA,CACnB,SAAAR,CACA,CAAA,KAAA,CAAAH,CAAQ,CAAA,SAAA,CACR,OAAAV,CAAAA,CAAAA,CAAU,wBACV,IAAAsB,CAAAA,CAAAA,CACA,SAAAV,CAAAA,CAAAA,CACA,GAAGG,CACL,EAAc,CACZ,OACEN,kBAAA,CAAA,aAAA,CAACD,CAAA,CAAA,CAAK,QAASR,CAAS,CAAA,KAAA,CAAOU,CAC7BD,CAAAA,CAAAA,kBAAAA,CAAA,aAAC,CAAA,GAAA,CAAA,CACC,KAAMa,CACN,CAAA,SAAA,CAAW7B,CACT,CAAA,2FAAA,CACAI,CACAe,CAAAA,CACF,EACC,GAAGG,CAAAA,CAAAA,CAEHF,CACH,CACF,CAEJ","file":"Link.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import type { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const sizes = [\"24\", \"42\", \"48\", \"64\", \"72\"]; // Add all the sizes you need\n\n const safelist: (string | { pattern: RegExp; variants: string[] })[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n // Generate size classes with responsive variants\n const sizeClasses = sizes.flatMap((size) => [\n `h-[${size}px]`,\n `w-[${size}px]`,\n ...breakpoints.flatMap((bp) => [\n `${bp}:h-[${size}px]`,\n `${bp}:w-[${size}px]`\n ])\n ]);\n\n return [...typographyClasses, ...responsiveTypographyClasses, ...sizeClasses];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100\";\nexport const focusRingWithinStyles =\n \"focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-100\";\nexport const focusRingStylesCoerced = \"ring-2 ring-primary-100\";\n","import React from \"react\";\n\nimport type { Typography } from \"../types/tailwind\";\nimport type { Breakpoint } from \"../utils/responsive\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\"\n | \"primary-100\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles using Tailwind classes that reference CSS variables\n const colorClasses = color === \"inherit\" ? \"text-inherit\" : `text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`\n font-sans antialiased\n ${typographyClasses}\n ${colorClasses}\n ${weight && `!${fontWeight[weight]}`}\n ${className}\n `}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React from \"react\";\n\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport type { TextProps } from \"./Text\";\nimport { Text } from \"./Text\";\n\nexport type LinkProps = {\n href: string;\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n} & Pick<TextProps, \"variant\" | \"color\"> &\n React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nexport function Link({\n children,\n color = \"inherit\",\n variant = \"body-default-semibold\",\n href,\n className,\n ...props\n}: LinkProps) {\n return (\n <Text variant={variant} color={color}>\n <a\n href={href}\n className={cn(\n \"hover:opacity-80 transition-all ease-in-out active:scale-95 hover:underline text-ellipsis\",\n focusRingStyles,\n className\n )}\n {...props}\n >\n {children}\n </a>\n </Text>\n );\n}\n"]}
@@ -9,6 +9,6 @@ type LinkProps = {
9
9
  className?: string;
10
10
  style?: React__default.CSSProperties;
11
11
  } & Pick<TextProps, "variant" | "color"> & React__default.AnchorHTMLAttributes<HTMLAnchorElement>;
12
- declare const Link: ({ children, color, variant, href, className, ...props }: LinkProps) => React__default.JSX.Element;
12
+ declare function Link({ children, color, variant, href, className, ...props }: LinkProps): React__default.JSX.Element;
13
13
 
14
14
  export { Link, type LinkProps };
@@ -9,6 +9,6 @@ type LinkProps = {
9
9
  className?: string;
10
10
  style?: React__default.CSSProperties;
11
11
  } & Pick<TextProps, "variant" | "color"> & React__default.AnchorHTMLAttributes<HTMLAnchorElement>;
12
- declare const Link: ({ children, color, variant, href, className, ...props }: LinkProps) => React__default.JSX.Element;
12
+ declare function Link({ children, color, variant, href, className, ...props }: LinkProps): React__default.JSX.Element;
13
13
 
14
14
  export { Link, type LinkProps };
@@ -1,8 +1,8 @@
1
- import a from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var H={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},f=e=>{let[r,t]=e.split("-");return r==="heading"?H[t]||"p":r==="label"?"label":"p"},M={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},d=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,o]=t.split(":");return `${n}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",i=a.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:n,children:o,weight:s,...T},m)=>{let y=d(e),h=r==="inherit"?"text-inherit":`text-${r}`,g=a.useMemo(()=>{let u=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return f(u)},[e]);return a.createElement(t||g,{ref:m,className:`
1
+ import a from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function p(...e){return twMerge(clsx(e))}var l="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var d={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},M=e=>{let[r,t]=e.split("-");return r==="heading"?d[t]||"p":r==="label"?"label":"p"},L={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},b=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,o]=t.split(":");return `${n}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",i=a.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:n,children:o,weight:s,...T},y)=>{let m=b(e),h=r==="inherit"?"text-inherit":`text-${r}`,g=a.useMemo(()=>{let u=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return M(u)},[e]);return a.createElement(t||g,{ref:y,className:`
2
2
  font-sans antialiased
3
- ${y}
3
+ ${m}
4
4
  ${h}
5
- ${s&&`!${M[s]}`}
5
+ ${s&&`!${L[s]}`}
6
6
  ${n}
7
- `,...T},o)});i.displayName="Text";function p(...e){return twMerge(clsx(e))}var l="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var j=({children:e,color:r="inherit",variant:t="body-default-semibold",href:n,className:o,...s})=>a.createElement(i,{variant:t,color:r},a.createElement("a",{href:n,className:p("hover:opacity-80 transition-all ease-in-out active:scale-95 hover:underline",l,o),...s},e));export{j as Link};//# sourceMappingURL=Link.js.map
7
+ `,...T},o)});i.displayName="Text";function S({children:e,color:r="inherit",variant:t="body-default-semibold",href:n,className:o,...s}){return a.createElement(i,{variant:t,color:r},a.createElement("a",{href:n,className:p("hover:opacity-80 transition-all ease-in-out active:scale-95 hover:underline text-ellipsis",l,o),...s},e))}export{S as Link};//# sourceMappingURL=Link.js.map
8
8
  //# sourceMappingURL=Link.js.map