@deckai/deck-ui 0.0.10 → 0.0.13

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 (169) hide show
  1. package/README.md +127 -1
  2. package/dist/components/AboutCard.cjs +3 -7
  3. package/dist/components/AboutCard.cjs.map +1 -1
  4. package/dist/components/AboutCard.d.cts +3 -2
  5. package/dist/components/AboutCard.d.ts +3 -2
  6. package/dist/components/AboutCard.js +3 -7
  7. package/dist/components/AboutCard.js.map +1 -1
  8. package/dist/components/Avatar.cjs +1 -1
  9. package/dist/components/Avatar.cjs.map +1 -1
  10. package/dist/components/Avatar.d.cts +3 -1
  11. package/dist/components/Avatar.d.ts +3 -1
  12. package/dist/components/Avatar.js +1 -1
  13. package/dist/components/Avatar.js.map +1 -1
  14. package/dist/components/Badge.cjs +1 -1
  15. package/dist/components/Badge.cjs.map +1 -1
  16. package/dist/components/Badge.d.cts +2 -2
  17. package/dist/components/Badge.d.ts +2 -2
  18. package/dist/components/Badge.js +1 -1
  19. package/dist/components/Badge.js.map +1 -1
  20. package/dist/components/Breadcrumbs.cjs +1 -1
  21. package/dist/components/Breadcrumbs.cjs.map +1 -1
  22. package/dist/components/Breadcrumbs.js +1 -1
  23. package/dist/components/Breadcrumbs.js.map +1 -1
  24. package/dist/components/Button.cjs +3 -7
  25. package/dist/components/Button.cjs.map +1 -1
  26. package/dist/components/Button.d.cts +11 -1
  27. package/dist/components/Button.d.ts +11 -1
  28. package/dist/components/Button.js +3 -7
  29. package/dist/components/Button.js.map +1 -1
  30. package/dist/components/Collapsible.cjs +2 -0
  31. package/dist/components/Collapsible.cjs.map +1 -0
  32. package/dist/components/Collapsible.d.cts +12 -0
  33. package/dist/components/Collapsible.d.ts +12 -0
  34. package/dist/components/Collapsible.js +2 -0
  35. package/dist/components/Collapsible.js.map +1 -0
  36. package/dist/components/Combobox.cjs +1 -1
  37. package/dist/components/Combobox.cjs.map +1 -1
  38. package/dist/components/Combobox.d.cts +7 -1
  39. package/dist/components/Combobox.d.ts +7 -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.d.cts +2 -3
  45. package/dist/components/ContactItem.d.ts +2 -3
  46. package/dist/components/ContactItem.js +1 -1
  47. package/dist/components/ContactItem.js.map +1 -1
  48. package/dist/components/EditButton.cjs +10 -0
  49. package/dist/components/EditButton.cjs.map +1 -0
  50. package/dist/components/EditButton.d.cts +12 -0
  51. package/dist/components/EditButton.d.ts +12 -0
  52. package/dist/components/EditButton.js +10 -0
  53. package/dist/components/EditButton.js.map +1 -0
  54. package/dist/components/Icon.cjs +1 -1
  55. package/dist/components/Icon.cjs.map +1 -1
  56. package/dist/components/Icon.d.cts +4 -3
  57. package/dist/components/Icon.d.ts +4 -3
  58. package/dist/components/Icon.js +1 -1
  59. package/dist/components/Icon.js.map +1 -1
  60. package/dist/components/IconRenderer.cjs +2 -0
  61. package/dist/components/IconRenderer.cjs.map +1 -0
  62. package/dist/components/IconRenderer.d.cts +13 -0
  63. package/dist/components/IconRenderer.d.ts +13 -0
  64. package/dist/components/IconRenderer.js +2 -0
  65. package/dist/components/IconRenderer.js.map +1 -0
  66. package/dist/components/Illustration.cjs +50 -0
  67. package/dist/components/Illustration.cjs.map +1 -0
  68. package/dist/components/Illustration.d.cts +10 -0
  69. package/dist/components/Illustration.d.ts +10 -0
  70. package/dist/components/Illustration.js +50 -0
  71. package/dist/components/Illustration.js.map +1 -0
  72. package/dist/components/Input.cjs +1 -1
  73. package/dist/components/Input.cjs.map +1 -1
  74. package/dist/components/Input.d.cts +6 -2
  75. package/dist/components/Input.d.ts +6 -2
  76. package/dist/components/Input.js +1 -1
  77. package/dist/components/Input.js.map +1 -1
  78. package/dist/components/Link.cjs +1 -1
  79. package/dist/components/Link.cjs.map +1 -1
  80. package/dist/components/Link.d.cts +1 -1
  81. package/dist/components/Link.d.ts +1 -1
  82. package/dist/components/Link.js +1 -1
  83. package/dist/components/Link.js.map +1 -1
  84. package/dist/components/Logo.cjs +1 -1
  85. package/dist/components/Logo.cjs.map +1 -1
  86. package/dist/components/Logo.d.cts +2 -5
  87. package/dist/components/Logo.d.ts +2 -5
  88. package/dist/components/Logo.js +1 -1
  89. package/dist/components/Logo.js.map +1 -1
  90. package/dist/components/MultiSelectCombobox.cjs +2 -0
  91. package/dist/components/MultiSelectCombobox.cjs.map +1 -0
  92. package/dist/components/MultiSelectCombobox.d.cts +21 -0
  93. package/dist/components/MultiSelectCombobox.d.ts +21 -0
  94. package/dist/components/MultiSelectCombobox.js +2 -0
  95. package/dist/components/MultiSelectCombobox.js.map +1 -0
  96. package/dist/components/Navbar.cjs +2 -2
  97. package/dist/components/Navbar.cjs.map +1 -1
  98. package/dist/components/Navbar.d.cts +1 -1
  99. package/dist/components/Navbar.d.ts +1 -1
  100. package/dist/components/Navbar.js +2 -2
  101. package/dist/components/Navbar.js.map +1 -1
  102. package/dist/components/NavbarItem.cjs +1 -1
  103. package/dist/components/NavbarItem.cjs.map +1 -1
  104. package/dist/components/NavbarItem.d.cts +1 -1
  105. package/dist/components/NavbarItem.d.ts +1 -1
  106. package/dist/components/NavbarItem.js +1 -1
  107. package/dist/components/NavbarItem.js.map +1 -1
  108. package/dist/components/Pressable.cjs +1 -1
  109. package/dist/components/Pressable.cjs.map +1 -1
  110. package/dist/components/Pressable.js +1 -1
  111. package/dist/components/Pressable.js.map +1 -1
  112. package/dist/components/ProfileCard.cjs +3 -7
  113. package/dist/components/ProfileCard.cjs.map +1 -1
  114. package/dist/components/ProfileCard.d.cts +3 -1
  115. package/dist/components/ProfileCard.d.ts +3 -1
  116. package/dist/components/ProfileCard.js +3 -7
  117. package/dist/components/ProfileCard.js.map +1 -1
  118. package/dist/components/Sidebar.cjs +2 -0
  119. package/dist/components/Sidebar.cjs.map +1 -0
  120. package/dist/components/Sidebar.d.cts +37 -0
  121. package/dist/components/Sidebar.d.ts +37 -0
  122. package/dist/components/Sidebar.js +2 -0
  123. package/dist/components/Sidebar.js.map +1 -0
  124. package/dist/components/SocialCard.cjs +1 -1
  125. package/dist/components/SocialCard.cjs.map +1 -1
  126. package/dist/components/SocialCard.js +1 -1
  127. package/dist/components/SocialCard.js.map +1 -1
  128. package/dist/components/Spinner.cjs +2 -0
  129. package/dist/components/Spinner.cjs.map +1 -0
  130. package/dist/components/Spinner.d.cts +19 -0
  131. package/dist/components/Spinner.d.ts +19 -0
  132. package/dist/components/Spinner.js +2 -0
  133. package/dist/components/Spinner.js.map +1 -0
  134. package/dist/components/Tabs.cjs +1 -1
  135. package/dist/components/Tabs.cjs.map +1 -1
  136. package/dist/components/Tabs.js +1 -1
  137. package/dist/components/Tabs.js.map +1 -1
  138. package/dist/components/Tag.cjs +1 -1
  139. package/dist/components/Tag.cjs.map +1 -1
  140. package/dist/components/Tag.d.cts +4 -2
  141. package/dist/components/Tag.d.ts +4 -2
  142. package/dist/components/Tag.js +1 -1
  143. package/dist/components/Tag.js.map +1 -1
  144. package/dist/components/Text.cjs +1 -1
  145. package/dist/components/Text.cjs.map +1 -1
  146. package/dist/components/Text.d.cts +2 -2
  147. package/dist/components/Text.d.ts +2 -2
  148. package/dist/components/Text.js +1 -1
  149. package/dist/components/Text.js.map +1 -1
  150. package/dist/components/TextArea.cjs +2 -0
  151. package/dist/components/TextArea.cjs.map +1 -0
  152. package/dist/components/TextArea.d.cts +19 -0
  153. package/dist/components/TextArea.d.ts +19 -0
  154. package/dist/components/TextArea.js +2 -0
  155. package/dist/components/TextArea.js.map +1 -0
  156. package/dist/components/WorkCard.cjs +1 -1
  157. package/dist/components/WorkCard.cjs.map +1 -1
  158. package/dist/components/WorkCard.js +1 -1
  159. package/dist/components/WorkCard.js.map +1 -1
  160. package/dist/index.cjs +51 -7
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +99 -23
  163. package/dist/index.d.ts +99 -23
  164. package/dist/index.js +51 -7
  165. package/dist/index.js.map +1 -1
  166. package/dist/styles/styles.css +1 -1
  167. package/dist/{tailwind-DJFscIlV.d.cts → tailwind-CIZ10fKA.d.cts} +4 -3
  168. package/dist/{tailwind-DJFscIlV.d.ts → tailwind-CIZ10fKA.d.ts} +4 -3
  169. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Combobox.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","focusRingStylesCoerced","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","baseSize","style","mediaQueries","size","acc","breakpoint","value","Icon","React","name","color","title","className","props","ref","IconComponent","IconMap","sizeStyles","Input","end","iconName","f","Option","label","onChange","selected","Combobox","options","placeholder","open","setOpen","useState","inputValue","setInputValue","selectedOption","useMemo","option","filteredItems","handleOptionChange","useCallback","c","e","optionValue","index"],"mappings":"8jBAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAAA,CAAQC,SAAKF,CAAAA,CAAM,CAAC,CAC7B,CC8DO,IAAMG,CAAAA,CACX,qGAEWC,CAAAA,CAAAA,CAAyB,gCCtEtC,CAgBA,IAAMC,CAAAA,CAAwC,CAC5C,OAAS,CAAA,SAAA,CACT,SAAW,CAAA,SAAA,CACX,KAAO,CAAA,SAAA,CACP,WAAa,CAAA,SACf,EAKMC,CAA6C,CAAA,CACjD,EAAI,CAAA,2BAAA,CACJ,EAAI,CAAA,2BAAA,CACJ,EAAI,CAAA,4BAAA,CACJ,GAAI,4BACJ,CAAA,KAAA,CAAO,4BACT,CAAA,CAEMC,CACJC,CAAAA,CAAAA,EACwB,CACxB,GAAI,CAACA,CAAAA,CAAO,OAAO,CAAE,KAAO,CAAA,MAAA,CAAQ,MAAQ,CAAA,MAAO,EAEnD,IAAMC,CAAAA,CAAY,KAAM,CAAA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CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,kDACZ6B,CAAAA,CAAAA,CAAAA,CAAc,OAAS,CACtBA,CAAAA,CAAAA,CAAc,GAAI,CAAA,CAAC,CAAE,KAAA,CAAAd,CAAO,CAAA,KAAA,CAAOmB,CAAY,CAAGC,CAAAA,CAAAA,GAChDnC,oBAAA,CAAA,aAAA,CAACc,CAAA,CAAA,CACC,QAAUgB,CAAAA,CAAAA,CACV,MAAOI,CACP,CAAA,GAAA,CAAKC,CACL,CAAA,KAAA,CAAOpB,CACT,CAAA,CACD,CAEDf,CAAAA,oBAAAA,CAAA,cAAC,KAAI,CAAA,CAAA,SAAA,CAAU,mCAAoC,CAAA,CAAA,kBAEnD,CAEJ,CACF,CACF,CACF,CACF,CAEJ","file":"Combobox.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\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: number | `${Breakpoint}:${number}`;\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\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"@media (min-width: 640px)\",\n md: \"@media (min-width: 768px)\",\n lg: \"@media (min-width: 1024px)\",\n xl: \"@media (min-width: 1280px)\",\n \"2xl\": \"@media (min-width: 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 baseSize = typeof sizeArray[0] === \"number\" ? sizeArray[0] : 24;\n\n const style: React.CSSProperties = {\n width: `${baseSize}px`,\n height: `${baseSize}px`\n };\n\n // Add media queries for responsive sizes\n const mediaQueries = sizeArray\n .filter(\n (size): size is `${Breakpoint}:${number}` =>\n typeof size === \"string\" && size.includes(\":\")\n )\n .reduce(\n (acc, size) => {\n const [breakpoint, value] = size.split(\":\") as [Breakpoint, string];\n acc[BREAKPOINT_MAP[breakpoint]] = {\n width: `${value}px`,\n height: `${value}px`\n };\n return acc;\n },\n {} as Record<string, React.CSSProperties>\n );\n\n if (Object.keys(mediaQueries).length > 0) {\n (style as any)[\"@media\"] = mediaQueries;\n }\n\n return style;\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} & 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 ...props\n}: InputProps) => (\n <div className=\"relative\">\n <input\n className={cn(\n `font-sans flex w-full rounded-lg border border-secondary-50 bg-background px-3 py-3 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);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\n\nexport type ComboboxProps = {\n options: OptionProps[];\n placeholder?: string;\n value?: string;\n onChange: (value: string) => void;\n end?: React.ReactNode;\n className?: string;\n};\n\nexport const Combobox = ({\n options,\n placeholder = \"Select an item...\",\n value,\n onChange,\n end,\n className\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState<string | undefined>(value);\n\n const selectedOption: OptionProps | undefined = useMemo(\n () => options.find((option) => option.value === inputValue),\n [inputValue, options]\n );\n\n const filteredItems = options.filter((option) =>\n inputValue\n ? option.label.toLowerCase().includes(inputValue.toLowerCase())\n : options\n );\n\n const handleOptionChange = useCallback(\n (option: string) => {\n onChange(option);\n setOpen(false);\n setInputValue(selectedOption?.label);\n },\n [onChange, selectedOption?.label]\n );\n\n console.log({ open }, \"wtf\");\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"flex\">\n <div className=\"relative flex-1\">\n <Input\n placeholder={placeholder}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n end={end}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n />\n </div>\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredItems.length > 0 ? (\n filteredItems.map(({ label, value: optionValue }, index) => (\n <Option\n onChange={handleOptionChange}\n value={optionValue}\n key={index}\n label={label}\n />\n ))\n ) : (\n <div className=\"px-2 py-1.5 text-sm text-gray-500\">\n No results found\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Combobox.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","focusRingStylesCoerced","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","d","Option","onChange","selected","Combobox","options","placeholder","open","setOpen","useState","inputValue","setInputValue","selectedOption","useMemo","option","filteredItems","handleOptionChange","useCallback","p","e","optionLabel","optionValue","index"],"mappings":"8jBAGO,SAASA,CAAM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","file":"Combobox.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","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\n\nexport type ComboboxProps = {\n options: OptionProps[];\n placeholder?: string;\n value?: string;\n onChange: (value: string) => void;\n end?: React.ReactNode;\n className?: string;\n /** Label text for the combobox */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** ID for accessibility */\n id?: string;\n};\n\nexport const Combobox = ({\n options,\n placeholder = \"Select an item...\",\n value,\n onChange,\n end,\n className,\n label,\n labelClassName,\n id\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState<string | undefined>(value);\n\n const selectedOption: OptionProps | undefined = useMemo(\n () => options.find((option) => option.value === inputValue),\n [inputValue, options]\n );\n\n const filteredItems = options.filter((option) =>\n inputValue\n ? option.label.toLowerCase().includes(inputValue.toLowerCase())\n : options\n );\n\n const handleOptionChange = useCallback(\n (option: string) => {\n onChange(option);\n setOpen(false);\n setInputValue(selectedOption?.label);\n },\n [onChange, selectedOption?.label]\n );\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"flex\">\n <div className=\"relative flex-1\">\n <Input\n id={id}\n label={label}\n labelClassName={labelClassName}\n placeholder={placeholder}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n end={end}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n />\n </div>\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredItems.length > 0 ? (\n filteredItems.map(\n ({ label: optionLabel, value: optionValue }, index) => (\n <Option\n onChange={handleOptionChange}\n value={optionValue}\n key={index}\n label={optionLabel}\n />\n )\n )\n ) : (\n <div className=\"px-2 py-1.5 text-sm text-gray-500\">\n No results found\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n};\n"]}
@@ -8,7 +8,13 @@ type ComboboxProps = {
8
8
  onChange: (value: string) => void;
9
9
  end?: React__default.ReactNode;
10
10
  className?: string;
11
+ /** Label text for the combobox */
12
+ label?: string;
13
+ /** Additional classes for the label */
14
+ labelClassName?: string;
15
+ /** ID for accessibility */
16
+ id?: string;
11
17
  };
12
- declare const Combobox: ({ options, placeholder, value, onChange, end, className }: ComboboxProps) => React__default.JSX.Element;
18
+ declare const Combobox: ({ options, placeholder, value, onChange, end, className, label, labelClassName, id }: ComboboxProps) => React__default.JSX.Element;
13
19
 
14
20
  export { Combobox, type ComboboxProps };
@@ -8,7 +8,13 @@ type ComboboxProps = {
8
8
  onChange: (value: string) => void;
9
9
  end?: React__default.ReactNode;
10
10
  className?: string;
11
+ /** Label text for the combobox */
12
+ label?: string;
13
+ /** Additional classes for the label */
14
+ labelClassName?: string;
15
+ /** ID for accessibility */
16
+ id?: string;
11
17
  };
12
- declare const Combobox: ({ options, placeholder, value, onChange, end, className }: ComboboxProps) => React__default.JSX.Element;
18
+ declare const Combobox: ({ options, placeholder, value, onChange, end, className, label, labelClassName, id }: ComboboxProps) => React__default.JSX.Element;
13
19
 
14
20
  export { Combobox, type ComboboxProps };
@@ -1,2 +1,2 @@
1
- import*as n from'react';import n__default,{useState,useMemo,useCallback}from'react';import*as c from'@radix-ui/react-popover';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function d(...e){return twMerge(clsx(e))}var h="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",y="ring-2 ring-ring ring-offset-2";var C={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},E={sm:"@media (min-width: 640px)",md:"@media (min-width: 768px)",lg:"@media (min-width: 1024px)",xl:"@media (min-width: 1280px)","2xl":"@media (min-width: 1536px)"},V=e=>{if(!e)return {width:"24px",height:"24px"};let o=Array.isArray(e)?e:[e],t=typeof o[0]=="number"?o[0]:24,r={width:`${t}px`,height:`${t}px`},l=o.filter(s=>typeof s=="string"&&s.includes(":")).reduce((s,a)=>{let[m,i]=a.split(":");return s[E[m]]={width:`${i}px`,height:`${i}px`},s},{});return Object.keys(l).length>0&&(r["@media"]=l),r},x=n__default.forwardRef(({name:e,size:o=24,color:t="primary",title:r,className:l,style:s={},...a},m)=>{let i=IconMap[e],u=V(o);return n__default.createElement("div",{className:d("flex justify-center items-center",l),style:{...u,"--icon-stroke":C[t],...s}},n__default.createElement(i,{ref:m,"aria-hidden":!r,"aria-label":r,stroke:e.includes("filled")?void 0:C[t],...a}))});x.displayName="Icon";var P=({className:e,end:o,iconName:t,color:r,size:l,title:s,...a})=>n.createElement("div",{className:"relative"},n.createElement("input",{className:d(`font-sans flex w-full rounded-lg border border-secondary-50 bg-background px-3 py-3 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 ${h} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,o&&"pr-10",e),...a}),o&&n.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},t?n.createElement(x,{name:t,color:r,size:l,title:s}):o));var $=({value:e,label:o,onChange:t,selected:r})=>n__default.createElement("button",{type:"button",className:d("relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded",r&&"bg-gray-100"),onClick:()=>{t?.(e);}},o);var ne=({options:e,placeholder:o="Select an item...",value:t,onChange:r,end:l,className:s})=>{let[a,m]=useState(!1),[i,u]=useState(t),b=useMemo(()=>e.find(p=>p.value===i),[i,e]),v=e.filter(p=>i?p.label.toLowerCase().includes(i.toLowerCase()):e),I=useCallback(p=>{r(p),m(!1),u(b?.label);},[r,b?.label]);return console.log({open:a},"wtf"),n__default.createElement(c.Root,{open:a,onOpenChange:m},n__default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${s}`},n__default.createElement(c.Trigger,{asChild:!0},n__default.createElement("div",{className:"flex"},n__default.createElement("div",{className:"relative flex-1"},n__default.createElement(P,{placeholder:o,value:i,onChange:p=>u(p.target.value),end:l,className:`flex-1 ${a&&y}`})))),n__default.createElement(c.Portal,null,n__default.createElement(c.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1",sideOffset:5},n__default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},v.length>0?v.map(({label:p,value:w},O)=>n__default.createElement($,{onChange:I,value:w,key:O,label:p})):n__default.createElement("div",{className:"px-2 py-1.5 text-sm text-gray-500"},"No results found"))))))};if (exports.default) module.exports = exports.default;export{ne as Combobox};//# sourceMappingURL=Combobox.js.map
1
+ import*as i from'react';import i__default,{useState,useMemo,useCallback}from'react';import*as p from'@radix-ui/react-popover';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';function m(...e){return twMerge(clsx(e))}var P="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",$="ring-2 ring-ring ring-offset-2";var I={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},M={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},T=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],o={},t;return r.forEach(s=>{if(typeof s=="number")t=`${s}px`;else {let[a,n]=s.split(":"),c=parseInt(n,10);o[`@media (min-width: ${M[a]})`]=`${c}px`;}}),{width:t||"24px",height:t||"24px",...Object.entries(o).reduce((s,[a,n])=>({...s,[a]:{width:n,height:n}}),{})}},b=i__default.forwardRef(({name:e,size:r=24,color:o="primary",title:t,className:s,style:a={},...n},c)=>{let f=IconMap[e],u=T(r);return i__default.createElement("div",{className:m("flex justify-center items-center",s),style:{...u,"--icon-stroke":I[o],...a}},i__default.createElement(f,{ref:c,"aria-hidden":!t,"aria-label":t,stroke:e.includes("filled")?void 0:I[o],...n}))});b.displayName="Icon";var S=({className:e,end:r,iconName:o,color:t,size:s,title:a,label:n,labelClassName:c,id:f,...u})=>i.createElement("div",{className:"space-y-2"},n&&i.createElement("label",{htmlFor:f,className:m("block text-sm font-medium text-text-primary",c)},n),i.createElement("div",{className:"relative"},i.createElement("input",{id:f,className:m(`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 ${P} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,r&&"pr-10",e),...u}),r&&i.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},o?i.createElement(b,{name:o,color:t,size:s,title:a}):r)));var N=({value:e,label:r,onChange:o,selected:t})=>i__default.createElement("button",{type:"button",className:m("relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded",t&&"bg-gray-100"),onClick:()=>{o?.(e);}},r);var le=({options:e,placeholder:r="Select an item...",value:o,onChange:t,end:s,className:a,label:n,labelClassName:c,id:f})=>{let[u,v]=useState(!1),[g,y]=useState(o),h=useMemo(()=>e.find(l=>l.value===g),[g,e]),C=e.filter(l=>g?l.label.toLowerCase().includes(g.toLowerCase()):e),k=useCallback(l=>{t(l),v(!1),y(h?.label);},[t,h?.label]);return i__default.createElement(p.Root,{open:u,onOpenChange:v},i__default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${a}`},i__default.createElement(p.Trigger,{asChild:!0},i__default.createElement("div",{className:"flex"},i__default.createElement("div",{className:"relative flex-1"},i__default.createElement(S,{id:f,label:n,labelClassName:c,placeholder:r,value:g,onChange:l=>y(l.target.value),end:s,className:`flex-1 ${u&&$}`})))),i__default.createElement(p.Portal,null,i__default.createElement(p.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20",sideOffset:5},i__default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},C.length>0?C.map(({label:l,value:w},E)=>i__default.createElement(N,{onChange:k,value:w,key:E,label:l})):i__default.createElement("div",{className:"px-2 py-1.5 text-sm text-gray-500"},"No results found"))))))};if (exports.default) module.exports = exports.default;export{le as Combobox};//# sourceMappingURL=Combobox.js.map
2
2
  //# sourceMappingURL=Combobox.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Combobox.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","focusRingStylesCoerced","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","baseSize","style","mediaQueries","size","acc","breakpoint","value","Icon","React","name","color","title","className","props","ref","IconComponent","IconMap","sizeStyles","Input","end","iconName","f","Option","label","onChange","selected","Combobox","options","placeholder","open","setOpen","useState","inputValue","setInputValue","selectedOption","useMemo","option","filteredItems","handleOptionChange","useCallback","e","optionValue","index"],"mappings":"+NAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,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bA,WAAA,aAACU,CAAAA,CAAAA,CAAA,CACC,WAAA,CAAaU,CACb,CAAA,KAAA,CAAOI,CACP,CAAA,QAAA,CAAWQ,GAAMP,CAAcO,CAAAA,CAAAA,CAAE,MAAO,CAAA,KAAK,CAC7C,CAAA,GAAA,CAAKrB,CACL,CAAA,SAAA,CAAW,CAAUU,OAAAA,EAAAA,CAAAA,EAAQnC,CAAsB,CAAA,CAAA,CACrD,CACF,CACF,CACF,CAAA,CAEAc,WAAA,aAAS,CAAA,CAAA,CAAA,MAAA,CAAR,IACCA,CAAAA,UAAAA,CAAA,aAAS,CAAA,CAAA,CAAA,OAAA,CAAR,CACC,SAAA,CAAU,kFACV,UAAY,CAAA,CAAA,CAAA,CAEZA,UAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,kDACZ6B,CAAAA,CAAAA,CAAAA,CAAc,OAAS,CACtBA,CAAAA,CAAAA,CAAc,GAAI,CAAA,CAAC,CAAE,KAAA,CAAAd,CAAO,CAAA,KAAA,CAAOkB,CAAY,CAAGC,CAAAA,CAAAA,GAChDlC,UAAA,CAAA,aAAA,CAACc,CAAA,CAAA,CACC,QAAUgB,CAAAA,CAAAA,CACV,MAAOG,CACP,CAAA,GAAA,CAAKC,CACL,CAAA,KAAA,CAAOnB,CACT,CAAA,CACD,CAEDf,CAAAA,UAAAA,CAAA,cAAC,KAAI,CAAA,CAAA,SAAA,CAAU,mCAAoC,CAAA,CAAA,kBAEnD,CAEJ,CACF,CACF,CACF,CACF,CAEJ","file":"Combobox.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\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\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: number | `${Breakpoint}:${number}`;\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\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"@media (min-width: 640px)\",\n md: \"@media (min-width: 768px)\",\n lg: \"@media (min-width: 1024px)\",\n xl: \"@media (min-width: 1280px)\",\n \"2xl\": \"@media (min-width: 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 baseSize = typeof sizeArray[0] === \"number\" ? sizeArray[0] : 24;\n\n const style: React.CSSProperties = {\n width: `${baseSize}px`,\n height: `${baseSize}px`\n };\n\n // Add media queries for responsive sizes\n const mediaQueries = sizeArray\n .filter(\n (size): size is `${Breakpoint}:${number}` =>\n typeof size === \"string\" && size.includes(\":\")\n )\n .reduce(\n (acc, size) => {\n const [breakpoint, value] = size.split(\":\") as [Breakpoint, string];\n acc[BREAKPOINT_MAP[breakpoint]] = {\n width: `${value}px`,\n height: `${value}px`\n };\n return acc;\n },\n {} as Record<string, React.CSSProperties>\n );\n\n if (Object.keys(mediaQueries).length > 0) {\n (style as any)[\"@media\"] = mediaQueries;\n }\n\n return style;\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} & 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 ...props\n}: InputProps) => (\n <div className=\"relative\">\n <input\n className={cn(\n `font-sans flex w-full rounded-lg border border-secondary-50 bg-background px-3 py-3 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);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\n\nexport type ComboboxProps = {\n options: OptionProps[];\n placeholder?: string;\n value?: string;\n onChange: (value: string) => void;\n end?: React.ReactNode;\n className?: string;\n};\n\nexport const Combobox = ({\n options,\n placeholder = \"Select an item...\",\n value,\n onChange,\n end,\n className\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState<string | undefined>(value);\n\n const selectedOption: OptionProps | undefined = useMemo(\n () => options.find((option) => option.value === inputValue),\n [inputValue, options]\n );\n\n const filteredItems = options.filter((option) =>\n inputValue\n ? option.label.toLowerCase().includes(inputValue.toLowerCase())\n : options\n );\n\n const handleOptionChange = useCallback(\n (option: string) => {\n onChange(option);\n setOpen(false);\n setInputValue(selectedOption?.label);\n },\n [onChange, selectedOption?.label]\n );\n\n console.log({ open }, \"wtf\");\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"flex\">\n <div className=\"relative flex-1\">\n <Input\n placeholder={placeholder}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n end={end}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n />\n </div>\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredItems.length > 0 ? (\n filteredItems.map(({ label, value: optionValue }, index) => (\n <Option\n onChange={handleOptionChange}\n value={optionValue}\n key={index}\n label={label}\n />\n ))\n ) : (\n <div className=\"px-2 py-1.5 text-sm text-gray-500\">\n No results found\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Combobox.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","focusRingStylesCoerced","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","d","Option","onChange","selected","Combobox","options","placeholder","open","setOpen","useState","inputValue","setInputValue","selectedOption","useMemo","option","filteredItems","handleOptionChange","useCallback","e","optionLabel","optionValue","index"],"mappings":"+NAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,QAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CC8DO,IAAMG,CAAAA,CACX,qGAEWC,CAAAA,CAAAA,CAAyB,gCCtEtC,CAmBA,IAAMC,CAAwC,CAAA,CAC5C,OAAS,CAAA,SAAA,CACT,UAAW,SACX,CAAA,KAAA,CAAO,SACP,CAAA,WAAA,CAAa,SACf,CAAA,CAEMC,CAA6C,CAAA,CACjD,GAAI,OACJ,CAAA,EAAA,CAAI,OACJ,CAAA,EAAA,CAAI,SACJ,EAAI,CAAA,QAAA,CACJ,KAAO,CAAA,QACT,EAEMC,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,CAAIA,CAAAA,CAAAA,CAAQ,CAACA,CAAK,CACjDE,CAAAA,CAAAA,CAAuC,EAAC,CAC1CC,EAGJ,OAAAF,CAAAA,CAAU,OAASG,CAAAA,CAAAA,EAAS,CAC1B,GAAI,OAAOA,CAAS,EAAA,QAAA,CAClBD,E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AA,SAAA,CAAU,oDACZgC,CAAc,CAAA,MAAA,CAAS,CACtBA,CAAAA,CAAAA,CAAc,GACZ,CAAA,CAAC,CAAE,KAAA,CAAOI,EAAa,KAAOC,CAAAA,CAAY,CAAGC,CAAAA,CAAAA,GAC3CtC,WAAA,aAACkB,CAAAA,CAAAA,CAAA,CACC,QAAA,CAAUe,EACV,KAAOI,CAAAA,CAAAA,CACP,GAAKC,CAAAA,CAAAA,CACL,KAAOF,CAAAA,CAAAA,CACT,CAEJ,CAAA,CAEApC,WAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,mCAAA,CAAA,CAAoC,kBAEnD,CAEJ,CACF,CACF,CACF,CACF,CAEJ","file":"Combobox.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\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","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\n\nexport type ComboboxProps = {\n options: OptionProps[];\n placeholder?: string;\n value?: string;\n onChange: (value: string) => void;\n end?: React.ReactNode;\n className?: string;\n /** Label text for the combobox */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** ID for accessibility */\n id?: string;\n};\n\nexport const Combobox = ({\n options,\n placeholder = \"Select an item...\",\n value,\n onChange,\n end,\n className,\n label,\n labelClassName,\n id\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState<string | undefined>(value);\n\n const selectedOption: OptionProps | undefined = useMemo(\n () => options.find((option) => option.value === inputValue),\n [inputValue, options]\n );\n\n const filteredItems = options.filter((option) =>\n inputValue\n ? option.label.toLowerCase().includes(inputValue.toLowerCase())\n : options\n );\n\n const handleOptionChange = useCallback(\n (option: string) => {\n onChange(option);\n setOpen(false);\n setInputValue(selectedOption?.label);\n },\n [onChange, selectedOption?.label]\n );\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"flex\">\n <div className=\"relative flex-1\">\n <Input\n id={id}\n label={label}\n labelClassName={labelClassName}\n placeholder={placeholder}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n end={end}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n />\n </div>\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredItems.length > 0 ? (\n filteredItems.map(\n ({ label: optionLabel, value: optionValue }, index) => (\n <Option\n onChange={handleOptionChange}\n value={optionValue}\n key={index}\n label={optionLabel}\n />\n )\n )\n ) : (\n <div className=\"px-2 py-1.5 text-sm text-gray-500\">\n No results found\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var p=require('react'),icons=require('@deckai/icons'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var p__default=/*#__PURE__*/_interopDefault(p);function g(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var h={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},x={sm:"@media (min-width: 640px)",md:"@media (min-width: 768px)",lg:"@media (min-width: 1024px)",xl:"@media (min-width: 1280px)","2xl":"@media (min-width: 1536px)"},b=e=>{if(!e)return {width:"24px",height:"24px"};let t=Array.isArray(e)?e:[e],r=typeof t[0]=="number"?t[0]:24,o={width:`${r}px`,height:`${r}px`},a=t.filter(n=>typeof n=="string"&&n.includes(":")).reduce((n,s)=>{let[l,i]=s.split(":");return n[x[l]]={width:`${i}px`,height:`${i}px`},n},{});return Object.keys(a).length>0&&(o["@media"]=a),o},d=p__default.default.forwardRef(({name:e,size:t=24,color:r="primary",title:o,className:a,style:n={},...s},l)=>{let i=icons.IconMap[e],m=b(t);return p__default.default.createElement("div",{className:g("flex justify-center items-center",a),style:{...m,"--icon-stroke":h[r],...n}},p__default.default.createElement(i,{ref:l,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:h[r],...s}))});d.displayName="Icon";var E={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},C=e=>{let[t,r]=e.split("-");return t==="heading"?E[r]||"p":t==="label"?"label":"p"},R={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[o,a]=r.split(":");return `${o}:text-${a}`}return Array.isArray(e)?`lg:text-${r}`:`text-${r}`}).join(" "):"text-body-default",T=p__default.default.forwardRef(({variant:e="body-default",color:t="text-primary",as:r,className:o,children:a,weight:n,...s},l)=>{let i=A(e),m=t&&t==="inherit"?"inherit":t?`text-${t}`:"",u=p__default.default.useMemo(()=>{let H=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return C(H)},[e]);return p__default.default.createElement(r||u,{ref:l,className:`font-sans antialiased ${i} ${m} ${n?`!${R[n]}`:""} ${o??""}`,...s},a)});T.displayName="Text";var j=({iconName:e,children:t,href:r,...o})=>p__default.default.createElement("div",{className:"row gap-2 flex items-center"},p__default.default.createElement("div",{className:"bg-secondary-400 rounded-full p-2.5"},p__default.default.createElement(d,{name:e,color:"primaryBlue",size:18})),p__default.default.createElement(T,{className:"hover:underline",as:"a",href:r,...o,variant:["body-lg","md:body-default-medium"]},t));if (exports.default) module.exports = exports.default;exports.ContactItem=j;//# sourceMappingURL=ContactItem.cjs.map
1
+ 'use strict';var i=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var i__default=/*#__PURE__*/_interopDefault(i);var p=({icon:e,size:t=40,className:r})=>{let o=i.useMemo(()=>{let n=new DOMParser().parseFromString(e,"image/svg+xml").querySelector("svg");if(!n)return null;n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("preserveAspectRatio","xMidYMid meet");let l=n.getAttribute("viewBox")||"0 0 40 40";return n.setAttribute("viewBox",l),n.outerHTML},[e]);return o?i__default.default.createElement("div",{style:{width:t,height:t,display:"flex",alignItems:"center",justifyContent:"center"},className:r,dangerouslySetInnerHTML:{__html:o}}):null};p.displayName="IconRenderer";var L={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},x=e=>{let[t,r]=e.split("-");return t==="heading"?L[r]||"p":t==="label"?"label":"p"},E={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[o,s]=r.split(":");return `${o}:text-${s}`}return `text-${r}`}).join(" "):"text-body-default",m=i__default.default.forwardRef(({variant:e="body-default",color:t="text-primary",as:r,className:o,children:s,weight:a,...n},l)=>{let h=A(e),u=t&&t==="inherit"?"inherit":t?`text-${t}`:"",f=i__default.default.useMemo(()=>{let b=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return x(b)},[e]);return i__default.default.createElement(r||f,{ref:l,className:`font-sans antialiased ${h} ${u} ${a?`!${E[a]}`:""} ${o??""}`,...n},s)});m.displayName="Text";function y(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var T="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var g=({children:e,color:t="text-primary",variant:r="body-default-semibold",href:o,className:s,...a})=>i__default.default.createElement(m,{variant:r,color:t},i__default.default.createElement("a",{href:o,className:y("hover:opacity-80 transition-all active:scale-95 hover:underline",T,s),...a},e));var Q=({icon:e,children:t,href:r,...o})=>i__default.default.createElement("div",{className:"row gap-2 flex items-center"},i__default.default.createElement("div",{className:"bg-secondary-400 rounded-full p-2.5 items-center justify-center"},i__default.default.createElement(p,{icon:e,size:24,className:"text-primary"})),i__default.default.createElement(g,{className:"hover:underline",href:r,...o,variant:["body-default-semibold","md:body-default-medium"]},t));if (exports.default) module.exports = exports.default;exports.ContactItem=Q;//# sourceMappingURL=ContactItem.cjs.map
2
2
  //# sourceMappingURL=ContactItem.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/ContactItem.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","baseSize","style","mediaQueries","size","acc","breakpoint","value","Icon","React","name","color","title","className","props","ref","IconComponent","IconMap","sizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","ContactItem","iconName","href","linkProps"],"mappings":"gPAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCWA,IAAMG,CAAAA,CAAwC,CAC5C,OAAA,CAAS,SACT,CAAA,SAAA,CAAW,SACX,CAAA,KAAA,CAAO,SACP,CAAA,WAAA,CAAa,SACf,CAAA,CAKMC,CAA6C,CAAA,CACjD,EAAI,CAAA,2BAAA,CACJ,EAAI,CAAA,2BAAA,CACJ,EA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A,CAAM,aAAc,CAAA,IAAA,CAAM,EAAI,CAAA,CACtD,CACA3B,CAAAA,kBAAAA,CAAA,aAACkB,CAAAA,CAAAA,CAAA,CACC,SAAA,CAAU,iBACV,CAAA,EAAA,CAAG,GACH,CAAA,IAAA,CAAMU,CACL,CAAA,GAAGC,CACJ,CAAA,OAAA,CAAS,CAAC,SAAA,CAAW,wBAAwB,CAAA,CAAA,CAE5CT,CACH,CACF","file":"ContactItem.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\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: number | `${Breakpoint}:${number}`;\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\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"@media (min-width: 640px)\",\n md: \"@media (min-width: 768px)\",\n lg: \"@media (min-width: 1024px)\",\n xl: \"@media (min-width: 1280px)\",\n \"2xl\": \"@media (min-width: 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 baseSize = typeof sizeArray[0] === \"number\" ? sizeArray[0] : 24;\n\n const style: React.CSSProperties = {\n width: `${baseSize}px`,\n height: `${baseSize}px`\n };\n\n // Add media queries for responsive sizes\n const mediaQueries = sizeArray\n .filter(\n (size): size is `${Breakpoint}:${number}` =>\n typeof size === \"string\" && size.includes(\":\")\n )\n .reduce(\n (acc, size) => {\n const [breakpoint, value] = size.split(\":\") as [Breakpoint, string];\n acc[BREAKPOINT_MAP[breakpoint]] = {\n width: `${value}px`,\n height: `${value}px`\n };\n return acc;\n },\n {} as Record<string, React.CSSProperties>\n );\n\n if (Object.keys(mediaQueries).length > 0) {\n (style as any)[\"@media\"] = mediaQueries;\n }\n\n return style;\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 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 Array.isArray(variants) ? `lg:text-${variant}` : `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 type { IconName } from \"@deckai/icons\";\nimport React, { HTMLAttributes } from \"react\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\n\nexport type ContactItemProps = {\n iconName: IconName;\n children: React.ReactNode;\n href: string;\n} & Omit<HTMLAttributes<HTMLAnchorElement>, \"color\">;\n\nexport const ContactItem = ({\n iconName,\n children,\n href,\n ...linkProps\n}: ContactItemProps) => (\n <div className=\"row gap-2 flex items-center\">\n <div className=\"bg-secondary-400 rounded-full p-2.5\">\n <Icon name={iconName} color=\"primaryBlue\" size={18} />\n </div>\n <Text\n className=\"hover:underline\"\n as=\"a\"\n href={href}\n {...linkProps}\n variant={[\"body-lg\", \"md:body-default-medium\"]}\n >\n {children}\n </Text>\n </div>\n);\n"]}
1
+ {"version":3,"sources":["../../src/components/IconRenderer.tsx","../../src/components/Text.tsx","../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Link.tsx","../../src/components/ContactItem.tsx"],"names":["IconRenderer","icon","size","className","sanitizedSvg","useMemo","svg","viewBox","React","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","color","as","children","weight","props","ref","typographyClasses","colorClasses","suggestedElement","baseVariant","cn","inputs","twMerge","clsx","focusRingStyles","Link","href","ContactItem","linkProps"],"mappings":"iNAQO,IAAMA,CAAAA,CAAe,CAAC,CAC3B,KAAAC,CACA,CAAA,IAAA,CAAAC,CAAO,CA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H,CACF,CCtBK,CAAA,IAAMe,EAAc,CAAC,CAC1B,KAAAnC,CACA,CAAA,QAAA,CAAAoB,CACA,CAAA,IAAA,CAAAc,CACA,CAAA,GAAGE,CACL,CACE7B,GAAAA,kBAAAA,CAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,6BAAA,CAAA,CACbA,mBAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,iEAAA,CAAA,CACbA,kBAAA,CAAA,aAAA,CAACR,EAAA,CAAa,IAAA,CAAMC,CAAM,CAAA,IAAA,CAAM,EAAI,CAAA,SAAA,CAAU,eAAe,CAC/D,CAAA,CACAO,kBAAA,CAAA,aAAA,CAAC0B,CAAA,CAAA,CACC,UAAU,iBACV,CAAA,IAAA,CAAMC,CACL,CAAA,GAAGE,CACJ,CAAA,OAAA,CAAS,CAAC,uBAAyB,CAAA,wBAAwB,CAE1DhB,CAAAA,CAAAA,CACH,CACF","file":"ContactItem.cjs","sourcesContent":["import React, { useMemo } from \"react\";\n\nexport type IconRendererProps = {\n icon: string;\n size?: number;\n className?: string;\n};\n\nexport const IconRenderer = ({\n icon,\n size = 40,\n className\n}: IconRendererProps) => {\n const sanitizedSvg = useMemo(() => {\n const parser = new DOMParser();\n const doc = parser.parseFromString(icon, \"image/svg+xml\");\n const svg = doc.querySelector(\"svg\");\n\n if (!svg) return null;\n\n // Set size attributes but preserve aspect ratio\n svg.setAttribute(\"width\", \"100%\");\n svg.setAttribute(\"height\", \"100%\");\n svg.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\n\n // Get the original viewBox or use the default\n const viewBox = svg.getAttribute(\"viewBox\") || \"0 0 40 40\";\n svg.setAttribute(\"viewBox\", viewBox);\n\n return svg.outerHTML;\n }, [icon]);\n\n if (!sanitizedSvg) return null;\n\n return (\n <div\n style={{\n width: size,\n height: size,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\"\n }}\n className={className}\n dangerouslySetInnerHTML={{ __html: sanitizedSvg }}\n />\n );\n};\n\nIconRenderer.displayName = \"IconRenderer\";\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 { 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 from \"react\";\nimport { Text, TextProps } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type LinkProps = {\n href: string;\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n} & Pick<TextProps, \"variant\" | \"color\"> &\n React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nexport const Link = ({\n children,\n color = \"text-primary\",\n variant = \"body-default-semibold\",\n href,\n className,\n ...props\n}: LinkProps) => (\n <Text variant={variant} color={color}>\n <a\n href={href}\n className={cn(\n \"hover:opacity-80 transition-all active:scale-95 hover:underline\",\n focusRingStyles,\n className\n )}\n {...props}\n >\n {children}\n </a>\n </Text>\n);\n","import React, { HTMLAttributes } from \"react\";\nimport { IconRenderer } from \"./IconRenderer\";\nimport { Link } from \"./Link\";\n\nexport type ContactItemProps = {\n // TODO: figure out how to get filled icons to work correctly\n icon: string;\n children: React.ReactNode;\n href: string;\n} & Omit<HTMLAttributes<HTMLAnchorElement>, \"color\">;\n\nexport const ContactItem = ({\n icon,\n children,\n href,\n ...linkProps\n}: ContactItemProps) => (\n <div className=\"row gap-2 flex items-center\">\n <div className=\"bg-secondary-400 rounded-full p-2.5 items-center justify-center\">\n <IconRenderer icon={icon} size={24} className=\"text-primary\" />\n </div>\n <Link\n className=\"hover:underline\"\n href={href}\n {...linkProps}\n variant={[\"body-default-semibold\", \"md:body-default-medium\"]}\n >\n {children}\n </Link>\n </div>\n);\n"]}
@@ -1,11 +1,10 @@
1
- import { IconName } from '@deckai/icons';
2
1
  import React__default, { HTMLAttributes } from 'react';
3
2
 
4
3
  type ContactItemProps = {
5
- iconName: IconName;
4
+ icon: string;
6
5
  children: React__default.ReactNode;
7
6
  href: string;
8
7
  } & Omit<HTMLAttributes<HTMLAnchorElement>, "color">;
9
- declare const ContactItem: ({ iconName, children, href, ...linkProps }: ContactItemProps) => React__default.JSX.Element;
8
+ declare const ContactItem: ({ icon, children, href, ...linkProps }: ContactItemProps) => React__default.JSX.Element;
10
9
 
11
10
  export { ContactItem, type ContactItemProps };
@@ -1,11 +1,10 @@
1
- import { IconName } from '@deckai/icons';
2
1
  import React__default, { HTMLAttributes } from 'react';
3
2
 
4
3
  type ContactItemProps = {
5
- iconName: IconName;
4
+ icon: string;
6
5
  children: React__default.ReactNode;
7
6
  href: string;
8
7
  } & Omit<HTMLAttributes<HTMLAnchorElement>, "color">;
9
- declare const ContactItem: ({ iconName, children, href, ...linkProps }: ContactItemProps) => React__default.JSX.Element;
8
+ declare const ContactItem: ({ icon, children, href, ...linkProps }: ContactItemProps) => React__default.JSX.Element;
10
9
 
11
10
  export { ContactItem, type ContactItemProps };
@@ -1,2 +1,2 @@
1
- import p from'react';import {IconMap}from'@deckai/icons';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function g(...e){return twMerge(clsx(e))}var h={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},x={sm:"@media (min-width: 640px)",md:"@media (min-width: 768px)",lg:"@media (min-width: 1024px)",xl:"@media (min-width: 1280px)","2xl":"@media (min-width: 1536px)"},b=e=>{if(!e)return {width:"24px",height:"24px"};let t=Array.isArray(e)?e:[e],r=typeof t[0]=="number"?t[0]:24,o={width:`${r}px`,height:`${r}px`},a=t.filter(n=>typeof n=="string"&&n.includes(":")).reduce((n,s)=>{let[l,i]=s.split(":");return n[x[l]]={width:`${i}px`,height:`${i}px`},n},{});return Object.keys(a).length>0&&(o["@media"]=a),o},d=p.forwardRef(({name:e,size:t=24,color:r="primary",title:o,className:a,style:n={},...s},l)=>{let i=IconMap[e],m=b(t);return p.createElement("div",{className:g("flex justify-center items-center",a),style:{...m,"--icon-stroke":h[r],...n}},p.createElement(i,{ref:l,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:h[r],...s}))});d.displayName="Icon";var E={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},C=e=>{let[t,r]=e.split("-");return t==="heading"?E[r]||"p":t==="label"?"label":"p"},R={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[o,a]=r.split(":");return `${o}:text-${a}`}return Array.isArray(e)?`lg:text-${r}`:`text-${r}`}).join(" "):"text-body-default",T=p.forwardRef(({variant:e="body-default",color:t="text-primary",as:r,className:o,children:a,weight:n,...s},l)=>{let i=A(e),m=t&&t==="inherit"?"inherit":t?`text-${t}`:"",u=p.useMemo(()=>{let H=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return C(H)},[e]);return p.createElement(r||u,{ref:l,className:`font-sans antialiased ${i} ${m} ${n?`!${R[n]}`:""} ${o??""}`,...s},a)});T.displayName="Text";var j=({iconName:e,children:t,href:r,...o})=>p.createElement("div",{className:"row gap-2 flex items-center"},p.createElement("div",{className:"bg-secondary-400 rounded-full p-2.5"},p.createElement(d,{name:e,color:"primaryBlue",size:18})),p.createElement(T,{className:"hover:underline",as:"a",href:r,...o,variant:["body-lg","md:body-default-medium"]},t));if (exports.default) module.exports = exports.default;export{j as ContactItem};//# sourceMappingURL=ContactItem.js.map
1
+ import i,{useMemo}from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var p=({icon:e,size:t=40,className:r})=>{let o=useMemo(()=>{let n=new DOMParser().parseFromString(e,"image/svg+xml").querySelector("svg");if(!n)return null;n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("preserveAspectRatio","xMidYMid meet");let l=n.getAttribute("viewBox")||"0 0 40 40";return n.setAttribute("viewBox",l),n.outerHTML},[e]);return o?i.createElement("div",{style:{width:t,height:t,display:"flex",alignItems:"center",justifyContent:"center"},className:r,dangerouslySetInnerHTML:{__html:o}}):null};p.displayName="IconRenderer";var L={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},x=e=>{let[t,r]=e.split("-");return t==="heading"?L[r]||"p":t==="label"?"label":"p"},E={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[o,s]=r.split(":");return `${o}:text-${s}`}return `text-${r}`}).join(" "):"text-body-default",m=i.forwardRef(({variant:e="body-default",color:t="text-primary",as:r,className:o,children:s,weight:a,...n},l)=>{let h=A(e),u=t&&t==="inherit"?"inherit":t?`text-${t}`:"",f=i.useMemo(()=>{let b=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return x(b)},[e]);return i.createElement(r||f,{ref:l,className:`font-sans antialiased ${h} ${u} ${a?`!${E[a]}`:""} ${o??""}`,...n},s)});m.displayName="Text";function y(...e){return twMerge(clsx(e))}var T="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var g=({children:e,color:t="text-primary",variant:r="body-default-semibold",href:o,className:s,...a})=>i.createElement(m,{variant:r,color:t},i.createElement("a",{href:o,className:y("hover:opacity-80 transition-all active:scale-95 hover:underline",T,s),...a},e));var Q=({icon:e,children:t,href:r,...o})=>i.createElement("div",{className:"row gap-2 flex items-center"},i.createElement("div",{className:"bg-secondary-400 rounded-full p-2.5 items-center justify-center"},i.createElement(p,{icon:e,size:24,className:"text-primary"})),i.createElement(g,{className:"hover:underline",href:r,...o,variant:["body-default-semibold","md:body-default-medium"]},t));if (exports.default) module.exports = exports.default;export{Q as ContactItem};//# sourceMappingURL=ContactItem.js.map
2
2
  //# sourceMappingURL=ContactItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/ContactItem.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","baseSize","style","mediaQueries","size","acc","breakpoint","value","Icon","React","name","color","title","className","props","ref","IconComponent","IconMap","sizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","ContactItem","iconName","href","linkProps"],"mappings":"sHAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCWA,IAAMG,CAAAA,CAAwC,CAC5C,OAAA,CAAS,SACT,CAAA,SAAA,CAAW,SACX,CAAA,KAAA,CAAO,SACP,CAAA,WAAA,CAAa,SACf,CAAA,CAKMC,CAA6C,CAAA,CACjD,EAAI,CAAA,2BAAA,CACJ,EAAI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U,CAAA,KAAA,CAAM,aAAc,CAAA,IAAA,CAAM,EAAI,CAAA,CACtD,CACA3B,CAAAA,CAAAA,CAAA,aAACkB,CAAAA,CAAAA,CAAA,CACC,SAAA,CAAU,iBACV,CAAA,EAAA,CAAG,GACH,CAAA,IAAA,CAAMU,CACL,CAAA,GAAGC,CACJ,CAAA,OAAA,CAAS,CAAC,SAAA,CAAW,wBAAwB,CAAA,CAAA,CAE5CT,CACH,CACF","file":"ContactItem.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\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: number | `${Breakpoint}:${number}`;\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\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"@media (min-width: 640px)\",\n md: \"@media (min-width: 768px)\",\n lg: \"@media (min-width: 1024px)\",\n xl: \"@media (min-width: 1280px)\",\n \"2xl\": \"@media (min-width: 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 baseSize = typeof sizeArray[0] === \"number\" ? sizeArray[0] : 24;\n\n const style: React.CSSProperties = {\n width: `${baseSize}px`,\n height: `${baseSize}px`\n };\n\n // Add media queries for responsive sizes\n const mediaQueries = sizeArray\n .filter(\n (size): size is `${Breakpoint}:${number}` =>\n typeof size === \"string\" && size.includes(\":\")\n )\n .reduce(\n (acc, size) => {\n const [breakpoint, value] = size.split(\":\") as [Breakpoint, string];\n acc[BREAKPOINT_MAP[breakpoint]] = {\n width: `${value}px`,\n height: `${value}px`\n };\n return acc;\n },\n {} as Record<string, React.CSSProperties>\n );\n\n if (Object.keys(mediaQueries).length > 0) {\n (style as any)[\"@media\"] = mediaQueries;\n }\n\n return style;\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 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 Array.isArray(variants) ? `lg:text-${variant}` : `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 type { IconName } from \"@deckai/icons\";\nimport React, { HTMLAttributes } from \"react\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\n\nexport type ContactItemProps = {\n iconName: IconName;\n children: React.ReactNode;\n href: string;\n} & Omit<HTMLAttributes<HTMLAnchorElement>, \"color\">;\n\nexport const ContactItem = ({\n iconName,\n children,\n href,\n ...linkProps\n}: ContactItemProps) => (\n <div className=\"row gap-2 flex items-center\">\n <div className=\"bg-secondary-400 rounded-full p-2.5\">\n <Icon name={iconName} color=\"primaryBlue\" size={18} />\n </div>\n <Text\n className=\"hover:underline\"\n as=\"a\"\n href={href}\n {...linkProps}\n variant={[\"body-lg\", \"md:body-default-medium\"]}\n >\n {children}\n </Text>\n </div>\n);\n"]}
1
+ {"version":3,"sources":["../../src/components/IconRenderer.tsx","../../src/components/Text.tsx","../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Link.tsx","../../src/components/ContactItem.tsx"],"names":["IconRenderer","icon","size","className","sanitizedSvg","useMemo","svg","viewBox","React","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","color","as","children","weight","props","ref","typographyClasses","colorClasses","suggestedElement","baseVariant","cn","inputs","twMerge","clsx","focusRingStyles","Link","href","ContactItem","linkProps"],"mappings":"2FAQO,IAAMA,CAAAA,CAAe,CAAC,CAC3B,KAAAC,CACA,CAAA,IAAA,CAAAC,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H,CACF,CCtBK,CAAA,IAAMe,EAAc,CAAC,CAC1B,KAAAnC,CACA,CAAA,QAAA,CAAAoB,CACA,CAAA,IAAA,CAAAc,CACA,CAAA,GAAGE,CACL,CACE7B,GAAAA,CAAAA,CAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,6BAAA,CAAA,CACbA,EAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,iEAAA,CAAA,CACbA,CAAA,CAAA,aAAA,CAACR,EAAA,CAAa,IAAA,CAAMC,CAAM,CAAA,IAAA,CAAM,EAAI,CAAA,SAAA,CAAU,eAAe,CAC/D,CAAA,CACAO,CAAA,CAAA,aAAA,CAAC0B,CAAA,CAAA,CACC,UAAU,iBACV,CAAA,IAAA,CAAMC,CACL,CAAA,GAAGE,CACJ,CAAA,OAAA,CAAS,CAAC,uBAAyB,CAAA,wBAAwB,CAE1DhB,CAAAA,CAAAA,CACH,CACF","file":"ContactItem.js","sourcesContent":["import React, { useMemo } from \"react\";\n\nexport type IconRendererProps = {\n icon: string;\n size?: number;\n className?: string;\n};\n\nexport const IconRenderer = ({\n icon,\n size = 40,\n className\n}: IconRendererProps) => {\n const sanitizedSvg = useMemo(() => {\n const parser = new DOMParser();\n const doc = parser.parseFromString(icon, \"image/svg+xml\");\n const svg = doc.querySelector(\"svg\");\n\n if (!svg) return null;\n\n // Set size attributes but preserve aspect ratio\n svg.setAttribute(\"width\", \"100%\");\n svg.setAttribute(\"height\", \"100%\");\n svg.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\n\n // Get the original viewBox or use the default\n const viewBox = svg.getAttribute(\"viewBox\") || \"0 0 40 40\";\n svg.setAttribute(\"viewBox\", viewBox);\n\n return svg.outerHTML;\n }, [icon]);\n\n if (!sanitizedSvg) return null;\n\n return (\n <div\n style={{\n width: size,\n height: size,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\"\n }}\n className={className}\n dangerouslySetInnerHTML={{ __html: sanitizedSvg }}\n />\n );\n};\n\nIconRenderer.displayName = \"IconRenderer\";\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 { 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 from \"react\";\nimport { Text, TextProps } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type LinkProps = {\n href: string;\n children: React.ReactNode;\n className?: string;\n style?: React.CSSProperties;\n} & Pick<TextProps, \"variant\" | \"color\"> &\n React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nexport const Link = ({\n children,\n color = \"text-primary\",\n variant = \"body-default-semibold\",\n href,\n className,\n ...props\n}: LinkProps) => (\n <Text variant={variant} color={color}>\n <a\n href={href}\n className={cn(\n \"hover:opacity-80 transition-all active:scale-95 hover:underline\",\n focusRingStyles,\n className\n )}\n {...props}\n >\n {children}\n </a>\n </Text>\n);\n","import React, { HTMLAttributes } from \"react\";\nimport { IconRenderer } from \"./IconRenderer\";\nimport { Link } from \"./Link\";\n\nexport type ContactItemProps = {\n // TODO: figure out how to get filled icons to work correctly\n icon: string;\n children: React.ReactNode;\n href: string;\n} & Omit<HTMLAttributes<HTMLAnchorElement>, \"color\">;\n\nexport const ContactItem = ({\n icon,\n children,\n href,\n ...linkProps\n}: ContactItemProps) => (\n <div className=\"row gap-2 flex items-center\">\n <div className=\"bg-secondary-400 rounded-full p-2.5 items-center justify-center\">\n <IconRenderer icon={icon} size={24} className=\"text-primary\" />\n </div>\n <Link\n className=\"hover:underline\"\n href={href}\n {...linkProps}\n variant={[\"body-default-semibold\", \"md:body-default-medium\"]}\n >\n {children}\n </Link>\n </div>\n);\n"]}
@@ -0,0 +1,10 @@
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(`
2
+ sm:px-7 px-4
3
+ py-2
4
+ inline-flex items-center justify-center
5
+ rounded-lg
6
+ transition-colors duration-200
7
+ disabled:opacity-50 disabled:pointer-events-none
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
10
+ //# sourceMappingURL=EditButton.cjs.map
@@ -0,0 +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,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CA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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"]}
@@ -0,0 +1,12 @@
1
+ import React__default from 'react';
2
+
3
+ type EditButtonProps = {
4
+ className?: string;
5
+ onClick?: () => void;
6
+ };
7
+ declare const EditButton: {
8
+ ({ className, onClick }: EditButtonProps): React__default.JSX.Element;
9
+ displayName: string;
10
+ };
11
+
12
+ export { EditButton, type EditButtonProps };