@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/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/RadioGroup.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","RadioGroup","label","labelClassName","options","value","onChange","disabled","id","inline","error","errorMessage","helperText","groupId","option","optionId","isSelected"],"mappings":"iNAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCmEA,IAAMG,CAAAA,CAAmD,CACvD,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,GAAwC,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,KAAM,CAAA,GAAG,EAE1C,OAAIC,CAAAA,GAAa,UACRH,CAAoBI,CAAAA,CAAI,GAAK,GAGlCD,CAAAA,CAAAA,GAAa,QACR,OAGF,CAAA,GACT,EAIME,CAAqC,CAAA,CACzC,MAAO,YACP,CAAA,OAAA,CAAS,eACT,QAAU,CAAA,eAAA,CACV,IAAM,CAAA,WACR,CAwBMC,CAAAA,CAAAA,CACJC,GAEKA,CAEgB,CAAA,CAAA,KAAA,CAAM,QAAQA,CAAQ,CAAA,CAAIA,EAAW,CAACA,CAAQ,CAGhE,EAAA,GAAA,CAAKL,CAAY,EAAA,CAChB,GAAIA,CAAQ,CAAA,QAAA,CAAS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AAW,CAAA,MAAA,CAAQ2B,CAAe,CAAA,CAClD,CACAZ,CAAAA,kBAAAA,CAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,OAAA,CAAQ,cACR,CAAA,KAAA,CACE6B,CAAcN,CAAAA,CAAAA,CAAQ,QAAW,CAAA,SAAA,CAAa,WAG/CI,CAAAA,CAAAA,CAAAA,CAAO,KACV,CACF,CAEJ,CAAC,CACH,CAAA,CACEJ,CAASC,EAAAA,CAAAA,EAAiBC,CAC1BxB,CAAAA,kBAAAA,CAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,OAAA,CAAQ,UACR,CAAA,KAAA,CAAOuB,CAAQ,CAAA,QAAA,CAAW,WAC1B,CAAA,SAAA,CAAU,MAETA,CAAAA,CAAAA,CAAAA,CAAQC,CAAeC,CAAAA,CAC1B,CACE,CAAA,IACN,CAEJ,CACF,EAEAX,CAAAA,CAAW,WAAc,CAAA,YAAA","file":"RadioGroup.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 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 { 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 { cn } from \"../utils\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type RadioOption = {\n label: string;\n value: string;\n};\n\nexport type RadioGroupProps = {\n /** Label for the radio group */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Options for the radio group */\n options: RadioOption[];\n /** Currently selected value */\n value?: string;\n /** Callback when selection changes */\n onChange: (value: string) => void;\n /** Whether the radio group is disabled */\n disabled?: boolean;\n /** ID for accessibility */\n id?: string;\n /** Additional classes for the container */\n className?: string;\n /**\n * Whether the radio group is inline\n * @default true\n */\n inline?: boolean;\n /** Error state for the radio group */\n error?: boolean;\n /** Error message to display below the radio group */\n errorMessage?: string;\n /** Helper text displayed below the radio group */\n helperText?: string;\n};\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n label,\n labelClassName,\n options,\n value,\n onChange,\n disabled,\n id,\n className,\n inline = true,\n error,\n errorMessage,\n helperText\n },\n ref\n ) => {\n const groupId = id || React.useId();\n\n return (\n <div ref={ref} className={cn(\"flex flex-col gap-2\", className)}>\n {label && (\n <Text\n as=\"label\"\n variant=\"label-default\"\n className={cn(\"text-primary\", labelClassName)}\n color={error ? \"danger\" : \"primary\"}\n >\n {label}\n </Text>\n )}\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={cn(\n \"flex gap-4\",\n inline ? \"flex-row gap-4\" : \"flex-col gap-2\"\n )}\n aria-invalid={error}\n >\n {options.map((option) => {\n const optionId = `${groupId}-${option.value}`;\n const isSelected = value === option.value;\n\n return (\n <label\n key={option.value}\n htmlFor={optionId}\n className={cn(\n \"flex items-center gap-2 cursor-pointer\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <div\n className={cn(\n \"w-4 h-4 rounded-full border\",\n \"flex items-center justify-center\",\n \"transition-colors duration-150\",\n {\n \"border-secondary-50\": !error && !isSelected,\n \"border-tertiary-10\": error,\n \"border-primary\": isSelected && !error,\n \"hover:border-primary\": !disabled && !error,\n \"hover:border-tertiary-10\": !disabled && error\n }\n )}\n >\n {isSelected && (\n <div\n className={cn(\n \"w-2 h-2 rounded-full\",\n error ? \"bg-tertiary-10\" : \"bg-primary\"\n )}\n />\n )}\n </div>\n <input\n type=\"radio\"\n id={optionId}\n name={groupId}\n value={option.value}\n checked={isSelected}\n onChange={() => onChange(option.value)}\n disabled={disabled}\n className={cn(\"sr-only\", \"peer\", focusRingStyles)}\n />\n <Text\n variant=\"body-default\"\n color={\n isSelected ? (error ? \"danger\" : \"primary\") : \"secondary\"\n }\n >\n {option.label}\n </Text>\n </label>\n );\n })}\n </div>\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 </div>\n );\n }\n);\n\nRadioGroup.displayName = \"RadioGroup\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/RadioGroup.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","RadioGroup","label","labelClassName","options","value","onChange","disabled","id","inline","error","errorMessage","helperText","groupId","option","optionId","isSelected"],"mappings":"iNAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCoEA,IAAMG,CAAA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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 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 { 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 { cn } from \"../utils\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type RadioOption = {\n label: string;\n value: string;\n};\n\nexport type RadioGroupProps = {\n /** Label for the radio group */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Options for the radio group */\n options: RadioOption[];\n /** Currently selected value */\n value?: string;\n /** Callback when selection changes */\n onChange: (value: string) => void;\n /** Whether the radio group is disabled */\n disabled?: boolean;\n /** ID for accessibility */\n id?: string;\n /** Additional classes for the container */\n className?: string;\n /**\n * Whether the radio group is inline\n * @default true\n */\n inline?: boolean;\n /** Error state for the radio group */\n error?: boolean;\n /** Error message to display below the radio group */\n errorMessage?: string;\n /** Helper text displayed below the radio group */\n helperText?: string;\n};\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n label,\n labelClassName,\n options,\n value,\n onChange,\n disabled,\n id,\n className,\n inline = true,\n error,\n errorMessage,\n helperText\n },\n ref\n ) => {\n const groupId = id || React.useId();\n\n return (\n <div ref={ref} className={cn(\"flex flex-col gap-2\", className)}>\n {label && (\n <Text\n as=\"label\"\n variant=\"label-default\"\n className={cn(\"text-primary\", labelClassName)}\n color={error ? \"danger\" : \"primary\"}\n >\n {label}\n </Text>\n )}\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={cn(\n \"flex gap-4\",\n inline ? \"flex-row gap-4\" : \"flex-col gap-2\"\n )}\n aria-invalid={error}\n >\n {options.map((option) => {\n const optionId = `${groupId}-${option.value}`;\n const isSelected = value === option.value;\n\n return (\n <label\n key={option.value}\n htmlFor={optionId}\n className={cn(\n \"flex items-center gap-2 cursor-pointer\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <div\n className={cn(\n \"w-4 h-4 rounded-full border\",\n \"flex items-center justify-center\",\n \"transition-colors duration-150\",\n {\n \"border-secondary-50\": !error && !isSelected,\n \"border-tertiary-10\": error,\n \"border-primary\": isSelected && !error,\n \"hover:border-primary\": !disabled && !error,\n \"hover:border-tertiary-10\": !disabled && error\n }\n )}\n >\n {isSelected && (\n <div\n className={cn(\n \"w-2 h-2 rounded-full\",\n error ? \"bg-tertiary-10\" : \"bg-primary\"\n )}\n />\n )}\n </div>\n <input\n type=\"radio\"\n id={optionId}\n name={groupId}\n value={option.value}\n checked={isSelected}\n onChange={() => onChange(option.value)}\n disabled={disabled}\n className={cn(\"sr-only\", \"peer\", focusRingStyles)}\n />\n <Text\n variant=\"body-default\"\n color={\n isSelected ? (error ? \"danger\" : \"primary\") : \"secondary\"\n }\n >\n {option.label}\n </Text>\n </label>\n );\n })}\n </div>\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 </div>\n );\n }\n);\n\nRadioGroup.displayName = \"RadioGroup\";\n"]}
@@ -1,8 +1,8 @@
1
- import r from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function n(...e){return twMerge(clsx(e))}var L={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},$=e=>{let[o,a]=e.split("-");return o==="heading"?L[a]||"p":o==="label"?"label":"p"},R={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},v=e=>e?(Array.isArray(e)?e:[e]).map(a=>{if(a.includes(":")){let[l,p]=a.split(":");return `${l}:text-${p}`}return `text-${a}`}).join(" "):"text-body-default",m=r.forwardRef(({variant:e="body-default",color:o="primary",as:a,className:l,children:p,weight:s,...g},d)=>{let u=v(e),t=o==="inherit"?"text-inherit":`text-${o}`,y=r.useMemo(()=>{let h=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return $(h)},[e]);return r.createElement(a||y,{ref:d,className:`
1
+ import r from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function o(...e){return twMerge(clsx(e))}var L={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},$=e=>{let[n,a]=e.split("-");return n==="heading"?L[a]||"p":n==="label"?"label":"p"},v={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(a=>{if(a.includes(":")){let[l,p]=a.split(":");return `${l}:text-${p}`}return `text-${a}`}).join(" "):"text-body-default",y=r.forwardRef(({variant:e="body-default",color:n="primary",as:a,className:l,children:p,weight:s,...g},d)=>{let u=R(e),t=n==="inherit"?"text-inherit":`text-${n}`,m=r.useMemo(()=>{let h=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return $(h)},[e]);return r.createElement(a||m,{ref:d,className:`
2
2
  font-sans antialiased
3
3
  ${u}
4
4
  ${t}
5
- ${s&&`!${R[s]}`}
5
+ ${s&&`!${v[s]}`}
6
6
  ${l}
7
- `,...g},p)});m.displayName="Text";var M="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var A=r.forwardRef(({label:e,labelClassName:o,options:a,value:l,onChange:p,disabled:s,id:g,className:d,inline:u=true,error:t,errorMessage:y,helperText:T},h)=>{let b=g||r.useId();return r.createElement("div",{ref:h,className:n("flex flex-col gap-2",d)},e&&r.createElement(m,{as:"label",variant:"label-default",className:n("text-primary",o),color:t?"danger":"primary"},e),r.createElement("div",{role:"radiogroup","aria-label":e,className:n("flex gap-4",u?"flex-row gap-4":"flex-col gap-2"),"aria-invalid":t},a.map(i=>{let H=`${b}-${i.value}`,c=l===i.value;return r.createElement("label",{key:i.value,htmlFor:H,className:n("flex items-center gap-2 cursor-pointer",s&&"cursor-not-allowed opacity-50")},r.createElement("div",{className:n("w-4 h-4 rounded-full border","flex items-center justify-center","transition-colors duration-150",{"border-secondary-50":!t&&!c,"border-tertiary-10":t,"border-primary":c&&!t,"hover:border-primary":!s&&!t,"hover:border-tertiary-10":!s&&t})},c&&r.createElement("div",{className:n("w-2 h-2 rounded-full",t?"bg-tertiary-10":"bg-primary")})),r.createElement("input",{type:"radio",id:H,name:b,value:i.value,checked:c,onChange:()=>p(i.value),disabled:s,className:n("sr-only","peer",M)}),r.createElement(m,{variant:"body-default",color:c?t?"danger":"primary":"secondary"},i.label))})),t&&y||T?r.createElement(m,{variant:"body-xxs",color:t?"danger":"secondary",className:"mt-1"},t?y:T):null)});A.displayName="RadioGroup";export{A as RadioGroup};//# sourceMappingURL=RadioGroup.js.map
7
+ `,...g},p)});y.displayName="Text";var M="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var A=r.forwardRef(({label:e,labelClassName:n,options:a,value:l,onChange:p,disabled:s,id:g,className:d,inline:u=true,error:t,errorMessage:m,helperText:T},h)=>{let b=g||r.useId();return r.createElement("div",{ref:h,className:o("flex flex-col gap-2",d)},e&&r.createElement(y,{as:"label",variant:"label-default",className:o("text-primary",n),color:t?"danger":"primary"},e),r.createElement("div",{role:"radiogroup","aria-label":e,className:o("flex gap-4",u?"flex-row gap-4":"flex-col gap-2"),"aria-invalid":t},a.map(i=>{let H=`${b}-${i.value}`,c=l===i.value;return r.createElement("label",{key:i.value,htmlFor:H,className:o("flex items-center gap-2 cursor-pointer",s&&"cursor-not-allowed opacity-50")},r.createElement("div",{className:o("w-4 h-4 rounded-full border","flex items-center justify-center","transition-colors duration-150",{"border-secondary-50":!t&&!c,"border-tertiary-10":t,"border-primary":c&&!t,"hover:border-primary":!s&&!t,"hover:border-tertiary-10":!s&&t})},c&&r.createElement("div",{className:o("w-2 h-2 rounded-full",t?"bg-tertiary-10":"bg-primary")})),r.createElement("input",{type:"radio",id:H,name:b,value:i.value,checked:c,onChange:()=>p(i.value),disabled:s,className:o("sr-only","peer",M)}),r.createElement(y,{variant:"body-default",color:c?t?"danger":"primary":"secondary"},i.label))})),t&&m||T?r.createElement(y,{variant:"body-xxs",color:t?"danger":"secondary",className:"mt-1"},t?m:T):null)});A.displayName="RadioGroup";export{A as RadioGroup};//# sourceMappingURL=RadioGroup.js.map
8
8
  //# sourceMappingURL=RadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/RadioGroup.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","RadioGroup","label","labelClassName","options","value","onChange","disabled","id","inline","error","errorMessage","helperText","groupId","option","optionId","isSelected"],"mappings":"kFAGO,SAASA,CAAMC,CAA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AC1B,CACE,CAAA,IACN,CAEJ,CACF,EAEAX,CAAAA,CAAW,WAAc,CAAA,YAAA","file":"RadioGroup.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 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 { 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 { cn } from \"../utils\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type RadioOption = {\n label: string;\n value: string;\n};\n\nexport type RadioGroupProps = {\n /** Label for the radio group */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Options for the radio group */\n options: RadioOption[];\n /** Currently selected value */\n value?: string;\n /** Callback when selection changes */\n onChange: (value: string) => void;\n /** Whether the radio group is disabled */\n disabled?: boolean;\n /** ID for accessibility */\n id?: string;\n /** Additional classes for the container */\n className?: string;\n /**\n * Whether the radio group is inline\n * @default true\n */\n inline?: boolean;\n /** Error state for the radio group */\n error?: boolean;\n /** Error message to display below the radio group */\n errorMessage?: string;\n /** Helper text displayed below the radio group */\n helperText?: string;\n};\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n label,\n labelClassName,\n options,\n value,\n onChange,\n disabled,\n id,\n className,\n inline = true,\n error,\n errorMessage,\n helperText\n },\n ref\n ) => {\n const groupId = id || React.useId();\n\n return (\n <div ref={ref} className={cn(\"flex flex-col gap-2\", className)}>\n {label && (\n <Text\n as=\"label\"\n variant=\"label-default\"\n className={cn(\"text-primary\", labelClassName)}\n color={error ? \"danger\" : \"primary\"}\n >\n {label}\n </Text>\n )}\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={cn(\n \"flex gap-4\",\n inline ? \"flex-row gap-4\" : \"flex-col gap-2\"\n )}\n aria-invalid={error}\n >\n {options.map((option) => {\n const optionId = `${groupId}-${option.value}`;\n const isSelected = value === option.value;\n\n return (\n <label\n key={option.value}\n htmlFor={optionId}\n className={cn(\n \"flex items-center gap-2 cursor-pointer\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <div\n className={cn(\n \"w-4 h-4 rounded-full border\",\n \"flex items-center justify-center\",\n \"transition-colors duration-150\",\n {\n \"border-secondary-50\": !error && !isSelected,\n \"border-tertiary-10\": error,\n \"border-primary\": isSelected && !error,\n \"hover:border-primary\": !disabled && !error,\n \"hover:border-tertiary-10\": !disabled && error\n }\n )}\n >\n {isSelected && (\n <div\n className={cn(\n \"w-2 h-2 rounded-full\",\n error ? \"bg-tertiary-10\" : \"bg-primary\"\n )}\n />\n )}\n </div>\n <input\n type=\"radio\"\n id={optionId}\n name={groupId}\n value={option.value}\n checked={isSelected}\n onChange={() => onChange(option.value)}\n disabled={disabled}\n className={cn(\"sr-only\", \"peer\", focusRingStyles)}\n />\n <Text\n variant=\"body-default\"\n color={\n isSelected ? (error ? \"danger\" : \"primary\") : \"secondary\"\n }\n >\n {option.label}\n </Text>\n </label>\n );\n })}\n </div>\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 </div>\n );\n }\n);\n\nRadioGroup.displayName = \"RadioGroup\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/RadioGroup.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","RadioGroup","label","labelClassName","options","value","onChange","disabled","id","inline","error","errorMessage","helperText","groupId","option","optionId","isSelected"],"mappings":"kFAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCoEA,IAAMG,CAAAA,CAAmD,CACvD,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,GAAwC,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,KAAM,CAAA,GAAG,EAE1C,OAAIC,CAAAA,GAAa,UACRH,CAAoBI,CAAAA,CAAI,GAAK,GAGlCD,CAAAA,CAAAA,GAAa,QACR,OAGF,CAAA,GACT,EAIME,CAAqC,CAAA,CACzC,MAAO,YACP,CAAA,OAAA,CAAS,eACT,QAAU,CAAA,eAAA,CACV,IAAM,CAAA,WACR,CAwBMC,CAAAA,CAAAA,CACJC,GAEKA,CAEgB,CAAA,C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T,QAAU,CAAA,IAAMV,CAASQ,CAAAA,CAAAA,CAAO,KAAK,CAAA,CACrC,QAAUP,CAAAA,CAAAA,CACV,SAAWlC,CAAAA,CAAAA,CAAG,SAAW,CAAA,MAAA,CAAQ2B,CAAe,CAAA,CAClD,CACAZ,CAAAA,CAAAA,CAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,OAAA,CAAQ,cACR,CAAA,KAAA,CACE6B,CAAcN,CAAAA,CAAAA,CAAQ,QAAW,CAAA,SAAA,CAAa,WAG/CI,CAAAA,CAAAA,CAAAA,CAAO,KACV,CACF,CAEJ,CAAC,CACH,CAAA,CACEJ,CAASC,EAAAA,CAAAA,EAAiBC,CAC1BxB,CAAAA,CAAAA,CAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,OAAA,CAAQ,UACR,CAAA,KAAA,CAAOuB,CAAQ,CAAA,QAAA,CAAW,WAC1B,CAAA,SAAA,CAAU,MAETA,CAAAA,CAAAA,CAAAA,CAAQC,CAAeC,CAAAA,CAC1B,CACE,CAAA,IACN,CAEJ,CACF,EAEAX,CAAAA,CAAW,WAAc,CAAA,YAAA","file":"RadioGroup.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 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 { 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 { cn } from \"../utils\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type RadioOption = {\n label: string;\n value: string;\n};\n\nexport type RadioGroupProps = {\n /** Label for the radio group */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Options for the radio group */\n options: RadioOption[];\n /** Currently selected value */\n value?: string;\n /** Callback when selection changes */\n onChange: (value: string) => void;\n /** Whether the radio group is disabled */\n disabled?: boolean;\n /** ID for accessibility */\n id?: string;\n /** Additional classes for the container */\n className?: string;\n /**\n * Whether the radio group is inline\n * @default true\n */\n inline?: boolean;\n /** Error state for the radio group */\n error?: boolean;\n /** Error message to display below the radio group */\n errorMessage?: string;\n /** Helper text displayed below the radio group */\n helperText?: string;\n};\n\nexport const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>(\n (\n {\n label,\n labelClassName,\n options,\n value,\n onChange,\n disabled,\n id,\n className,\n inline = true,\n error,\n errorMessage,\n helperText\n },\n ref\n ) => {\n const groupId = id || React.useId();\n\n return (\n <div ref={ref} className={cn(\"flex flex-col gap-2\", className)}>\n {label && (\n <Text\n as=\"label\"\n variant=\"label-default\"\n className={cn(\"text-primary\", labelClassName)}\n color={error ? \"danger\" : \"primary\"}\n >\n {label}\n </Text>\n )}\n <div\n role=\"radiogroup\"\n aria-label={label}\n className={cn(\n \"flex gap-4\",\n inline ? \"flex-row gap-4\" : \"flex-col gap-2\"\n )}\n aria-invalid={error}\n >\n {options.map((option) => {\n const optionId = `${groupId}-${option.value}`;\n const isSelected = value === option.value;\n\n return (\n <label\n key={option.value}\n htmlFor={optionId}\n className={cn(\n \"flex items-center gap-2 cursor-pointer\",\n disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <div\n className={cn(\n \"w-4 h-4 rounded-full border\",\n \"flex items-center justify-center\",\n \"transition-colors duration-150\",\n {\n \"border-secondary-50\": !error && !isSelected,\n \"border-tertiary-10\": error,\n \"border-primary\": isSelected && !error,\n \"hover:border-primary\": !disabled && !error,\n \"hover:border-tertiary-10\": !disabled && error\n }\n )}\n >\n {isSelected && (\n <div\n className={cn(\n \"w-2 h-2 rounded-full\",\n error ? \"bg-tertiary-10\" : \"bg-primary\"\n )}\n />\n )}\n </div>\n <input\n type=\"radio\"\n id={optionId}\n name={groupId}\n value={option.value}\n checked={isSelected}\n onChange={() => onChange(option.value)}\n disabled={disabled}\n className={cn(\"sr-only\", \"peer\", focusRingStyles)}\n />\n <Text\n variant=\"body-default\"\n color={\n isSelected ? (error ? \"danger\" : \"primary\") : \"secondary\"\n }\n >\n {option.label}\n </Text>\n </label>\n );\n })}\n </div>\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 </div>\n );\n }\n);\n\nRadioGroup.displayName = \"RadioGroup\";\n"]}
@@ -1,10 +1,10 @@
1
- 'use strict';var l=require('@radix-ui/react-tabs'),o=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var o__namespace=/*#__PURE__*/_interopNamespace(o);function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var M={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},L=e=>{let[a,t]=e.split("-");return a==="heading"?M[t]||"p":a==="label"?"label":"p"},E={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[s,r]=t.split(":");return `${s}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",y=o__namespace.default.forwardRef(({variant:e="body-default",color:a="primary",as:t,className:s,children:r,weight:i,...p},n)=>{let d=R(e),b=a==="inherit"?"text-inherit":`text-${a}`,h=o__namespace.default.useMemo(()=>{let f=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return L(f)},[e]);return o__namespace.default.createElement(t||h,{ref:n,className:`
1
+ 'use strict';var l=require('@radix-ui/react-tabs'),o=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var o__namespace=/*#__PURE__*/_interopNamespace(o);function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var M={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},L=e=>{let[a,t]=e.split("-");return a==="heading"?M[t]||"p":a==="label"?"label":"p"},E={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[s,r]=t.split(":");return `${s}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",g=o__namespace.default.forwardRef(({variant:e="body-default",color:a="primary",as:t,className:s,children:r,weight:i,...p},n)=>{let y=R(e),b=a==="inherit"?"text-inherit":`text-${a}`,h=o__namespace.default.useMemo(()=>{let f=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return L(f)},[e]);return o__namespace.default.createElement(t||h,{ref:n,className:`
2
2
  font-sans antialiased
3
- ${d}
3
+ ${y}
4
4
  ${b}
5
5
  ${i&&`!${E[i]}`}
6
6
  ${s}
7
- `,...p},r)});y.displayName="Text";var u="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var $={black:"bg-primary text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},A={black:"border border-text text-primary",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},T=o__namespace.forwardRef(({className:e,variant:a="filled",color:t="black",isLoading:s=false,children:r,disabled:i,end:p,...n},d)=>o__namespace.createElement("button",{ref:d,className:c(`
7
+ `,...p},r)});g.displayName="Text";var u="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var $={black:"bg-primary text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},v={black:"border border-text text-primary",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},T=o__namespace.forwardRef(({className:e,variant:a="filled",color:t="black",isLoading:s=false,children:r,disabled:i,end:p,...n},y)=>o__namespace.createElement("button",{ref:y,className:c(`
8
8
  sm:px-7 px-4
9
9
  py-2
10
10
  inline-flex items-center justify-center
@@ -12,5 +12,5 @@
12
12
  transition-colors duration-200
13
13
  disabled:opacity-50 disabled:pointer-events-none
14
14
  hover:opacity-80 active:scale-95
15
- truncate`,u,a==="filled"?$[t]:a==="transparent"?"bg-transparent text-text":A[t],e),disabled:i||s,type:"button",...n},typeof r=="string"?o__namespace.createElement(y,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},r):r,p));T.displayName="Button";var v=o__namespace.forwardRef(({tabs:e,defaultValue:a,value:t,onChange:s,className:r},i)=>{let p=o__namespace.useCallback(n=>{s?.(n);},[s]);return o__namespace.createElement(l__namespace.Root,{ref:i,defaultValue:a||e[0]?.value,value:t,onValueChange:p,className:c("inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1",r)},o__namespace.createElement(l__namespace.List,{"aria-label":"Select platform"},e.map(n=>o__namespace.createElement(l__namespace.Trigger,{key:n.value,value:n.value,asChild:true},o__namespace.createElement(T,{variant:"filled",color:"black",className:c("min-w-[100px]","data-[state=inactive]:bg-transparent","data-[state=inactive]:text-gray-600","data-[state=active]:bg-background-0","data-[state=active]:text-black","data-[state=active]:shadow-sm")},n.label)))))});v.displayName="SegmentedTabs";exports.SegmentedTabs=v;//# sourceMappingURL=SegmentedTabs.cjs.map
15
+ truncate`,u,a==="filled"?$[t]:a==="transparent"?"bg-transparent text-text":v[t],e),disabled:i||s,type:"button",...n},typeof r=="string"?o__namespace.createElement(g,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},r):r,p));T.displayName="Button";var A=o__namespace.forwardRef(({tabs:e,defaultValue:a,value:t,onChange:s,className:r},i)=>{let p=o__namespace.useCallback(n=>{s?.(n);},[s]);return o__namespace.createElement(l__namespace.Root,{ref:i,defaultValue:a||e[0]?.value,value:t,onValueChange:p,className:c("inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1",r)},o__namespace.createElement(l__namespace.List,{"aria-label":"Select platform"},e.map(n=>o__namespace.createElement(l__namespace.Trigger,{key:n.value,value:n.value,asChild:true},o__namespace.createElement(T,{variant:"filled",color:"black",className:c("min-w-[100px]","data-[state=inactive]:bg-transparent","data-[state=inactive]:text-gray-600","data-[state=active]:bg-background-0","data-[state=active]:text-black","data-[state=active]:shadow-sm")},n.label)))))});A.displayName="SegmentedTabs";exports.SegmentedTabs=A;//# sourceMappingURL=SegmentedTabs.cjs.map
16
16
  //# sourceMappingURL=SegmentedTabs.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Button.tsx","../../src/components/SegmentedTabs.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","filled","outlined","Button","m","isLoading","disabled","end","SegmentedTabs","o","tabs","defaultValue","value","onChange","handleValueChange","newValue","l","tab"],"mappings":"4hBAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCmEA,IAAMG,CAAmD,CAAA,CACvD,EAAI,CAAA,IAAA,CACJ,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,KACJ,EAAI,CAAA,IACN,EAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAAA,CAAUC,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,MAAM,GAAG,CAAA,CAE1C,OAAIC,CAAa,GAAA,SAAA,CACRH,CAAoBI,CAAAA,CAAI,CAAK,EAAA,GAAA,CAGlCD,IAAa,OACR,CAAA,OAAA,CAGF,GACT,CAIME,CAAAA,CAAAA,CAAqC,CACzC,KAAO,CAAA,YAAA,CACP,OAAS,CAAA,cAAA,CACT,QAAU,CAAA,eAAA,CACV,KAAM,WACR,CAAA,CAwBMC,EACJC,CAEKA,EAAAA,CAAAA,CAAAA,CAEgB,MAAM,OAAQA,CAAAA,CAAQ,CAAIA,CAAAA,CAAAA,CAAW,CAACA,CAAQ,GAGhE,GAAKL,CAAAA,CAAAA,EAAY,CAChB,GAAIA,CAAQ,CAAA,QAAA,CAAS,GAAG,CAAG,CAAA,CACzB,GAAM,CAACM,CAAYC,CAAAA,CAAe,EAAIP,CAAQ,CAAA,KAAA,CAAM,GAAG,CACvD,CAAA,OAAO,GAAGM,CAAU,CAAA,MAAA,EAASC,CAAe,CAAA,CAC9C,CAC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AsBC,YAGjC,CAAA,UAAA,CAAA,CAAC,CAAE,IAAA,CAAAC,EAAM,YAAAC,CAAAA,CAAAA,CAAc,KAAAC,CAAAA,CAAAA,CAAO,QAAAC,CAAAA,CAAAA,CAAU,SAAAtB,CAAAA,CAAU,EAAGI,CAAQ,GAAA,CAC7D,IAAMmB,CAAAA,CAA0BL,YAC7BM,CAAAA,WAAAA,CAAAA,CAAAA,EAAqB,CACpBF,CAAAA,GAAWE,CAAQ,EACrB,CAAA,CACA,CAACF,CAAQ,CACX,CAAA,CAEA,OACEJ,YAAA,CAAA,aAAA,CAAMO,kBAAL,CACC,GAAA,CAAKrB,CACL,CAAA,YAAA,CAAcgB,CAAgBD,EAAAA,CAAAA,CAAK,CAAC,CAAA,EAAG,MACvC,KAAOE,CAAAA,CAAAA,CACP,aAAeE,CAAAA,CAAAA,CACf,SAAWzC,CAAAA,CAAAA,CACT,2DACAkB,CAAAA,CACF,GAEAkB,YAAM,CAAA,aAAA,CAAAO,YAAA,CAAA,IAAA,CAAL,CAAU,YAAA,CAAW,iBACnBN,CAAAA,CAAAA,CAAAA,CAAK,GAAKO,CAAAA,CAAAA,EACTR,2BAAMO,YAAL,CAAA,OAAA,CAAA,CAAa,GAAKC,CAAAA,CAAAA,CAAI,KAAO,CAAA,KAAA,CAAOA,CAAI,CAAA,KAAA,CAAO,QAAO,IACrD,CAAA,CAAAR,YAAA,CAAA,aAAA,CAACN,CAAA,CAAA,CACC,OAAQ,CAAA,QAAA,CACR,KAAM,CAAA,OAAA,CACN,UAAW9B,CACT,CAAA,eAAA,CACA,sCACA,CAAA,qCAAA,CACA,qCACA,CAAA,gCAAA,CACA,+BACF,CAAA,CAAA,CAEC4C,EAAI,KACP,CACF,CACD,CACH,CACF,CAEJ,CAAC,EAEDT,EAAc,WAAc,CAAA,eAAA","file":"SegmentedTabs.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 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 { 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 * as React from \"react\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type ButtonProps = {\n /** @default filled */\n variant?: \"filled\" | \"outlined\" | \"transparent\";\n /** @default primary */\n color?: \"black\" | \"accent\" | \"secondary\";\n isLoading?: boolean;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n start?: React.ReactNode;\n end?: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const filled = {\n black: \"bg-primary text-white\",\n // fade it slightly\n accent: \"bg-primary-100 text-white\",\n secondary: \"bg-secondary-100 text-secondary\"\n};\n\nexport const outlined = {\n black: \"border border-text text-primary\",\n accent: \"border border-primary-100 text-primary-100\",\n secondary: \"border border-text-secondary text-secondary\"\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"filled\",\n color = \"black\",\n isLoading = false,\n children,\n disabled,\n end,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={cn(\n `\n sm:px-7 px-4\n py-2\n inline-flex items-center justify-center\n rounded-lg \n transition-colors duration-200\n disabled:opacity-50 disabled:pointer-events-none\n hover:opacity-80 active:scale-95 \n truncate`,\n focusRingStyles,\n variant === \"filled\"\n ? filled[color]\n : variant === \"transparent\"\n ? \"bg-transparent text-text\"\n : outlined[color],\n className\n )}\n disabled={disabled || isLoading}\n type=\"button\"\n {...props}\n >\n {typeof children === \"string\" ? (\n <Text\n variant={[\"sm:body-default-bold\", \"body-xxs-semibold\"]}\n color=\"inherit\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n {end}\n </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import * as Tabs from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { Button } from \"./Button\";\n\nexport type Tab = {\n value: string;\n label: string;\n};\n\nexport type SegmentedTabsProps = {\n tabs: Tab[];\n defaultValue?: string;\n value?: string;\n onChange?: (value: string) => void;\n className?: string;\n};\n\nexport const SegmentedTabs = React.forwardRef<\n HTMLDivElement,\n SegmentedTabsProps\n>(({ tabs, defaultValue, value, onChange, className }, ref) => {\n const handleValueChange = React.useCallback(\n (newValue: string) => {\n onChange?.(newValue);\n },\n [onChange]\n );\n\n return (\n <Tabs.Root\n ref={ref}\n defaultValue={defaultValue || tabs[0]?.value}\n value={value}\n onValueChange={handleValueChange}\n className={cn(\n \"inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1\",\n className\n )}\n >\n <Tabs.List aria-label=\"Select platform\">\n {tabs.map((tab) => (\n <Tabs.Trigger key={tab.value} value={tab.value} asChild>\n <Button\n variant=\"filled\"\n color=\"black\"\n className={cn(\n \"min-w-[100px]\",\n \"data-[state=inactive]:bg-transparent\",\n \"data-[state=inactive]:text-gray-600\",\n \"data-[state=active]:bg-background-0\",\n \"data-[state=active]:text-black\",\n \"data-[state=active]:shadow-sm\"\n )}\n >\n {tab.label}\n </Button>\n </Tabs.Trigger>\n ))}\n </Tabs.List>\n </Tabs.Root>\n );\n});\n\nSegmentedTabs.displayName = \"SegmentedTabs\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Button.tsx","../../src/components/SegmentedTabs.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","filled","outlined","Button","m","isLoading","disabled","end","SegmentedTabs","o","tabs","defaultValue","value","onChange","handleValueChange","newValue","l","tab"],"mappings":"4hBAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCoEA,IAAMG,CAAmD,CAAA,CACvD,EAAI,CAAA,IAAA,CACJ,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,KACJ,EAAI,CAAA,IACN,EAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAAA,CAAUC,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,MAAM,GAAG,CAAA,CAE1C,OAAIC,CAAa,GAAA,SAAA,CACRH,CAAoBI,CAAAA,CAAI,CAAK,EAAA,GAAA,CAGlCD,IAAa,OACR,CAAA,OAAA,CAGF,GACT,CAIME,CAAAA,CAAAA,CAAqC,CACzC,KAAO,CAAA,YAAA,CACP,OAAS,CAAA,cAAA,CACT,QAAU,CAAA,eAAA,CACV,KAAM,WACR,CAAA,CAwBMC,EACJC,CAEKA,EAAAA,CAAAA,CAAAA,CAEgB,MAAM,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AAA,OAAA,CACN,UAAW9B,CACT,CAAA,eAAA,CACA,sCACA,CAAA,qCAAA,CACA,qCACA,CAAA,gCAAA,CACA,+BACF,CAAA,CAAA,CAEC4C,EAAI,KACP,CACF,CACD,CACH,CACF,CAEJ,CAAC,EAEDT,EAAc,WAAc,CAAA,eAAA","file":"SegmentedTabs.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 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 { 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 * as React from \"react\";\n\nimport { Text } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type ButtonProps = {\n /** @default filled */\n variant?: \"filled\" | \"outlined\" | \"transparent\";\n /** @default primary */\n color?: \"black\" | \"accent\" | \"secondary\";\n isLoading?: boolean;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n start?: React.ReactNode;\n end?: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const filled = {\n black: \"bg-primary text-white\",\n // fade it slightly\n accent: \"bg-primary-100 text-white\",\n secondary: \"bg-secondary-100 text-secondary\"\n};\n\nexport const outlined = {\n black: \"border border-text text-primary\",\n accent: \"border border-primary-100 text-primary-100\",\n secondary: \"border border-text-secondary text-secondary\"\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"filled\",\n color = \"black\",\n isLoading = false,\n children,\n disabled,\n end,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={cn(\n `\n sm:px-7 px-4\n py-2\n inline-flex items-center justify-center\n rounded-lg \n transition-colors duration-200\n disabled:opacity-50 disabled:pointer-events-none\n hover:opacity-80 active:scale-95 \n truncate`,\n focusRingStyles,\n variant === \"filled\"\n ? filled[color]\n : variant === \"transparent\"\n ? \"bg-transparent text-text\"\n : outlined[color],\n className\n )}\n disabled={disabled || isLoading}\n type=\"button\"\n {...props}\n >\n {typeof children === \"string\" ? (\n <Text\n variant={[\"sm:body-default-bold\", \"body-xxs-semibold\"]}\n color=\"inherit\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n {end}\n </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import * as Tabs from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"../utils\";\nimport { Button } from \"./Button\";\n\nexport type Tab = {\n value: string;\n label: string;\n};\n\nexport type SegmentedTabsProps = {\n tabs: Tab[];\n defaultValue?: string;\n value?: string;\n onChange?: (value: string) => void;\n className?: string;\n};\n\nexport const SegmentedTabs = React.forwardRef<\n HTMLDivElement,\n SegmentedTabsProps\n>(({ tabs, defaultValue, value, onChange, className }, ref) => {\n const handleValueChange = React.useCallback(\n (newValue: string) => {\n onChange?.(newValue);\n },\n [onChange]\n );\n\n return (\n <Tabs.Root\n ref={ref}\n defaultValue={defaultValue || tabs[0]?.value}\n value={value}\n onValueChange={handleValueChange}\n className={cn(\n \"inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1\",\n className\n )}\n >\n <Tabs.List aria-label=\"Select platform\">\n {tabs.map((tab) => (\n <Tabs.Trigger key={tab.value} value={tab.value} asChild>\n <Button\n variant=\"filled\"\n color=\"black\"\n className={cn(\n \"min-w-[100px]\",\n \"data-[state=inactive]:bg-transparent\",\n \"data-[state=inactive]:text-gray-600\",\n \"data-[state=active]:bg-background-0\",\n \"data-[state=active]:text-black\",\n \"data-[state=active]:shadow-sm\"\n )}\n >\n {tab.label}\n </Button>\n </Tabs.Trigger>\n ))}\n </Tabs.List>\n </Tabs.Root>\n );\n});\n\nSegmentedTabs.displayName = \"SegmentedTabs\";\n"]}
@@ -1,10 +1,10 @@
1
- import*as l from'@radix-ui/react-tabs';import*as o from'react';import o__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function c(...e){return twMerge(clsx(e))}var M={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},L=e=>{let[a,t]=e.split("-");return a==="heading"?M[t]||"p":a==="label"?"label":"p"},E={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[s,r]=t.split(":");return `${s}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",y=o__default.forwardRef(({variant:e="body-default",color:a="primary",as:t,className:s,children:r,weight:i,...p},n)=>{let d=R(e),b=a==="inherit"?"text-inherit":`text-${a}`,h=o__default.useMemo(()=>{let f=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return L(f)},[e]);return o__default.createElement(t||h,{ref:n,className:`
1
+ import*as l from'@radix-ui/react-tabs';import*as o from'react';import o__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function c(...e){return twMerge(clsx(e))}var M={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},L=e=>{let[a,t]=e.split("-");return a==="heading"?M[t]||"p":a==="label"?"label":"p"},E={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[s,r]=t.split(":");return `${s}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",g=o__default.forwardRef(({variant:e="body-default",color:a="primary",as:t,className:s,children:r,weight:i,...p},n)=>{let y=R(e),b=a==="inherit"?"text-inherit":`text-${a}`,h=o__default.useMemo(()=>{let f=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return L(f)},[e]);return o__default.createElement(t||h,{ref:n,className:`
2
2
  font-sans antialiased
3
- ${d}
3
+ ${y}
4
4
  ${b}
5
5
  ${i&&`!${E[i]}`}
6
6
  ${s}
7
- `,...p},r)});y.displayName="Text";var u="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var $={black:"bg-primary text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},A={black:"border border-text text-primary",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},T=o.forwardRef(({className:e,variant:a="filled",color:t="black",isLoading:s=false,children:r,disabled:i,end:p,...n},d)=>o.createElement("button",{ref:d,className:c(`
7
+ `,...p},r)});g.displayName="Text";var u="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var $={black:"bg-primary text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},v={black:"border border-text text-primary",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},T=o.forwardRef(({className:e,variant:a="filled",color:t="black",isLoading:s=false,children:r,disabled:i,end:p,...n},y)=>o.createElement("button",{ref:y,className:c(`
8
8
  sm:px-7 px-4
9
9
  py-2
10
10
  inline-flex items-center justify-center
@@ -12,5 +12,5 @@ import*as l from'@radix-ui/react-tabs';import*as o from'react';import o__default
12
12
  transition-colors duration-200
13
13
  disabled:opacity-50 disabled:pointer-events-none
14
14
  hover:opacity-80 active:scale-95
15
- truncate`,u,a==="filled"?$[t]:a==="transparent"?"bg-transparent text-text":A[t],e),disabled:i||s,type:"button",...n},typeof r=="string"?o.createElement(y,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},r):r,p));T.displayName="Button";var v=o.forwardRef(({tabs:e,defaultValue:a,value:t,onChange:s,className:r},i)=>{let p=o.useCallback(n=>{s?.(n);},[s]);return o.createElement(l.Root,{ref:i,defaultValue:a||e[0]?.value,value:t,onValueChange:p,className:c("inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1",r)},o.createElement(l.List,{"aria-label":"Select platform"},e.map(n=>o.createElement(l.Trigger,{key:n.value,value:n.value,asChild:true},o.createElement(T,{variant:"filled",color:"black",className:c("min-w-[100px]","data-[state=inactive]:bg-transparent","data-[state=inactive]:text-gray-600","data-[state=active]:bg-background-0","data-[state=active]:text-black","data-[state=active]:shadow-sm")},n.label)))))});v.displayName="SegmentedTabs";export{v as SegmentedTabs};//# sourceMappingURL=SegmentedTabs.js.map
15
+ truncate`,u,a==="filled"?$[t]:a==="transparent"?"bg-transparent text-text":v[t],e),disabled:i||s,type:"button",...n},typeof r=="string"?o.createElement(g,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},r):r,p));T.displayName="Button";var A=o.forwardRef(({tabs:e,defaultValue:a,value:t,onChange:s,className:r},i)=>{let p=o.useCallback(n=>{s?.(n);},[s]);return o.createElement(l.Root,{ref:i,defaultValue:a||e[0]?.value,value:t,onValueChange:p,className:c("inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1",r)},o.createElement(l.List,{"aria-label":"Select platform"},e.map(n=>o.createElement(l.Trigger,{key:n.value,value:n.value,asChild:true},o.createElement(T,{variant:"filled",color:"black",className:c("min-w-[100px]","data-[state=inactive]:bg-transparent","data-[state=inactive]:text-gray-600","data-[state=active]:bg-background-0","data-[state=active]:text-black","data-[state=active]:shadow-sm")},n.label)))))});A.displayName="SegmentedTabs";export{A as SegmentedTabs};//# sourceMappingURL=SegmentedTabs.js.map
16
16
  //# sourceMappingURL=SegmentedTabs.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Button.tsx","../../src/components/SegmentedTabs.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","filled","outlined","Button","m","isLoading","disabled","end","SegmentedTabs","tabs","defaultValue","value","onChange","handleValueChange","newValue","tab"],"mappings":"0JAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCmEA,IAAMG,CAAmD,CAAA,CACvD,EAAI,CAAA,IAAA,CACJ,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,KACJ,EAAI,CAAA,IACN,EAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAAA,CAAUC,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,MAAM,GAAG,CAAA,CAE1C,OAAIC,CAAa,GAAA,SAAA,CACRH,CAAoBI,CAAAA,CAAI,CAAK,EAAA,GAAA,CAGlCD,IAAa,OACR,CAAA,OAAA,CAGF,GACT,CAIME,CAAAA,CAAAA,CAAqC,CACzC,KAAO,CAAA,YAAA,CACP,OAAS,CAAA,cAAA,CACT,QAAU,CAAA,eAAA,CACV,KAAM,WACR,CAAA,CAwBMC,EACJC,CAEKA,EAAAA,CAAAA,CAAAA,CAEgB,MAAM,OAAQA,CAAAA,CAAQ,CAAIA,CAAAA,CAAAA,CAAW,CAACA,CAAQ,GAGhE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,CACA,+BACF,CAAA,CAAA,CAEC0C,EAAI,KACP,CACF,CACD,CACH,CACF,CAEJ,CAAC,EAEDP,EAAc,WAAc,CAAA,eAAA","file":"SegmentedTabs.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 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 { 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 * as React from \"react\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type ButtonProps = {\n /** @default filled */\n variant?: \"filled\" | \"outlined\" | \"transparent\";\n /** @default primary */\n color?: \"black\" | \"accent\" | \"secondary\";\n isLoading?: boolean;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n start?: React.ReactNode;\n end?: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const filled = {\n black: \"bg-primary text-white\",\n // fade it slightly\n accent: \"bg-primary-100 text-white\",\n secondary: \"bg-secondary-100 text-secondary\"\n};\n\nexport const outlined = {\n black: \"border border-text text-primary\",\n accent: \"border border-primary-100 text-primary-100\",\n secondary: \"border border-text-secondary text-secondary\"\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"filled\",\n color = \"black\",\n isLoading = false,\n children,\n disabled,\n end,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={cn(\n `\n sm:px-7 px-4\n py-2\n inline-flex items-center justify-center\n rounded-lg \n transition-colors duration-200\n disabled:opacity-50 disabled:pointer-events-none\n hover:opacity-80 active:scale-95 \n truncate`,\n focusRingStyles,\n variant === \"filled\"\n ? filled[color]\n : variant === \"transparent\"\n ? \"bg-transparent text-text\"\n : outlined[color],\n className\n )}\n disabled={disabled || isLoading}\n type=\"button\"\n {...props}\n >\n {typeof children === \"string\" ? (\n <Text\n variant={[\"sm:body-default-bold\", \"body-xxs-semibold\"]}\n color=\"inherit\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n {end}\n </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import * as Tabs from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { Button } from \"./Button\";\n\nexport type Tab = {\n value: string;\n label: string;\n};\n\nexport type SegmentedTabsProps = {\n tabs: Tab[];\n defaultValue?: string;\n value?: string;\n onChange?: (value: string) => void;\n className?: string;\n};\n\nexport const SegmentedTabs = React.forwardRef<\n HTMLDivElement,\n SegmentedTabsProps\n>(({ tabs, defaultValue, value, onChange, className }, ref) => {\n const handleValueChange = React.useCallback(\n (newValue: string) => {\n onChange?.(newValue);\n },\n [onChange]\n );\n\n return (\n <Tabs.Root\n ref={ref}\n defaultValue={defaultValue || tabs[0]?.value}\n value={value}\n onValueChange={handleValueChange}\n className={cn(\n \"inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1\",\n className\n )}\n >\n <Tabs.List aria-label=\"Select platform\">\n {tabs.map((tab) => (\n <Tabs.Trigger key={tab.value} value={tab.value} asChild>\n <Button\n variant=\"filled\"\n color=\"black\"\n className={cn(\n \"min-w-[100px]\",\n \"data-[state=inactive]:bg-transparent\",\n \"data-[state=inactive]:text-gray-600\",\n \"data-[state=active]:bg-background-0\",\n \"data-[state=active]:text-black\",\n \"data-[state=active]:shadow-sm\"\n )}\n >\n {tab.label}\n </Button>\n </Tabs.Trigger>\n ))}\n </Tabs.List>\n </Tabs.Root>\n );\n});\n\nSegmentedTabs.displayName = \"SegmentedTabs\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Button.tsx","../../src/components/SegmentedTabs.tsx"],"names":["cn","inputs","twMerge","clsx","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","focusRingStyles","filled","outlined","Button","m","isLoading","disabled","end","SegmentedTabs","tabs","defaultValue","value","onChange","handleValueChange","newValue","tab"],"mappings":"0JAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCoEA,IAAMG,CAAmD,CAAA,CACvD,EAAI,CAAA,IAAA,CACJ,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,KACJ,EAAI,CAAA,IACN,EAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAAA,CAAUC,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,MAAM,GAAG,CAAA,CAE1C,OAAIC,CAAa,GAAA,SAAA,CACRH,CAAoBI,CAAAA,CAAI,CAAK,EAAA,GAAA,CAGlCD,IAAa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AAA,CAAa,GAAKA,CAAAA,CAAAA,CAAI,KAAO,CAAA,KAAA,CAAOA,CAAI,CAAA,KAAA,CAAO,QAAO,IACrD,CAAA,CAAA,CAAA,CAAA,aAAA,CAACZ,CAAA,CAAA,CACC,OAAQ,CAAA,QAAA,CACR,KAAM,CAAA,OAAA,CACN,UAAW9B,CACT,CAAA,eAAA,CACA,sCACA,CAAA,qCAAA,CACA,qCACA,CAAA,gCAAA,CACA,+BACF,CAAA,CAAA,CAEC0C,EAAI,KACP,CACF,CACD,CACH,CACF,CAEJ,CAAC,EAEDP,EAAc,WAAc,CAAA,eAAA","file":"SegmentedTabs.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 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 { 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 * as React from \"react\";\n\nimport { Text } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type ButtonProps = {\n /** @default filled */\n variant?: \"filled\" | \"outlined\" | \"transparent\";\n /** @default primary */\n color?: \"black\" | \"accent\" | \"secondary\";\n isLoading?: boolean;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n start?: React.ReactNode;\n end?: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const filled = {\n black: \"bg-primary text-white\",\n // fade it slightly\n accent: \"bg-primary-100 text-white\",\n secondary: \"bg-secondary-100 text-secondary\"\n};\n\nexport const outlined = {\n black: \"border border-text text-primary\",\n accent: \"border border-primary-100 text-primary-100\",\n secondary: \"border border-text-secondary text-secondary\"\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"filled\",\n color = \"black\",\n isLoading = false,\n children,\n disabled,\n end,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={cn(\n `\n sm:px-7 px-4\n py-2\n inline-flex items-center justify-center\n rounded-lg \n transition-colors duration-200\n disabled:opacity-50 disabled:pointer-events-none\n hover:opacity-80 active:scale-95 \n truncate`,\n focusRingStyles,\n variant === \"filled\"\n ? filled[color]\n : variant === \"transparent\"\n ? \"bg-transparent text-text\"\n : outlined[color],\n className\n )}\n disabled={disabled || isLoading}\n type=\"button\"\n {...props}\n >\n {typeof children === \"string\" ? (\n <Text\n variant={[\"sm:body-default-bold\", \"body-xxs-semibold\"]}\n color=\"inherit\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n {end}\n </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import * as Tabs from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\n\nimport { cn } from \"../utils\";\nimport { Button } from \"./Button\";\n\nexport type Tab = {\n value: string;\n label: string;\n};\n\nexport type SegmentedTabsProps = {\n tabs: Tab[];\n defaultValue?: string;\n value?: string;\n onChange?: (value: string) => void;\n className?: string;\n};\n\nexport const SegmentedTabs = React.forwardRef<\n HTMLDivElement,\n SegmentedTabsProps\n>(({ tabs, defaultValue, value, onChange, className }, ref) => {\n const handleValueChange = React.useCallback(\n (newValue: string) => {\n onChange?.(newValue);\n },\n [onChange]\n );\n\n return (\n <Tabs.Root\n ref={ref}\n defaultValue={defaultValue || tabs[0]?.value}\n value={value}\n onValueChange={handleValueChange}\n className={cn(\n \"inline-flex items-center p-1 bg-gray-100 rounded-lg gap-1\",\n className\n )}\n >\n <Tabs.List aria-label=\"Select platform\">\n {tabs.map((tab) => (\n <Tabs.Trigger key={tab.value} value={tab.value} asChild>\n <Button\n variant=\"filled\"\n color=\"black\"\n className={cn(\n \"min-w-[100px]\",\n \"data-[state=inactive]:bg-transparent\",\n \"data-[state=inactive]:text-gray-600\",\n \"data-[state=active]:bg-background-0\",\n \"data-[state=active]:text-black\",\n \"data-[state=active]:shadow-sm\"\n )}\n >\n {tab.label}\n </Button>\n </Tabs.Trigger>\n ))}\n </Tabs.List>\n </Tabs.Root>\n );\n});\n\nSegmentedTabs.displayName = \"SegmentedTabs\";\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var l=require('@radix-ui/react-dialog'),i=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var i__default=/*#__PURE__*/_interopDefault(i);var I=typeof window<"u"?i.useEffect:()=>{},v=e=>{let[p,s]=i.useState(null),o=i.useCallback(t=>typeof window<"u"?window.matchMedia(t).matches:false,[]);return I(()=>{s(o(e));},[e,o]),i.useEffect(()=>{if(typeof window<"u"){let t=window.matchMedia(e),r=()=>{s(o(e));};return t.addEventListener("change",r),()=>{t.removeEventListener("change",r);}}},[e,o]),p??false};function m(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var f={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]"},b={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]"}},h=e=>String(e),S=(e,p=24)=>{let s=[],o={};if(e===undefined){let t=h(p);t?s.push(f[t]):(o.height=`${p}px`,o.width=`${p}px`);}if(typeof e=="number"){let t=h(e);t?s.push(f[t]):(o.height=`${e}px`,o.width=`${e}px`);}if(Array.isArray(e)){let t=h(p),r=[t&&f[t]||`h-[${p}px] w-[${p}px]`];e.forEach(x=>{if(typeof x=="string"){let[n,c]=x.split(":"),a=parseInt(c,10),d=h(a);s.push(d&&b[n]?.[d]||`${n}:h-[${a}px] ${n}:w-[${a}px]`);}}),s.push(...r);}if(typeof e=="string"){let[t,r]=e.split(":"),x=parseInt(r,10),n=h(x);s.push(n&&b[t]?.[n]||`${t}:h-[${x}px] ${t}:w-[${x}px]`);}return {responsiveSizeClasses:s.join(" "),responsiveSizeStyles:o}};var $={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)"},g=i__default.default.forwardRef(({name:e,size:p=24,color:s="primary",title:o,className:t,style:r={},...x},n)=>{let c=icons.IconMap[e],{responsiveSizeClasses:a,responsiveSizeStyles:d}=S(p,24);return i__default.default.createElement("div",{className:m("flex justify-center items-center",a,t),style:{"--icon-stroke":$[s],...d,...r}},i__default.default.createElement(c,{ref:n,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?undefined:$[s],...x}))});g.displayName="Icon";var E="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var u=i__default.default.forwardRef(({children:e,type:p="button",className:s,disabled:o,...t},r)=>i__default.default.createElement("button",{ref:r,type:p,disabled:o,className:m("appearance-none hover:opacity-80 transition-all active:scale-95",E,o&&"opacity-50 cursor-not-allowed",s),...t},e));u.displayName="Pressable";var ie=({children:e,open:p,onClose:s,width:o=480,className:t,title:r,footer:x,position:n="left"})=>{let c=v("(max-width: 834px)"),a=i.useCallback(k=>{k.key==="Escape"&&s();},[s]);i.useEffect(()=>(p?(document.addEventListener("keydown",a),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",a),document.body.style.overflow="unset"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow="unset";}),[p,a]);let d=i.useMemo(()=>n==="right"?{position:"right-0",enter:"data-[state=open]:animate-slide-in-from-right",exit:"data-[state=closed]:animate-slide-out-to-right",transform:"translate-x-full"}:{position:"left-0",enter:"data-[state=open]:animate-slide-in-from-left",exit:"data-[state=closed]:animate-slide-out-to-left",transform:"-translate-x-full"},[n]);return i__default.default.createElement(l__namespace.Root,{open:p,onOpenChange:s},i__default.default.createElement(l__namespace.Portal,null,i__default.default.createElement(l__namespace.Overlay,{className:m("fixed inset-0 z-50 bg-sidebarOverlay backdrop-blur-[2px]","data-[state=open]:animate-overlay-show","data-[state=closed]:animate-overlay-hide")}),i__default.default.createElement(l__namespace.Content,{className:m("fixed top-0 z-50 flex h-full flex-col bg-background-0",d.position,d.enter,d.exit,typeof window>"u"||!c?n==="right"?"border-l":"border-r":"w-full","border-stroke",t),style:{width:typeof window>"u"||!c?o:"100%"}},i__default.default.createElement("div",{className:"flex items-center justify-between border-b border-secondary-50 px-8 py-6"},i__default.default.createElement(l__namespace.Title,{className:"text-heading-xs text-center w-full"},r),i__default.default.createElement(l__namespace.Close,{asChild:true},i__default.default.createElement(u,{className:"inline-flex items-center justify-center text-secondary","aria-label":"Close"},i__default.default.createElement(g,{name:"close",size:12})))),i__default.default.createElement("div",{className:"flex-1 overflow-y-auto"},i__default.default.createElement("div",{className:"p-6"},e)),x&&i__default.default.createElement("div",{className:"px-6 pb-6 bg-background"},x))))};exports.Sidebar=ie;//# sourceMappingURL=Sidebar.cjs.map
1
+ 'use strict';var l=require('@radix-ui/react-dialog'),i=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var l__namespace=/*#__PURE__*/_interopNamespace(l);var i__default=/*#__PURE__*/_interopDefault(i);var I=typeof window<"u"?i.useEffect:()=>{},v=e=>{let[p,o]=i.useState(null),s=i.useCallback(t=>typeof window<"u"?window.matchMedia(t).matches:false,[]);return I(()=>{o(s(e));},[e,s]),i.useEffect(()=>{if(typeof window<"u"){let t=window.matchMedia(e),r=()=>{o(s(e));};return t.addEventListener("change",r),()=>{t.removeEventListener("change",r);}}},[e,s]),p??false};function m(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var f={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]"},b={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]"}},h=e=>String(e),S=(e,p=24)=>{let o=[],s={};if(e===void 0){let t=h(p);t?o.push(f[t]):(s.height=`${p}px`,s.width=`${p}px`);}if(typeof e=="number"){let t=h(e);t?o.push(f[t]):(s.height=`${e}px`,s.width=`${e}px`);}if(Array.isArray(e)){let t=h(p),r=[t&&f[t]||`h-[${p}px] w-[${p}px]`];e.forEach(x=>{if(typeof x=="string"){let[n,c]=x.split(":"),a=parseInt(c,10),d=h(a);o.push(d&&b[n]?.[d]||`${n}:h-[${a}px] ${n}:w-[${a}px]`);}}),o.push(...r);}if(typeof e=="string"){let[t,r]=e.split(":"),x=parseInt(r,10),n=h(x);o.push(n&&b[t]?.[n]||`${t}:h-[${x}px] ${t}:w-[${x}px]`);}return {responsiveSizeClasses:o.join(" "),responsiveSizeStyles:s}};var $={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)"},u=i__default.default.forwardRef(({name:e,size:p=24,color:o="primary",title:s,className:t,style:r={},...x},n)=>{let c=icons.IconMap[e],{responsiveSizeClasses:a,responsiveSizeStyles:d}=S(p,24);return i__default.default.createElement("div",{className:m("flex justify-center items-center",a,t),style:{"--icon-stroke":$[o],...d,...r}},i__default.default.createElement(c,{ref:n,"aria-hidden":!s,"aria-label":s,stroke:e.includes("filled")?void 0:$[o],...x}))});u.displayName="Icon";var E="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-100";var g=i__default.default.forwardRef(({children:e,type:p="button",className:o,disabled:s,...t},r)=>i__default.default.createElement("button",{ref:r,type:p,disabled:s,className:m("appearance-none hover:opacity-80 transition-all active:scale-95",E,s&&"opacity-50 cursor-not-allowed",o),...t},e));g.displayName="Pressable";function se({children:e,open:p,onClose:o,width:s=480,className:t,title:r,footer:x,position:n="left"}){let c=v("(max-width: 834px)"),a=i.useCallback(C=>{C.key==="Escape"&&o();},[o]);i.useEffect(()=>(p?(document.addEventListener("keydown",a),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",a),document.body.style.overflow="unset"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow="unset";}),[p,a]);let d=i.useMemo(()=>n==="right"?{position:"right-0",enter:"data-[state=open]:animate-slide-in-from-right",exit:"data-[state=closed]:animate-slide-out-to-right",transform:"translate-x-full"}:{position:"left-0",enter:"data-[state=open]:animate-slide-in-from-left",exit:"data-[state=closed]:animate-slide-out-to-left",transform:"-translate-x-full"},[n]);return i__default.default.createElement(l__namespace.Root,{open:p,onOpenChange:o},i__default.default.createElement(l__namespace.Portal,null,i__default.default.createElement(l__namespace.Overlay,{className:m("fixed inset-0 z-50 bg-sidebarOverlay backdrop-blur-[2px]","data-[state=open]:animate-overlay-show","data-[state=closed]:animate-overlay-hide")}),i__default.default.createElement(l__namespace.Content,{className:m("fixed top-0 z-50 flex h-full flex-col bg-background-0",d.position,d.enter,d.exit,typeof window>"u"||!c?n==="right"?"border-l":"border-r":"w-full","border-stroke",t),style:{width:typeof window>"u"||!c?s:"100%"}},i__default.default.createElement("div",{className:"flex items-center justify-between border-b border-secondary-50 px-8 py-6"},i__default.default.createElement(l__namespace.Title,{className:"text-heading-xs text-center w-full"},r),i__default.default.createElement(l__namespace.Close,{asChild:true},i__default.default.createElement(g,{className:"inline-flex items-center justify-center text-secondary","aria-label":"Close"},i__default.default.createElement(u,{name:"close",size:12})))),i__default.default.createElement("div",{className:"flex-1 overflow-y-auto"},i__default.default.createElement("div",{className:"p-6"},e)),x&&i__default.default.createElement("div",{className:"px-6 pb-6 bg-background"},x))))}exports.Sidebar=se;//# sourceMappingURL=Sidebar.cjs.map
2
2
  //# sourceMappingURL=Sidebar.cjs.map