@deckai/deck-ui 0.0.13 → 0.0.14

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 (221) hide show
  1. package/README.md +4 -2
  2. package/dist/components/AboutCard.cjs +1 -9
  3. package/dist/components/AboutCard.cjs.map +1 -1
  4. package/dist/components/AboutCard.js +1 -9
  5. package/dist/components/AboutCard.js.map +1 -1
  6. package/dist/components/Accordion.cjs +2 -0
  7. package/dist/components/Accordion.cjs.map +1 -0
  8. package/dist/components/Accordion.js +2 -0
  9. package/dist/components/Accordion.js.map +1 -0
  10. package/dist/components/AddWorkCard.cjs +117 -0
  11. package/dist/components/AddWorkCard.cjs.map +1 -0
  12. package/dist/components/AddWorkCard.js +117 -0
  13. package/dist/components/AddWorkCard.js.map +1 -0
  14. package/dist/components/Avatar.cjs +1 -1
  15. package/dist/components/Avatar.cjs.map +1 -1
  16. package/dist/components/Avatar.js +1 -1
  17. package/dist/components/Avatar.js.map +1 -1
  18. package/dist/components/Badge.cjs +1 -1
  19. package/dist/components/Badge.cjs.map +1 -1
  20. package/dist/components/Badge.js +1 -1
  21. package/dist/components/Badge.js.map +1 -1
  22. package/dist/components/Breadcrumbs.cjs +1 -1
  23. package/dist/components/Breadcrumbs.cjs.map +1 -1
  24. package/dist/components/Breadcrumbs.js +1 -1
  25. package/dist/components/Breadcrumbs.js.map +1 -1
  26. package/dist/components/Button.cjs +2 -2
  27. package/dist/components/Button.cjs.map +1 -1
  28. package/dist/components/Button.js +2 -2
  29. package/dist/components/Button.js.map +1 -1
  30. package/dist/components/Carousel.cjs +2 -0
  31. package/dist/components/Carousel.cjs.map +1 -0
  32. package/dist/components/Carousel.js +2 -0
  33. package/dist/components/Carousel.js.map +1 -0
  34. package/dist/components/Collapsible.cjs +1 -1
  35. package/dist/components/Collapsible.cjs.map +1 -1
  36. package/dist/components/Collapsible.js +1 -1
  37. package/dist/components/Collapsible.js.map +1 -1
  38. package/dist/components/Combobox.cjs +1 -1
  39. package/dist/components/Combobox.cjs.map +1 -1
  40. package/dist/components/Combobox.js +1 -1
  41. package/dist/components/Combobox.js.map +1 -1
  42. package/dist/components/ContactItem.cjs +1 -1
  43. package/dist/components/ContactItem.cjs.map +1 -1
  44. package/dist/components/ContactItem.js +1 -1
  45. package/dist/components/ContactItem.js.map +1 -1
  46. package/dist/components/Dropdown.cjs +2 -0
  47. package/dist/components/Dropdown.cjs.map +1 -0
  48. package/dist/components/Dropdown.js +2 -0
  49. package/dist/components/Dropdown.js.map +1 -0
  50. package/dist/components/EditButton.cjs +2 -2
  51. package/dist/components/EditButton.cjs.map +1 -1
  52. package/dist/components/EditButton.js +2 -2
  53. package/dist/components/EditButton.js.map +1 -1
  54. package/dist/components/Icon.cjs +1 -1
  55. package/dist/components/Icon.cjs.map +1 -1
  56. package/dist/components/Icon.js +1 -1
  57. package/dist/components/Icon.js.map +1 -1
  58. package/dist/components/Input.cjs +1 -1
  59. package/dist/components/Input.cjs.map +1 -1
  60. package/dist/components/Input.js +1 -1
  61. package/dist/components/Input.js.map +1 -1
  62. package/dist/components/Link.cjs +1 -1
  63. package/dist/components/Link.cjs.map +1 -1
  64. package/dist/components/Link.js +1 -1
  65. package/dist/components/Link.js.map +1 -1
  66. package/dist/components/MultiSelectCombobox.cjs +1 -1
  67. package/dist/components/MultiSelectCombobox.cjs.map +1 -1
  68. package/dist/components/MultiSelectCombobox.js +1 -1
  69. package/dist/components/MultiSelectCombobox.js.map +1 -1
  70. package/dist/components/Navbar.cjs +2 -2
  71. package/dist/components/Navbar.cjs.map +1 -1
  72. package/dist/components/Navbar.js +2 -2
  73. package/dist/components/Navbar.js.map +1 -1
  74. package/dist/components/NavbarItem.cjs +1 -1
  75. package/dist/components/NavbarItem.cjs.map +1 -1
  76. package/dist/components/NavbarItem.js +1 -1
  77. package/dist/components/NavbarItem.js.map +1 -1
  78. package/dist/components/Option.cjs +1 -1
  79. package/dist/components/Option.cjs.map +1 -1
  80. package/dist/components/Option.js +1 -1
  81. package/dist/components/Option.js.map +1 -1
  82. package/dist/components/Pressable.cjs +1 -1
  83. package/dist/components/Pressable.cjs.map +1 -1
  84. package/dist/components/Pressable.js +1 -1
  85. package/dist/components/Pressable.js.map +1 -1
  86. package/dist/components/ProfileCard.cjs +1 -9
  87. package/dist/components/ProfileCard.cjs.map +1 -1
  88. package/dist/components/ProfileCard.js +1 -9
  89. package/dist/components/ProfileCard.js.map +1 -1
  90. package/dist/components/ProgressBar.cjs +2 -0
  91. package/dist/components/ProgressBar.cjs.map +1 -0
  92. package/dist/components/ProgressBar.js +2 -0
  93. package/dist/components/ProgressBar.js.map +1 -0
  94. package/dist/components/SegmentedTabs.cjs +10 -0
  95. package/dist/components/SegmentedTabs.cjs.map +1 -0
  96. package/dist/components/SegmentedTabs.js +10 -0
  97. package/dist/components/SegmentedTabs.js.map +1 -0
  98. package/dist/components/Sidebar.cjs +1 -1
  99. package/dist/components/Sidebar.cjs.map +1 -1
  100. package/dist/components/Sidebar.js +1 -1
  101. package/dist/components/Sidebar.js.map +1 -1
  102. package/dist/components/SocialCard.cjs +1 -1
  103. package/dist/components/SocialCard.cjs.map +1 -1
  104. package/dist/components/SocialCard.js +1 -1
  105. package/dist/components/SocialCard.js.map +1 -1
  106. package/dist/components/Spinner.cjs +1 -1
  107. package/dist/components/Spinner.cjs.map +1 -1
  108. package/dist/components/Spinner.js +1 -1
  109. package/dist/components/Spinner.js.map +1 -1
  110. package/dist/components/Switch.cjs +1 -1
  111. package/dist/components/Switch.cjs.map +1 -1
  112. package/dist/components/Switch.js +1 -1
  113. package/dist/components/Switch.js.map +1 -1
  114. package/dist/components/Tabs.cjs +9 -1
  115. package/dist/components/Tabs.cjs.map +1 -1
  116. package/dist/components/Tabs.js +9 -1
  117. package/dist/components/Tabs.js.map +1 -1
  118. package/dist/components/Tag.cjs +1 -1
  119. package/dist/components/Tag.cjs.map +1 -1
  120. package/dist/components/Tag.js +1 -1
  121. package/dist/components/Tag.js.map +1 -1
  122. package/dist/components/Text.cjs +1 -1
  123. package/dist/components/Text.cjs.map +1 -1
  124. package/dist/components/Text.js +1 -1
  125. package/dist/components/Text.js.map +1 -1
  126. package/dist/components/TextArea.cjs +1 -1
  127. package/dist/components/TextArea.cjs.map +1 -1
  128. package/dist/components/TextArea.js +1 -1
  129. package/dist/components/TextArea.js.map +1 -1
  130. package/dist/components/Toast.cjs +10 -0
  131. package/dist/components/Toast.cjs.map +1 -0
  132. package/dist/components/Toast.js +10 -0
  133. package/dist/components/Toast.js.map +1 -0
  134. package/dist/components/ToastProvider.cjs +2 -0
  135. package/dist/components/ToastProvider.cjs.map +1 -0
  136. package/dist/components/ToastProvider.js +2 -0
  137. package/dist/components/ToastProvider.js.map +1 -0
  138. package/dist/components/Tooltip.cjs +1 -1
  139. package/dist/components/Tooltip.cjs.map +1 -1
  140. package/dist/components/Tooltip.js +1 -1
  141. package/dist/components/Tooltip.js.map +1 -1
  142. package/dist/components/WorkCard.cjs +1 -1
  143. package/dist/components/WorkCard.cjs.map +1 -1
  144. package/dist/components/WorkCard.js +1 -1
  145. package/dist/components/WorkCard.js.map +1 -1
  146. package/dist/index.cjs +111 -3
  147. package/dist/index.cjs.map +1 -1
  148. package/dist/index.js +111 -3
  149. package/dist/index.js.map +1 -1
  150. package/dist/styles/styles.css +1 -1
  151. package/package.json +7 -2
  152. package/dist/components/AboutCard.d.cts +0 -13
  153. package/dist/components/AboutCard.d.ts +0 -13
  154. package/dist/components/Avatar.d.cts +0 -12
  155. package/dist/components/Avatar.d.ts +0 -12
  156. package/dist/components/Badge.d.cts +0 -13
  157. package/dist/components/Badge.d.ts +0 -13
  158. package/dist/components/Breadcrumbs.d.cts +0 -15
  159. package/dist/components/Breadcrumbs.d.ts +0 -15
  160. package/dist/components/Button.d.cts +0 -38
  161. package/dist/components/Button.d.ts +0 -38
  162. package/dist/components/Collapsible.d.cts +0 -12
  163. package/dist/components/Collapsible.d.ts +0 -12
  164. package/dist/components/Combobox.d.cts +0 -20
  165. package/dist/components/Combobox.d.ts +0 -20
  166. package/dist/components/ContactItem.d.cts +0 -10
  167. package/dist/components/ContactItem.d.ts +0 -10
  168. package/dist/components/EditButton.d.cts +0 -12
  169. package/dist/components/EditButton.d.ts +0 -12
  170. package/dist/components/Icon.d.cts +0 -19
  171. package/dist/components/Icon.d.ts +0 -19
  172. package/dist/components/IconRenderer.d.cts +0 -13
  173. package/dist/components/IconRenderer.d.ts +0 -13
  174. package/dist/components/Illustration.d.cts +0 -10
  175. package/dist/components/Illustration.d.ts +0 -10
  176. package/dist/components/Input.d.cts +0 -18
  177. package/dist/components/Input.d.ts +0 -18
  178. package/dist/components/Link.d.cts +0 -13
  179. package/dist/components/Link.d.ts +0 -13
  180. package/dist/components/Logo.d.cts +0 -8
  181. package/dist/components/Logo.d.ts +0 -8
  182. package/dist/components/MultiSelectCombobox.d.cts +0 -21
  183. package/dist/components/MultiSelectCombobox.d.ts +0 -21
  184. package/dist/components/Navbar.d.cts +0 -19
  185. package/dist/components/Navbar.d.ts +0 -19
  186. package/dist/components/NavbarItem.d.cts +0 -13
  187. package/dist/components/NavbarItem.d.ts +0 -13
  188. package/dist/components/Option.d.cts +0 -11
  189. package/dist/components/Option.d.ts +0 -11
  190. package/dist/components/Pressable.d.cts +0 -6
  191. package/dist/components/Pressable.d.ts +0 -6
  192. package/dist/components/ProfileCard.d.cts +0 -17
  193. package/dist/components/ProfileCard.d.ts +0 -17
  194. package/dist/components/Sidebar.d.cts +0 -37
  195. package/dist/components/Sidebar.d.ts +0 -37
  196. package/dist/components/SocialCard.d.cts +0 -12
  197. package/dist/components/SocialCard.d.ts +0 -12
  198. package/dist/components/Spinner.d.cts +0 -19
  199. package/dist/components/Spinner.d.ts +0 -19
  200. package/dist/components/Switch.d.cts +0 -13
  201. package/dist/components/Switch.d.ts +0 -13
  202. package/dist/components/Tabs.d.cts +0 -16
  203. package/dist/components/Tabs.d.ts +0 -16
  204. package/dist/components/Tag.d.cts +0 -12
  205. package/dist/components/Tag.d.ts +0 -12
  206. package/dist/components/Text.d.cts +0 -46
  207. package/dist/components/Text.d.ts +0 -46
  208. package/dist/components/TextArea.d.cts +0 -19
  209. package/dist/components/TextArea.d.ts +0 -19
  210. package/dist/components/Tooltip.d.cts +0 -13
  211. package/dist/components/Tooltip.d.ts +0 -13
  212. package/dist/components/WorkCard.d.cts +0 -13
  213. package/dist/components/WorkCard.d.ts +0 -13
  214. package/dist/index.d.cts +0 -153
  215. package/dist/index.d.ts +0 -153
  216. package/dist/styles/fonts.d.cts +0 -2
  217. package/dist/styles/fonts.d.ts +0 -2
  218. package/dist/styles/styles.d.cts +0 -2
  219. package/dist/styles/styles.d.ts +0 -2
  220. package/dist/tailwind-CIZ10fKA.d.cts +0 -36
  221. package/dist/tailwind-CIZ10fKA.d.ts +0 -36
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Option.tsx","../../src/components/Dropdown.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","Option","value","label","onChange","selected","disabled","Dropdown","trigger","items","onSelect","align","handleSelect","item"],"mappings":"mKAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCiEA,IAAMG,CAAAA,CAAmD,CACvD,EAAI,CAAA,IAAA,CACJ,GAAI,IACJ,CAAA,EAAA,CAAI,KACJ,EAAI,CAAA,IAAA,CACJ,GAAI,IACN,CAAA,CAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,EAAIF,CAAQ,CAAA,KAAA,CAAM,GAAG,CAE1C,CAAA,OAAIC,IAAa,SACRH,CAAAA,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AU,MAAAC,CAAQ,CAAA,KAAM,EAAGhB,CAAQ,GAAA,CAC/D,IAAMiB,CAAqB,CAAA,CAAA,CAAA,WAAA,CACxBV,GAAkB,CACjBQ,CAAAA,GAAWR,CAAK,EAClB,CACA,CAAA,CAACQ,CAAQ,CACX,CAAA,CAEA,OACE,CAAc,CAAA,aAAA,CAAA,CAAA,CAAA,IAAA,CAAb,KACC,CAAc,CAAA,aAAA,CAAA,CAAA,CAAA,OAAA,CAAb,CAAqB,OAAO,CAAA,CAAA,CAAA,CAAA,CAAEF,CAAQ,CAEvC,CAAA,CAAA,CAAA,aAAA,CAAc,SAAb,IACC,CAAA,CAAA,CAAA,aAAA,CAAc,UAAb,CACC,GAAA,CAAKb,CACL,CAAA,KAAA,CAAOgB,CACP,CAAA,UAAA,CAAY,EACZ,SAAWtC,CAAAA,CAAAA,CACT,qBACA,yBACA,CAAA,kCAAA,CACA,kCACAkB,CACF,CAAA,CAAA,CAECkB,EAAM,GAAKI,CAAAA,CAAAA,EACV,gBAAc,CAAb,CAAA,IAAA,CAAA,CACC,IAAKA,CAAK,CAAA,KAAA,CACV,SAAUA,CAAK,CAAA,QAAA,CACf,QAAU,CAAA,IAAMD,CAAaC,CAAAA,CAAAA,CAAK,KAAK,CACvC,CAAA,SAAA,CAAU,eACV,OAAO,CAAA,CAAA,CAAA,CAAA,CAEP,gBAACZ,CAAA,CAAA,CACE,GAAGY,CAAAA,CACJ,SAAU,CAAA,WAAA,CACV,SAAUD,CACZ,CAAA,CACF,CACD,CACH,CACF,CACF,CAEJ,CACF,EAEAL,CAAAA,CAAS,WAAc,CAAA,UAAA","file":"Dropdown.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\";\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\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\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\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\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-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={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\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\n const safelist: 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 breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\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 return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nexport type OptionProps = {\n label: React.ReactNode;\n value: string;\n /** Optional color override for specific items like \"Logout\" in red */\n color?: \"default\" | \"danger\";\n /** Optional disabled state */\n disabled?: boolean;\n onChange?: (value: string) => void;\n selected?: boolean;\n className?: string;\n};\n\nexport const Option = ({\n value,\n label,\n onChange,\n selected,\n color,\n disabled,\n className\n}: OptionProps) => (\n <button\n type=\"button\"\n disabled={disabled}\n className={cn(\n \"relative w-full text-left px-2 py-1.5 text-sm rounded\",\n \"cursor-pointer hover:bg-gray-100\",\n \"disabled:opacity-50 disabled:cursor-not-allowed\",\n selected && \"bg-gray-100\",\n \"flex items-center gap-2\",\n focusRingStyles,\n className\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n <Text\n variant=\"body-default-medium\"\n color={color === \"danger\" ? \"danger\" : \"inherit\"}\n >\n {label}\n </Text>\n </button>\n);\n","import * as React from \"react\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport { cn } from \"../utils\";\nimport { Option, type OptionProps } from \"./Option\";\n\nexport type DropdownProps = {\n /** The trigger element that opens the dropdown */\n trigger: React.ReactNode;\n /** Array of items to show in the dropdown */\n items: Omit<OptionProps, \"onChange\" | \"selected\">[];\n /** Optional className for the content */\n className?: string;\n /** Callback when an item is selected */\n onSelect?: (value: string) => void;\n /** Optional side alignment */\n align?: \"start\" | \"center\" | \"end\";\n};\n\nexport const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(\n ({ trigger, items, className, onSelect, align = \"end\" }, ref) => {\n const handleSelect = React.useCallback(\n (value: string) => {\n onSelect?.(value);\n },\n [onSelect]\n );\n\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>{trigger}</DropdownMenu.Trigger>\n\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n ref={ref}\n align={align}\n sideOffset={8}\n className={cn(\n \"z-50 min-w-[220px]\",\n \"bg-white rounded-lg p-1\",\n \"shadow-lg border border-gray-100\",\n \"animate-in fade-in-0 zoom-in-95\",\n className\n )}\n >\n {items.map((item) => (\n <DropdownMenu.Item\n key={item.value}\n disabled={item.disabled}\n onSelect={() => handleSelect(item.value)}\n className=\"outline-none\"\n asChild\n >\n <Option\n {...item}\n className=\"py-3 px-6\"\n onChange={handleSelect}\n />\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n );\n }\n);\n\nDropdown.displayName = \"Dropdown\";\n"]}
@@ -1,4 +1,4 @@
1
- 'use strict';var y=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');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 y__namespace=/*#__PURE__*/_interopNamespace(y);function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var R={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},C=e=>{let[t,r]=e.split("-");return t==="heading"?R[r]||"p":t==="label"?"label":"p"},$={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},A=e=>e?(Array.isArray(e)?e:[e]).map(r=>{if(r.includes(":")){let[n,o]=r.split(":");return `${n}:text-${o}`}return `text-${r}`}).join(" "):"text-body-default",u=y__namespace.default.forwardRef(({variant:e="body-default",color:t="text-primary",as:r,className:n,children:o,weight:s,...a},i)=>{let m=A(e),d=t&&t==="inherit"?"inherit":t?`text-${t}`:"",H=y__namespace.default.useMemo(()=>{let M=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return C(M)},[e]);return y__namespace.default.createElement(r||H,{ref:i,className:`font-sans antialiased ${m} ${d} ${s?`!${$[s]}`:""} ${n??""}`,...a},o)});u.displayName="Text";var c="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var k={black:"bg-text-primary text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},g={black:"border border-text-primary text-text-primary",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},S=y__namespace.forwardRef(({className:e,variant:t="filled",color:r="black",isLoading:n=!1,children:o,disabled:s,...a},i)=>y__namespace.createElement("button",{ref:i,className:l(`
1
+ 'use strict';var y=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');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 y__namespace=/*#__PURE__*/_interopNamespace(y);function i(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var $={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},A=e=>{let[o,t]=e.split("-");return o==="heading"?$[t]||"p":o==="label"?"label":"p"},C={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},P=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,r]=t.split(":");return `${n}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",u=y__namespace.default.forwardRef(({variant:e="body-default",color:o="primary",as:t,className:n,children:r,weight:s,...a},p)=>{let m=P(e),d=o==="inherit"?"text-inherit":`text-text-${o}`,M=y__namespace.default.useMemo(()=>{let E=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return A(E)},[e]);return y__namespace.default.createElement(t||M,{ref:p,className:`font-sans antialiased ${m} ${d} ${s?`!${C[s]}`:""} ${n??""}`,...a},r)});u.displayName="Text";var c="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var k={black:"bg-text-text text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},g={black:"border border-text text-text",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},B=y__namespace.forwardRef(({className:e,variant:o="filled",color:t="black",isLoading:n=!1,children:r,disabled:s,...a},p)=>y__namespace.createElement("button",{ref:p,className:i(`
2
2
  sm:px-7 px-4
3
3
  py-2
4
4
  inline-flex items-center justify-center
@@ -6,5 +6,5 @@
6
6
  transition-colors duration-200
7
7
  disabled:opacity-50 disabled:pointer-events-none
8
8
  hover:opacity-80 active:scale-95
9
- truncate`,c,t==="filled"?k[r]:g[r],e),disabled:s||n,type:"button",...a},typeof o=="string"?y__namespace.createElement(u,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},o):o));S.displayName="Button";var f={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},v={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},B=e=>{if(!e)return {width:"24px",height:"24px"};let t=Array.isArray(e)?e:[e],r={},n;return t.forEach(o=>{if(typeof o=="number")n=`${o}px`;else {let[s,a]=o.split(":"),i=parseInt(a,10);r[`@media (min-width: ${v[s]})`]=`${i}px`;}}),{width:n||"24px",height:n||"24px",...Object.entries(r).reduce((o,[s,a])=>({...o,[s]:{width:a,height:a}}),{})}},b=y__namespace.default.forwardRef(({name:e,size:t=24,color:r="primary",title:n,className:o,style:s={},...a},i)=>{let m=icons.IconMap[e],d=B(t);return y__namespace.default.createElement("div",{className:l("flex justify-center items-center",o),style:{...d,"--icon-stroke":f[r],...s}},y__namespace.default.createElement(m,{ref:i,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?void 0:f[r],...a}))});b.displayName="Icon";var h=({children:e,type:t="button",className:r,disabled:n,...o})=>y__namespace.default.createElement("button",{type:t,disabled:n,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${c} ${r} ${n?"opacity-50 cursor-not-allowed":""}`,...o},e);var N=({className:e,onClick:t})=>y__namespace.default.createElement(h,{className:l("absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg",g.black,e),onClick:t},y__namespace.default.createElement(b,{color:"primary",name:"edit-2"}));N.displayName="EditButton";if (exports.default) module.exports = exports.default;exports.EditButton=N;//# sourceMappingURL=EditButton.cjs.map
9
+ truncate`,c,o==="filled"?k[t]:g[t],e),disabled:s||n,type:"button",...a},typeof r=="string"?y__namespace.createElement(u,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},r):r));B.displayName="Button";var h={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},v={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},N=e=>{if(!e)return {width:"24px",height:"24px"};let o=Array.isArray(e)?e:[e],t={},n;return o.forEach(r=>{if(typeof r=="number")n=`${r}px`;else {let[s,a]=r.split(":"),p=parseInt(a,10);t[`@media (min-width: ${v[s]})`]=`${p}px`;}}),{width:n||"24px",height:n||"24px",...Object.entries(t).reduce((r,[s,a])=>({...r,[s]:{width:a,height:a}}),{})}},f=y__namespace.default.forwardRef(({name:e,size:o=24,color:t="primary",title:n,className:r,style:s={},...a},p)=>{let m=icons.IconMap[e],d=N(o);return y__namespace.default.createElement("div",{className:i("flex justify-center items-center",r),style:{...d,"--icon-stroke":h[t],...s}},y__namespace.default.createElement(m,{ref:p,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?void 0:h[t],...a}))});f.displayName="Icon";var T=y__namespace.default.forwardRef(({children:e,type:o="button",className:t,disabled:n,...r},s)=>y__namespace.default.createElement("button",{ref:s,type:o,disabled:n,className:i("appearance-none hover:opacity-80 transition-all active:scale-95",c,n&&"opacity-50 cursor-not-allowed",t),...r},e));T.displayName="Pressable";var V=({className:e,onClick:o})=>y__namespace.default.createElement(T,{className:i("absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg",g.black,e),onClick:o},y__namespace.default.createElement(f,{color:"primary",name:"edit-2"}));V.displayName="EditButton";if (exports.default) module.exports = exports.default;exports.EditButton=V;//# sourceMappingURL=EditButton.cjs.map
10
10
  //# sourceMappingURL=EditButton.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/Icon.tsx","../../src/components/Pressable.tsx","../../src/components/EditButton.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","p","isLoading","disabled","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","valueStr","value","acc","query","Icon","name","title","style","IconComponent","IconMap","sizeStyles","Pressable","type","EditButton","onClick"],"mappings":"seAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCuFA,IAAMG,CAAmD,CAAA,CACvD,GAAI,IAC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F,eAA4BjB,CAAAA,CAAAA,CAAUlB,CAAK,CAC5C,CAAA,GAAGgC,CACL,CAAA,CAAA,CAEAjC,qBAAA,aAACkC,CAAAA,CAAAA,CAAA,CACC,GAAA,CAAK3B,EACL,aAAa,CAAA,CAACyB,CACd,CAAA,YAAA,CAAYA,EACZ,MAAQD,CAAAA,CAAAA,CAAK,SAAS,QAAQ,CAAA,CAAI,OAAYZ,CAAUlB,CAAAA,CAAK,CAC5D,CAAA,GAAGK,EACN,CACF,CAEJ,CACF,CAAA,CAEAwB,EAAK,WAAc,CAAA,MAAA,CCxGZ,IAAMO,CAAAA,CAAsC,CAAC,CAClD,QAAA,CAAAjC,EACA,IAAAkC,CAAAA,CAAAA,CAAO,QACP,CAAA,SAAA,CAAAnC,EACA,QAAAe,CAAAA,CAAAA,CACA,GAAGZ,CACL,IACEN,oBAAA,CAAA,aAAA,CAAC,QAEC,CAAA,CAAA,IAAA,CAAMsC,EACN,QAAUpB,CAAAA,CAAAA,CACV,UAAW,CAAmEN,gEAAAA,EAAAA,CAAe,IAAIT,CAAS,CAAA,CAAA,EAAIe,CAAW,CAAA,+BAAA,CAAkC,EAAE,CAC5J,CAAA,CAAA,GAAGZ,CAEHF,CAAAA,CAAAA,CACH,ECTWmC,IAAAA,CAAAA,CAAa,CAAC,CAAE,UAAApC,CAAW,CAAA,OAAA,CAAAqC,CAAQ,CAE5CxC,GAAAA,oBAAAA,CAAA,cAACqC,CAAA,CAAA,CACC,SAAWpD,CAAAA,CAAAA,CACT,wGACA6B,CAAS,CAAA,KAAA,CACTX,CACF,CACA,CAAA,OAAA,CAASqC,GAETxC,oBAAA,CAAA,aAAA,CAAC8B,CAAA,CAAA,CAAK,MAAM,SAAU,CAAA,IAAA,CAAK,SAAS,CACtC,EAIJS,EAAW,WAAc,CAAA,YAAA","file":"EditButton.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 {\n Colors,\n TextColorVariant,\n PrimaryShades,\n SecondaryShades,\n TertiaryShades,\n Typography\n} from \"../types/tailwind\";\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 ColorCategory = keyof Omit<Colors, \"stroke\" | \"background\">;\ntype ColorValue<T extends ColorCategory> = T extends \"text\"\n ? TextColorVariant\n : T extends \"primary\"\n ? keyof PrimaryShades\n : T extends \"secondary\"\n ? keyof SecondaryShades\n : T extends \"tertiary\"\n ? keyof TertiaryShades\n : never;\n\ntype ColorKey = {\n [T in ColorCategory]: `${T}-${ColorValue<T>}`;\n}[ColorCategory];\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\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\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: ColorKey | \"inherit\";\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 = \"text-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\n const colorClasses =\n color && color === \"inherit\" ? \"inherit\" : color ? `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={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\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\n const safelist: 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 breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\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 return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\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\";\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-text-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-primary 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 ...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\" ? filled[color] : 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 </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { outlined } from \"./Button\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type EditButtonProps = {\n className?: string;\n onClick?: () => void;\n};\n\nexport const EditButton = ({ className, onClick }: EditButtonProps) => {\n return (\n <Pressable\n className={cn(\n \"absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg\",\n outlined.black,\n className\n )}\n onClick={onClick}\n >\n <Icon color=\"primary\" name=\"edit-2\" />\n </Pressable>\n );\n};\n\nEditButton.displayName = \"EditButton\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Button.tsx","../../src/components/Icon.tsx","../../src/components/Pressable.tsx","../../src/components/EditButton.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","l","isLoading","disabled","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","valueStr","value","acc","query","Icon","name","title","style","IconComponent","IconMap","sizeStyles","Pressable","type","EditButton","onClick"],"mappings":"seAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCiEA,IAAMG,CAAmD,CAAA,CACvD,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,CAAwC,EAAA,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,EAAIF,CAAQ,CAAA,KAAA,CAAM,GAAG,CAAA,CAE1C,OAAIC,CAAAA,GAAa,SACRH,CAAAA,CAAAA,CAAoBI,CAAI,CAAK,EAAA,GAAA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A,CAEAwB,EAAK,WAAc,CAAA,MAAA,CCxGZ,IAAMO,CAAAA,CAAYrC,oBAAM,CAAA,UAAA,CAC7B,CAAC,CAAE,QAAA,CAAAI,EAAU,IAAAkC,CAAAA,CAAAA,CAAO,SAAU,SAAAnC,CAAAA,CAAAA,CAAW,QAAAe,CAAAA,CAAAA,CAAU,GAAGZ,CAAM,CAAA,CAAGC,IAC7DP,oBAAA,CAAA,aAAA,CAAC,UACC,GAAKO,CAAAA,CAAAA,CACL,IAAM+B,CAAAA,CAAAA,CACN,SAAUpB,CACV,CAAA,SAAA,CAAWjC,EACT,iEACA2B,CAAAA,CAAAA,CACAM,GAAY,+BACZf,CAAAA,CACF,CACC,CAAA,GAAGG,GAEHF,CACH,CAEJ,EAEAiC,CAAU,CAAA,WAAA,CAAc,YCdXE,IAAAA,CAAAA,CAAa,CAAC,CAAE,UAAApC,CAAW,CAAA,OAAA,CAAAqC,CAAQ,CAE5CxC,GAAAA,oBAAAA,CAAA,cAACqC,CAAA,CAAA,CACC,SAAWpD,CAAAA,CAAAA,CACT,wGACA6B,CAAS,CAAA,KAAA,CACTX,CACF,CACA,CAAA,OAAA,CAASqC,GAETxC,oBAAA,CAAA,aAAA,CAAC8B,CAAA,CAAA,CAAK,MAAM,SAAU,CAAA,IAAA,CAAK,SAAS,CACtC,EAIJS,EAAW,WAAc,CAAA,YAAA","file":"EditButton.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\";\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\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\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\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\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-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={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\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\n const safelist: 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 breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\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 return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\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\";\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-text-text 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-text\",\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 ...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\" ? filled[color] : 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 </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { outlined } from \"./Button\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type EditButtonProps = {\n className?: string;\n onClick?: () => void;\n};\n\nexport const EditButton = ({ className, onClick }: EditButtonProps) => {\n return (\n <Pressable\n className={cn(\n \"absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg\",\n outlined.black,\n className\n )}\n onClick={onClick}\n >\n <Icon color=\"primary\" name=\"edit-2\" />\n </Pressable>\n );\n};\n\nEditButton.displayName = \"EditButton\";\n"]}
@@ -1,4 +1,4 @@
1
- import*as y from'react';import y__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function l(...e){return twMerge(clsx(e))}var R={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},C=e=>{let[t,r]=e.split("-");return t==="heading"?R[r]||"p":t==="label"?"label":"p"},$={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},A=e=>e?(Array.isArray(e)?e:[e]).map(r=>{if(r.includes(":")){let[n,o]=r.split(":");return `${n}:text-${o}`}return `text-${r}`}).join(" "):"text-body-default",u=y__default.forwardRef(({variant:e="body-default",color:t="text-primary",as:r,className:n,children:o,weight:s,...a},i)=>{let m=A(e),d=t&&t==="inherit"?"inherit":t?`text-${t}`:"",H=y__default.useMemo(()=>{let M=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return C(M)},[e]);return y__default.createElement(r||H,{ref:i,className:`font-sans antialiased ${m} ${d} ${s?`!${$[s]}`:""} ${n??""}`,...a},o)});u.displayName="Text";var c="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var k={black:"bg-text-primary text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},g={black:"border border-text-primary text-text-primary",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},S=y.forwardRef(({className:e,variant:t="filled",color:r="black",isLoading:n=!1,children:o,disabled:s,...a},i)=>y.createElement("button",{ref:i,className:l(`
1
+ import*as y from'react';import y__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function i(...e){return twMerge(clsx(e))}var $={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},A=e=>{let[o,t]=e.split("-");return o==="heading"?$[t]||"p":o==="label"?"label":"p"},C={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},P=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,r]=t.split(":");return `${n}:text-${r}`}return `text-${t}`}).join(" "):"text-body-default",u=y__default.forwardRef(({variant:e="body-default",color:o="primary",as:t,className:n,children:r,weight:s,...a},p)=>{let m=P(e),d=o==="inherit"?"text-inherit":`text-text-${o}`,M=y__default.useMemo(()=>{let E=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return A(E)},[e]);return y__default.createElement(t||M,{ref:p,className:`font-sans antialiased ${m} ${d} ${s?`!${C[s]}`:""} ${n??""}`,...a},r)});u.displayName="Text";var c="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var k={black:"bg-text-text text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},g={black:"border border-text text-text",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},B=y.forwardRef(({className:e,variant:o="filled",color:t="black",isLoading:n=!1,children:r,disabled:s,...a},p)=>y.createElement("button",{ref:p,className:i(`
2
2
  sm:px-7 px-4
3
3
  py-2
4
4
  inline-flex items-center justify-center
@@ -6,5 +6,5 @@ import*as y from'react';import y__default from'react';import {clsx}from'clsx';im
6
6
  transition-colors duration-200
7
7
  disabled:opacity-50 disabled:pointer-events-none
8
8
  hover:opacity-80 active:scale-95
9
- truncate`,c,t==="filled"?k[r]:g[r],e),disabled:s||n,type:"button",...a},typeof o=="string"?y.createElement(u,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},o):o));S.displayName="Button";var f={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},v={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},B=e=>{if(!e)return {width:"24px",height:"24px"};let t=Array.isArray(e)?e:[e],r={},n;return t.forEach(o=>{if(typeof o=="number")n=`${o}px`;else {let[s,a]=o.split(":"),i=parseInt(a,10);r[`@media (min-width: ${v[s]})`]=`${i}px`;}}),{width:n||"24px",height:n||"24px",...Object.entries(r).reduce((o,[s,a])=>({...o,[s]:{width:a,height:a}}),{})}},b=y__default.forwardRef(({name:e,size:t=24,color:r="primary",title:n,className:o,style:s={},...a},i)=>{let m=IconMap[e],d=B(t);return y__default.createElement("div",{className:l("flex justify-center items-center",o),style:{...d,"--icon-stroke":f[r],...s}},y__default.createElement(m,{ref:i,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?void 0:f[r],...a}))});b.displayName="Icon";var h=({children:e,type:t="button",className:r,disabled:n,...o})=>y__default.createElement("button",{type:t,disabled:n,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${c} ${r} ${n?"opacity-50 cursor-not-allowed":""}`,...o},e);var N=({className:e,onClick:t})=>y__default.createElement(h,{className:l("absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg",g.black,e),onClick:t},y__default.createElement(b,{color:"primary",name:"edit-2"}));N.displayName="EditButton";if (exports.default) module.exports = exports.default;export{N as EditButton};//# sourceMappingURL=EditButton.js.map
9
+ truncate`,c,o==="filled"?k[t]:g[t],e),disabled:s||n,type:"button",...a},typeof r=="string"?y.createElement(u,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},r):r));B.displayName="Button";var h={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},v={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},N=e=>{if(!e)return {width:"24px",height:"24px"};let o=Array.isArray(e)?e:[e],t={},n;return o.forEach(r=>{if(typeof r=="number")n=`${r}px`;else {let[s,a]=r.split(":"),p=parseInt(a,10);t[`@media (min-width: ${v[s]})`]=`${p}px`;}}),{width:n||"24px",height:n||"24px",...Object.entries(t).reduce((r,[s,a])=>({...r,[s]:{width:a,height:a}}),{})}},f=y__default.forwardRef(({name:e,size:o=24,color:t="primary",title:n,className:r,style:s={},...a},p)=>{let m=IconMap[e],d=N(o);return y__default.createElement("div",{className:i("flex justify-center items-center",r),style:{...d,"--icon-stroke":h[t],...s}},y__default.createElement(m,{ref:p,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?void 0:h[t],...a}))});f.displayName="Icon";var T=y__default.forwardRef(({children:e,type:o="button",className:t,disabled:n,...r},s)=>y__default.createElement("button",{ref:s,type:o,disabled:n,className:i("appearance-none hover:opacity-80 transition-all active:scale-95",c,n&&"opacity-50 cursor-not-allowed",t),...r},e));T.displayName="Pressable";var V=({className:e,onClick:o})=>y__default.createElement(T,{className:i("absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg",g.black,e),onClick:o},y__default.createElement(f,{color:"primary",name:"edit-2"}));V.displayName="EditButton";if (exports.default) module.exports = exports.default;export{V as EditButton};//# sourceMappingURL=EditButton.js.map
10
10
  //# sourceMappingURL=EditButton.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/Icon.tsx","../../src/components/Pressable.tsx","../../src/components/EditButton.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","p","isLoading","disabled","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","valueStr","value","acc","query","Icon","name","title","style","IconComponent","IconMap","sizeStyles","Pressable","type","EditButton","onClick"],"mappings":"uJAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCuFA,IAAMG,CAAmD,CAAA,CACvD,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,CAAwC,EAAA,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,EAAIF,CAAQ,CAA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AAA,CAAAA,CAAK,SAAS,QAAQ,CAAA,CAAI,OAAYZ,CAAUlB,CAAAA,CAAK,CAC5D,CAAA,GAAGK,EACN,CACF,CAEJ,CACF,CAAA,CAEAwB,EAAK,WAAc,CAAA,MAAA,CCxGZ,IAAMO,CAAAA,CAAsC,CAAC,CAClD,QAAA,CAAAjC,EACA,IAAAkC,CAAAA,CAAAA,CAAO,QACP,CAAA,SAAA,CAAAnC,EACA,QAAAe,CAAAA,CAAAA,CACA,GAAGZ,CACL,IACEN,UAAA,CAAA,aAAA,CAAC,QAEC,CAAA,CAAA,IAAA,CAAMsC,EACN,QAAUpB,CAAAA,CAAAA,CACV,UAAW,CAAmEN,gEAAAA,EAAAA,CAAe,IAAIT,CAAS,CAAA,CAAA,EAAIe,CAAW,CAAA,+BAAA,CAAkC,EAAE,CAC5J,CAAA,CAAA,GAAGZ,CAEHF,CAAAA,CAAAA,CACH,ECTWmC,IAAAA,CAAAA,CAAa,CAAC,CAAE,UAAApC,CAAW,CAAA,OAAA,CAAAqC,CAAQ,CAE5CxC,GAAAA,UAAAA,CAAA,cAACqC,CAAA,CAAA,CACC,SAAWpD,CAAAA,CAAAA,CACT,wGACA6B,CAAS,CAAA,KAAA,CACTX,CACF,CACA,CAAA,OAAA,CAASqC,GAETxC,UAAA,CAAA,aAAA,CAAC8B,CAAA,CAAA,CAAK,MAAM,SAAU,CAAA,IAAA,CAAK,SAAS,CACtC,EAIJS,EAAW,WAAc,CAAA,YAAA","file":"EditButton.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 {\n Colors,\n TextColorVariant,\n PrimaryShades,\n SecondaryShades,\n TertiaryShades,\n Typography\n} from \"../types/tailwind\";\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 ColorCategory = keyof Omit<Colors, \"stroke\" | \"background\">;\ntype ColorValue<T extends ColorCategory> = T extends \"text\"\n ? TextColorVariant\n : T extends \"primary\"\n ? keyof PrimaryShades\n : T extends \"secondary\"\n ? keyof SecondaryShades\n : T extends \"tertiary\"\n ? keyof TertiaryShades\n : never;\n\ntype ColorKey = {\n [T in ColorCategory]: `${T}-${ColorValue<T>}`;\n}[ColorCategory];\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\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\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: ColorKey | \"inherit\";\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 = \"text-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\n const colorClasses =\n color && color === \"inherit\" ? \"inherit\" : color ? `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={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\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\n const safelist: 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 breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\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 return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\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\";\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-text-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-primary 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 ...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\" ? filled[color] : 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 </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { outlined } from \"./Button\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type EditButtonProps = {\n className?: string;\n onClick?: () => void;\n};\n\nexport const EditButton = ({ className, onClick }: EditButtonProps) => {\n return (\n <Pressable\n className={cn(\n \"absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg\",\n outlined.black,\n className\n )}\n onClick={onClick}\n >\n <Icon color=\"primary\" name=\"edit-2\" />\n </Pressable>\n );\n};\n\nEditButton.displayName = \"EditButton\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Text.tsx","../../src/utils/tailwind.ts","../../src/components/Button.tsx","../../src/components/Icon.tsx","../../src/components/Pressable.tsx","../../src/components/EditButton.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","l","isLoading","disabled","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","valueStr","value","acc","query","Icon","name","title","style","IconComponent","IconMap","sizeStyles","Pressable","type","EditButton","onClick"],"mappings":"uJAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCiEA,IAAMG,CAAmD,CAAA,CACvD,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,CAAwC,EAAA,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,EAAIF,CAAQ,CAAA,KAAA,CAAM,GAAG,CAAA,CAE1C,OAAIC,CAAAA,GAAa,SACRH,CAAAA,CAAAA,CAAoBI,CAAI,CAAK,EAAA,GAAA,CAGlCD,CAAa,GAAA,OAAA,CACR,OAGF,CAAA,GACT,CAIME,CAAAA,CAAAA,CAAqC,CACzC,KAAO,CAAA,YAAA,CACP,OAAS,CAAA,cAAA,CACT,QAAU,CAAA,eAAA,CACV,IAAM,CAAA,WACR,CA0BMC,CAAAA,CAAAA,CACJC,CAEKA,EAAAA,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Z,CAAM,CAAA,CAAGC,IAC7DP,UAAA,CAAA,aAAA,CAAC,UACC,GAAKO,CAAAA,CAAAA,CACL,IAAM+B,CAAAA,CAAAA,CACN,SAAUpB,CACV,CAAA,SAAA,CAAWjC,EACT,iEACA2B,CAAAA,CAAAA,CACAM,GAAY,+BACZf,CAAAA,CACF,CACC,CAAA,GAAGG,GAEHF,CACH,CAEJ,EAEAiC,CAAU,CAAA,WAAA,CAAc,YCdXE,IAAAA,CAAAA,CAAa,CAAC,CAAE,UAAApC,CAAW,CAAA,OAAA,CAAAqC,CAAQ,CAE5CxC,GAAAA,UAAAA,CAAA,cAACqC,CAAA,CAAA,CACC,SAAWpD,CAAAA,CAAAA,CACT,wGACA6B,CAAS,CAAA,KAAA,CACTX,CACF,CACA,CAAA,OAAA,CAASqC,GAETxC,UAAA,CAAA,aAAA,CAAC8B,CAAA,CAAA,CAAK,MAAM,SAAU,CAAA,IAAA,CAAK,SAAS,CACtC,EAIJS,EAAW,WAAc,CAAA,YAAA","file":"EditButton.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\";\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\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\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\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\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-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={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\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\n const safelist: 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 breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\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 return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\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\";\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-text-text 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-text\",\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 ...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\" ? filled[color] : 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 </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { outlined } from \"./Button\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type EditButtonProps = {\n className?: string;\n onClick?: () => void;\n};\n\nexport const EditButton = ({ className, onClick }: EditButtonProps) => {\n return (\n <Pressable\n className={cn(\n \"absolute lg:top-10 md:top-8 top-4 lg:right-10 md:right-8 right-4 lg:px-2 lg:py-2 px-1 py-1 rounded-lg\",\n outlined.black,\n className\n )}\n onClick={onClick}\n >\n <Icon color=\"primary\" name=\"edit-2\" />\n </Pressable>\n );\n};\n\nEditButton.displayName = \"EditButton\";\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var a=require('react'),icons=require('@deckai/icons'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var l={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},S={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},y=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],n={},o;return s.forEach(r=>{if(typeof r=="number")o=`${r}px`;else {let[i,t]=r.split(":"),p=parseInt(t,10);n[`@media (min-width: ${S[i]})`]=`${p}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(n).reduce((r,[i,t])=>({...r,[i]:{width:t,height:t}}),{})}},g=a__default.default.forwardRef(({name:e,size:s=24,color:n="primary",title:o,className:r,style:i={},...t},p)=>{let m=icons.IconMap[e],d=y(s);return a__default.default.createElement("div",{className:c("flex justify-center items-center",r),style:{...d,"--icon-stroke":l[n],...i}},a__default.default.createElement(m,{ref:p,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:l[n],...t}))});g.displayName="Icon";if (exports.default) module.exports = exports.default;exports.Icon=g;//# sourceMappingURL=Icon.cjs.map
1
+ 'use strict';var a=require('react'),icons=require('@deckai/icons'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var l={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},S={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},y=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],n={},o;return s.forEach(r=>{if(typeof r=="number")o=`${r}px`;else {let[i,t]=r.split(":"),p=parseInt(t,10);n[`@media (min-width: ${S[i]})`]=`${p}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(n).reduce((r,[i,t])=>({...r,[i]:{width:t,height:t}}),{})}},g=a__default.default.forwardRef(({name:e,size:s=24,color:n="primary",title:o,className:r,style:i={},...t},p)=>{let m=icons.IconMap[e],d=y(s);return a__default.default.createElement("div",{className:c("flex justify-center items-center",r),style:{...d,"--icon-stroke":l[n],...i}},a__default.default.createElement(m,{ref:p,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:l[n],...t}))});g.displayName="Icon";if (exports.default) module.exports = exports.default;exports.Icon=g;//# sourceMappingURL=Icon.cjs.map
2
2
  //# sourceMappingURL=Icon.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles"],"mappings":"gPAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAAA,CAAQC,SAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAwC,CAAA,CAC5C,QAAS,SACT,CAAA,SAAA,CAAW,SACX,CAAA,KAAA,CAAO,SACP,CAAA,WAAA,CAAa,SACf,CAAA,CAEMC,CAA6C,CAAA,CACjD,EAAI,CAAA,OAAA,CACJ,EAAI,CAAA,OAAA,CACJ,GAAI,QACJ,CAAA,EAAA,CAAI,QACJ,CAAA,KAAA,CAAO,QACT,CAAA,CAEMC,CACJC,CAAAA,CAAAA,EACwB,CACxB,GAAI,CAACA,CAAAA,CAAO,OAAO,CAAE,MAAO,MAAQ,CAAA,MAAA,CAAQ,MAAO,CAAA,CAEnD,IAAMC,CAAAA,CAAY,KAAM,CAAA,OAAA,CAAQD,CAAK,CAAA,CAAIA,CAAQ,CAAA,CAACA,CAAK,CAAA,CACjDE,EAAuC,EAAC,CAC1CC,CAGJ,CAAA,OAAAF,CAAU,CAAA,OAAA,CAASG,CAAS,EAAA,CAC1B,GAAI,OAAOA,CAAS,EAAA,QAAA,CAClBD,CAAW,CAAA,CAAA,EAAGC,CAAI,CACb,EAAA,CAAA,CAAA,KAAA,CACL,GAAM,CAACC,CAAYC,CAAAA,CAAQ,CAAIF,CAAAA,CAAAA,CAAK,KAAM,CAAA,GAAG,CACvCG,CAAAA,CAAAA,CAAQ,QAASD,CAAAA,CAAAA,CAAU,EAAE,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A,CAAAA,CACZ,MAAQF,CAAAA,CAAAA,CAAK,QAAS,CAAA,QAAQ,CAAI,CAAA,KAAA,CAAA,CAAYf,CAAUgB,CAAAA,CAAK,CAC5D,CAAA,GAAGI,CACN,CAAA,CACF,CAEJ,CACF,EAEAP,CAAAA,CAAK,WAAc,CAAA,MAAA","file":"Icon.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, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles"],"mappings":"gPAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAAA,CAAQC,SAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAwC,CAAA,CAC5C,QAAS,SACT,CAAA,SAAA,CAAW,SACX,CAAA,KAAA,CAAO,SACP,CAAA,WAAA,CAAa,SACb,CAAA,QAAA,CAAU,SACZ,CAAA,CAEMC,CAA6C,CAAA,CACjD,EAAI,CAAA,OAAA,CACJ,GAAI,OACJ,CAAA,EAAA,CAAI,QACJ,CAAA,EAAA,CAAI,QACJ,CAAA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,SAAA,CACR,KAAAC,CAAAA,CAAAA,CACA,SAAAC,CAAAA,CAAAA,CACA,KAAAC,CAAAA,CAAAA,CAAQ,EAAC,CACT,GAAGC,CACL,EACAC,CACG,GAAA,CACH,IAAMC,CAAAA,CAAgBC,aAAQR,CAAAA,CAAI,CAC5BS,CAAAA,CAAAA,CAAatB,CAAaK,CAAAA,CAAI,CAEpC,CAAA,OACEO,kBAAA,CAAA,aAAA,CAAC,OACC,SAAWlB,CAAAA,CAAAA,CAAG,kCAAoCsB,CAAAA,CAAS,CAC3D,CAAA,KAAA,CAAO,CACL,GAAGM,CACF,CAAA,eAAA,CAA4BxB,CAAUgB,CAAAA,CAAK,CAC5C,CAAA,GAAGG,CACL,CAEAL,CAAAA,CAAAA,kBAAAA,CAAA,aAACQ,CAAAA,CAAAA,CAAA,CACC,GAAA,CAAKD,CACL,CAAA,aAAA,CAAa,CAACJ,CAAAA,CACd,YAAYA,CAAAA,CAAAA,CACZ,MAAQF,CAAAA,CAAAA,CAAK,QAAS,CAAA,QAAQ,CAAI,CAAA,KAAA,CAAA,CAAYf,CAAUgB,CAAAA,CAAK,CAC5D,CAAA,GAAGI,CACN,CAAA,CACF,CAEJ,CACF,EAEAP,CAAAA,CAAK,WAAc,CAAA,MAAA","file":"Icon.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, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n"]}
@@ -1,2 +1,2 @@
1
- import a from'react';import {IconMap}from'@deckai/icons';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function c(...e){return twMerge(clsx(e))}var l={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},S={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},y=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],n={},o;return s.forEach(r=>{if(typeof r=="number")o=`${r}px`;else {let[i,t]=r.split(":"),p=parseInt(t,10);n[`@media (min-width: ${S[i]})`]=`${p}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(n).reduce((r,[i,t])=>({...r,[i]:{width:t,height:t}}),{})}},g=a.forwardRef(({name:e,size:s=24,color:n="primary",title:o,className:r,style:i={},...t},p)=>{let m=IconMap[e],d=y(s);return a.createElement("div",{className:c("flex justify-center items-center",r),style:{...d,"--icon-stroke":l[n],...i}},a.createElement(m,{ref:p,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:l[n],...t}))});g.displayName="Icon";if (exports.default) module.exports = exports.default;export{g as Icon};//# sourceMappingURL=Icon.js.map
1
+ import a from'react';import {IconMap}from'@deckai/icons';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function c(...e){return twMerge(clsx(e))}var l={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},S={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},y=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],n={},o;return s.forEach(r=>{if(typeof r=="number")o=`${r}px`;else {let[i,t]=r.split(":"),p=parseInt(t,10);n[`@media (min-width: ${S[i]})`]=`${p}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(n).reduce((r,[i,t])=>({...r,[i]:{width:t,height:t}}),{})}},g=a.forwardRef(({name:e,size:s=24,color:n="primary",title:o,className:r,style:i={},...t},p)=>{let m=IconMap[e],d=y(s);return a.createElement("div",{className:c("flex justify-center items-center",r),style:{...d,"--icon-stroke":l[n],...i}},a.createElement(m,{ref:p,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:l[n],...t}))});g.displayName="Icon";if (exports.default) module.exports = exports.default;export{g as Icon};//# sourceMappingURL=Icon.js.map
2
2
  //# sourceMappingURL=Icon.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles"],"mappings":"sHAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAwC,CAAA,CAC5C,QAAS,SACT,CAAA,SAAA,CAAW,SACX,CAAA,KAAA,CAAO,SACP,CAAA,WAAA,CAAa,SACf,CAAA,CAEMC,CAA6C,CAAA,CACjD,EAAI,CAAA,OAAA,CACJ,EAAI,CAAA,OAAA,CACJ,GAAI,QACJ,CAAA,EAAA,CAAI,QACJ,CAAA,KAAA,CAAO,QACT,CAAA,CAEMC,CACJC,CAAAA,CAAAA,EACwB,CACxB,GAAI,CAACA,CAAAA,CAAO,OAAO,CAAE,MAAO,MAAQ,CAAA,MAAA,CAAQ,MAAO,CAAA,CAEnD,IAAMC,CAAAA,CAAY,KAAM,CAAA,OAAA,CAAQD,CAAK,CAAA,CAAIA,CAAQ,CAAA,CAACA,CAAK,CAAA,CACjDE,EAAuC,EAAC,CAC1CC,CAGJ,CAAA,OAAAF,CAAU,CAAA,OAAA,CAASG,CAAS,EAAA,CAC1B,GAAI,OAAOA,CAAS,EAAA,QAAA,CAClBD,CAAW,CAAA,CAAA,EAAGC,CAAI,CAC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A,CAAK,CAC5C,CAAA,GAAGG,CACL,CAEAL,CAAAA,CAAAA,CAAAA,CAAA,aAACQ,CAAAA,CAAAA,CAAA,CACC,GAAA,CAAKD,CACL,CAAA,aAAA,CAAa,CAACJ,CAAAA,CACd,YAAYA,CAAAA,CAAAA,CACZ,MAAQF,CAAAA,CAAAA,CAAK,QAAS,CAAA,QAAQ,CAAI,CAAA,KAAA,CAAA,CAAYf,CAAUgB,CAAAA,CAAK,CAC5D,CAAA,GAAGI,CACN,CAAA,CACF,CAEJ,CACF,EAEAP,CAAAA,CAAK,WAAc,CAAA,MAAA","file":"Icon.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, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles"],"mappings":"sHAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAwC,CAAA,CAC5C,QAAS,SACT,CAAA,SAAA,CAAW,SACX,CAAA,KAAA,CAAO,SACP,CAA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,CACF,CACF,CAEaM,CAAAA,CAAAA,CAAOC,CAAM,CAAA,UAAA,CACxB,CACE,CACE,IAAAC,CAAAA,CAAAA,CACA,IAAAR,CAAAA,CAAAA,CAAO,EACP,CAAA,KAAA,CAAAS,CAAQ,CAAA,SAAA,CACR,KAAAC,CAAAA,CAAAA,CACA,SAAAC,CAAAA,CAAAA,CACA,KAAAC,CAAAA,CAAAA,CAAQ,EAAC,CACT,GAAGC,CACL,EACAC,CACG,GAAA,CACH,IAAMC,CAAAA,CAAgBC,OAAQR,CAAAA,CAAI,CAC5BS,CAAAA,CAAAA,CAAatB,CAAaK,CAAAA,CAAI,CAEpC,CAAA,OACEO,CAAA,CAAA,aAAA,CAAC,OACC,SAAWlB,CAAAA,CAAAA,CAAG,kCAAoCsB,CAAAA,CAAS,CAC3D,CAAA,KAAA,CAAO,CACL,GAAGM,CACF,CAAA,eAAA,CAA4BxB,CAAUgB,CAAAA,CAAK,CAC5C,CAAA,GAAGG,CACL,CAEAL,CAAAA,CAAAA,CAAAA,CAAA,aAACQ,CAAAA,CAAAA,CAAA,CACC,GAAA,CAAKD,CACL,CAAA,aAAA,CAAa,CAACJ,CAAAA,CACd,YAAYA,CAAAA,CAAAA,CACZ,MAAQF,CAAAA,CAAAA,CAAK,QAAS,CAAA,QAAQ,CAAI,CAAA,KAAA,CAAA,CAAYf,CAAUgB,CAAAA,CAAK,CAC5D,CAAA,GAAGI,CACN,CAAA,CACF,CAEJ,CACF,EAEAP,CAAAA,CAAK,WAAc,CAAA,MAAA","file":"Icon.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, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var a=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');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 a__namespace=/*#__PURE__*/_interopNamespace(a);function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var u="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var x={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},h={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},$=e=>{if(!e)return {width:"24px",height:"24px"};let n=Array.isArray(e)?e:[e],o={},s;return n.forEach(t=>{if(typeof t=="number")s=`${t}px`;else {let[i,r]=t.split(":"),p=parseInt(r,10);o[`@media (min-width: ${h[i]})`]=`${p}px`;}}),{width:s||"24px",height:s||"24px",...Object.entries(o).reduce((t,[i,r])=>({...t,[i]:{width:r,height:r}}),{})}},d=a__namespace.default.forwardRef(({name:e,size:n=24,color:o="primary",title:s,className:t,style:i={},...r},p)=>{let l=icons.IconMap[e],f=$(n);return a__namespace.default.createElement("div",{className:c("flex justify-center items-center",t),style:{...f,"--icon-stroke":x[o],...i}},a__namespace.default.createElement(l,{ref:p,"aria-hidden":!s,"aria-label":s,stroke:e.includes("filled")?void 0:x[o],...r}))});d.displayName="Icon";var A=({className:e,end:n,iconName:o,color:s,size:t,title:i,label:r,labelClassName:p,id:l,...f})=>a__namespace.createElement("div",{className:"space-y-2"},r&&a__namespace.createElement("label",{htmlFor:l,className:c("block text-sm font-medium text-text-primary",p)},r),a__namespace.createElement("div",{className:"relative"},a__namespace.createElement("input",{id:l,className:c(`font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${u} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,n&&"pr-10",e),...f}),n&&a__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},o?a__namespace.createElement(d,{name:o,color:s,size:t,title:i}):n)));if (exports.default) module.exports = exports.default;exports.Input=A;//# sourceMappingURL=Input.cjs.map
1
+ 'use strict';var n=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');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 n__namespace=/*#__PURE__*/_interopNamespace(n);function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var x={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},h={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},S=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],o={},i;return s.forEach(t=>{if(typeof t=="number")i=`${t}px`;else {let[a,r]=t.split(":"),p=parseInt(r,10);o[`@media (min-width: ${h[a]})`]=`${p}px`;}}),{width:i||"24px",height:i||"24px",...Object.entries(o).reduce((t,[a,r])=>({...t,[a]:{width:r,height:r}}),{})}},f=n__namespace.default.forwardRef(({name:e,size:s=24,color:o="primary",title:i,className:t,style:a={},...r},p)=>{let c=icons.IconMap[e],m=S(s);return n__namespace.default.createElement("div",{className:l("flex justify-center items-center",t),style:{...m,"--icon-stroke":x[o],...a}},n__namespace.default.createElement(c,{ref:p,"aria-hidden":!i,"aria-label":i,stroke:e.includes("filled")?void 0:x[o],...r}))});f.displayName="Icon";var M=({className:e,end:s,iconName:o,color:i,size:t,title:a,label:r,labelClassName:p,id:c,children:m,forceShowFocusRing:u,...g})=>n__namespace.createElement("div",{className:"py-2"},r&&n__namespace.createElement("label",{htmlFor:c,className:l("block text-sm font-medium text-text-primary",p)},r),n__namespace.createElement("div",{className:l("relative flex flex-col gap-2 w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background disabled:opacity-50",{"ring-2 ring-primary ring-offset-2":u,"focus-within:ring-2 focus-within:ring-primary focus-within:ring-offset-2":!u})},n__namespace.createElement("div",{className:"flex relative"},n__namespace.createElement("input",{id:c,className:l("font-sans lg:text-body-default text-xs flex w-full file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text disabled:cursor-not-allowed md:text-md focus:outline-none",s&&"pr-10",e),...g}),s&&n__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center"},o?n__namespace.createElement(f,{name:o,color:i,size:t,title:a}):s)),m));if (exports.default) module.exports = exports.default;exports.Input=M;//# sourceMappingURL=Input.cjs.map
2
2
  //# sourceMappingURL=Input.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","Input","end","iconName","label","labelClassName","id","a"],"mappings":"seAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,sBAAQC,SA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C,CAAA,aAAA,CAAA,KAAA,CAAA,CAAI,UAAU,WACZH,CAAAA,CAAAA,CAAAA,EACCG,YAAC,CAAA,aAAA,CAAA,OAAA,CAAA,CACC,QAASD,CACT,CAAA,SAAA,CAAWnC,EACT,6CACAkC,CAAAA,CACF,GAECD,CACH,CAAA,CAEFG,YAAC,CAAA,aAAA,CAAA,KAAA,CAAA,CAAI,UAAU,UACb,CAAA,CAAAA,YAAA,CAAA,aAAA,CAAC,OACC,CAAA,CAAA,EAAA,CAAID,EACJ,SAAWnC,CAAAA,CAAAA,CACT,CAAsSI,mSAAAA,EAAAA,CAAe,8DACrT2B,CAAO,EAAA,OAAA,CACPR,CACF,CACC,CAAA,GAAGE,EACN,CACCM,CAAAA,CAAAA,EACCK,YAAC,CAAA,aAAA,CAAA,KAAA,CAAA,CAAI,UAAU,mDACZJ,CAAAA,CAAAA,CAAAA,CACCI,YAAClB,CAAAA,aAAAA,CAAAA,CAAAA,CAAA,CAAK,IAAMc,CAAAA,CAAAA,CAAU,KAAOX,CAAAA,CAAAA,CAAO,KAAMT,CAAM,CAAA,KAAA,CAAOU,EAAO,CAE9DS,CAAAA,CAEJ,CAEJ,CACF","file":"Input.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: 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 breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\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 return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = ({\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n ...props\n}: InputProps) => (\n <div className=\"space-y-2\">\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"block text-sm font-medium text-text-primary\",\n labelClassName\n )}\n >\n {label}\n </label>\n )}\n <div className=\"relative\">\n <input\n id={id}\n className={cn(\n `font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${focusRingStyles} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,\n end && \"pr-10\",\n className\n )}\n {...props}\n />\n {end && (\n <div className=\"absolute inset-y-0 right-0 flex items-center pr-3\">\n {iconName ? (\n <Icon name={iconName} color={color} size={size} title={title} />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n </div>\n);\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","Input","end","iconName","label","labelClassName","id","children","forceShowFocusRing","n"],"mappings":"seAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAAA,CAAQC,UAAKF,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAAA,CAAwC,CAC5C,OAAA,CAAS,UACT,SA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ASH,CACT,CAAA,SAAA,CAAWlC,EACT,6CACAiC,CAAAA,CACF,GAECD,CACH,CAAA,CAEFK,YAAC,CAAA,aAAA,CAAA,KAAA,CAAA,CACC,UAAWrC,CACT,CAAA,uKAAA,CACA,CACE,mCAAqCoC,CAAAA,CAAAA,CACrC,2EACE,CAACA,CACL,CACF,CAAA,CAAA,CAEAC,2BAAC,KAAI,CAAA,CAAA,SAAA,CAAU,iBACbA,YAAC,CAAA,aAAA,CAAA,OAAA,CAAA,CACC,GAAIH,CACJ,CAAA,SAAA,CAAWlC,CACT,CAAA,wOAAA,CACA8B,GAAO,OACPR,CAAAA,CACF,EACC,GAAGE,CAAAA,CACN,EACCM,CACC,EAAAO,YAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,gDACZN,CACC,CAAAM,YAAA,CAAA,aAAA,CAACpB,EAAA,CAAK,IAAA,CAAMc,EAAU,KAAOX,CAAAA,CAAAA,CAAO,IAAMT,CAAAA,CAAAA,CAAM,MAAOU,CAAO,CAAA,CAAA,CAE9DS,CAEJ,CAEJ,CAAA,CACCK,CACH,CACF","file":"Input.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** Forces the focus ring to show regardless of focus state */\n forceShowFocusRing?: boolean;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = ({\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n children,\n forceShowFocusRing,\n ...props\n}: InputProps) => (\n <div className=\"py-2\">\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"block text-sm font-medium text-text-primary\",\n labelClassName\n )}\n >\n {label}\n </label>\n )}\n <div\n className={cn(\n \"relative flex flex-col gap-2 w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background disabled:opacity-50\",\n {\n \"ring-2 ring-primary ring-offset-2\": forceShowFocusRing,\n \"focus-within:ring-2 focus-within:ring-primary focus-within:ring-offset-2\":\n !forceShowFocusRing\n }\n )}\n >\n <div className=\"flex relative\">\n <input\n id={id}\n className={cn(\n \"font-sans lg:text-body-default text-xs flex w-full file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text disabled:cursor-not-allowed md:text-md focus:outline-none\",\n end && \"pr-10\",\n className\n )}\n {...props}\n />\n {end && (\n <div className=\"absolute inset-y-0 right-0 flex items-center\">\n {iconName ? (\n <Icon name={iconName} color={color} size={size} title={title} />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n {children}\n </div>\n </div>\n);\n"]}
@@ -1,2 +1,2 @@
1
- import*as a from'react';import a__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function c(...e){return twMerge(clsx(e))}var u="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var x={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},h={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},$=e=>{if(!e)return {width:"24px",height:"24px"};let n=Array.isArray(e)?e:[e],o={},s;return n.forEach(t=>{if(typeof t=="number")s=`${t}px`;else {let[i,r]=t.split(":"),p=parseInt(r,10);o[`@media (min-width: ${h[i]})`]=`${p}px`;}}),{width:s||"24px",height:s||"24px",...Object.entries(o).reduce((t,[i,r])=>({...t,[i]:{width:r,height:r}}),{})}},d=a__default.forwardRef(({name:e,size:n=24,color:o="primary",title:s,className:t,style:i={},...r},p)=>{let l=IconMap[e],f=$(n);return a__default.createElement("div",{className:c("flex justify-center items-center",t),style:{...f,"--icon-stroke":x[o],...i}},a__default.createElement(l,{ref:p,"aria-hidden":!s,"aria-label":s,stroke:e.includes("filled")?void 0:x[o],...r}))});d.displayName="Icon";var A=({className:e,end:n,iconName:o,color:s,size:t,title:i,label:r,labelClassName:p,id:l,...f})=>a.createElement("div",{className:"space-y-2"},r&&a.createElement("label",{htmlFor:l,className:c("block text-sm font-medium text-text-primary",p)},r),a.createElement("div",{className:"relative"},a.createElement("input",{id:l,className:c(`font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${u} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,n&&"pr-10",e),...f}),n&&a.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},o?a.createElement(d,{name:o,color:s,size:t,title:i}):n)));if (exports.default) module.exports = exports.default;export{A as Input};//# sourceMappingURL=Input.js.map
1
+ import*as n from'react';import n__default from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function l(...e){return twMerge(clsx(e))}var x={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},h={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},S=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],o={},i;return s.forEach(t=>{if(typeof t=="number")i=`${t}px`;else {let[a,r]=t.split(":"),p=parseInt(r,10);o[`@media (min-width: ${h[a]})`]=`${p}px`;}}),{width:i||"24px",height:i||"24px",...Object.entries(o).reduce((t,[a,r])=>({...t,[a]:{width:r,height:r}}),{})}},f=n__default.forwardRef(({name:e,size:s=24,color:o="primary",title:i,className:t,style:a={},...r},p)=>{let c=IconMap[e],m=S(s);return n__default.createElement("div",{className:l("flex justify-center items-center",t),style:{...m,"--icon-stroke":x[o],...a}},n__default.createElement(c,{ref:p,"aria-hidden":!i,"aria-label":i,stroke:e.includes("filled")?void 0:x[o],...r}))});f.displayName="Icon";var M=({className:e,end:s,iconName:o,color:i,size:t,title:a,label:r,labelClassName:p,id:c,children:m,forceShowFocusRing:u,...g})=>n.createElement("div",{className:"py-2"},r&&n.createElement("label",{htmlFor:c,className:l("block text-sm font-medium text-text-primary",p)},r),n.createElement("div",{className:l("relative flex flex-col gap-2 w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background disabled:opacity-50",{"ring-2 ring-primary ring-offset-2":u,"focus-within:ring-2 focus-within:ring-primary focus-within:ring-offset-2":!u})},n.createElement("div",{className:"flex relative"},n.createElement("input",{id:c,className:l("font-sans lg:text-body-default text-xs flex w-full file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text disabled:cursor-not-allowed md:text-md focus:outline-none",s&&"pr-10",e),...g}),s&&n.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center"},o?n.createElement(f,{name:o,color:i,size:t,title:a}):s)),m));if (exports.default) module.exports = exports.default;export{M as Input};//# sourceMappingURL=Input.js.map
2
2
  //# sourceMappingURL=Input.js.map