@deckai/deck-ui 0.0.15 → 0.0.16

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 (79) hide show
  1. package/README.md +12 -2
  2. package/dist/components/AboutCard.cjs +9 -1
  3. package/dist/components/AboutCard.cjs.map +1 -1
  4. package/dist/components/AboutCard.js +9 -1
  5. package/dist/components/AboutCard.js.map +1 -1
  6. package/dist/components/AddWorkCard.cjs +2 -2
  7. package/dist/components/AddWorkCard.cjs.map +1 -1
  8. package/dist/components/AddWorkCard.js +2 -2
  9. package/dist/components/AddWorkCard.js.map +1 -1
  10. package/dist/components/Breadcrumbs.cjs +1 -1
  11. package/dist/components/Breadcrumbs.cjs.map +1 -1
  12. package/dist/components/Breadcrumbs.d.cts +1 -0
  13. package/dist/components/Breadcrumbs.d.ts +1 -0
  14. package/dist/components/Breadcrumbs.js +1 -1
  15. package/dist/components/Breadcrumbs.js.map +1 -1
  16. package/dist/components/Button.cjs +2 -2
  17. package/dist/components/Button.cjs.map +1 -1
  18. package/dist/components/Button.js +2 -2
  19. package/dist/components/Button.js.map +1 -1
  20. package/dist/components/Carousel.cjs +1 -1
  21. package/dist/components/Carousel.cjs.map +1 -1
  22. package/dist/components/Carousel.d.cts +3 -1
  23. package/dist/components/Carousel.d.ts +3 -1
  24. package/dist/components/Carousel.js +1 -1
  25. package/dist/components/Carousel.js.map +1 -1
  26. package/dist/components/Collapsible.cjs +9 -1
  27. package/dist/components/Collapsible.cjs.map +1 -1
  28. package/dist/components/Collapsible.js +9 -1
  29. package/dist/components/Collapsible.js.map +1 -1
  30. package/dist/components/Combobox.cjs +1 -1
  31. package/dist/components/Combobox.cjs.map +1 -1
  32. package/dist/components/Combobox.js +1 -1
  33. package/dist/components/Combobox.js.map +1 -1
  34. package/dist/components/EditButton.cjs +2 -2
  35. package/dist/components/EditButton.cjs.map +1 -1
  36. package/dist/components/EditButton.js +2 -2
  37. package/dist/components/EditButton.js.map +1 -1
  38. package/dist/components/MultiSelectCombobox.cjs +1 -1
  39. package/dist/components/MultiSelectCombobox.cjs.map +1 -1
  40. package/dist/components/MultiSelectCombobox.js +1 -1
  41. package/dist/components/MultiSelectCombobox.js.map +1 -1
  42. package/dist/components/Navbar.cjs +1 -1
  43. package/dist/components/Navbar.cjs.map +1 -1
  44. package/dist/components/Navbar.js +1 -1
  45. package/dist/components/Navbar.js.map +1 -1
  46. package/dist/components/ProfileCard.cjs +1 -1
  47. package/dist/components/ProfileCard.cjs.map +1 -1
  48. package/dist/components/ProfileCard.js +1 -1
  49. package/dist/components/ProfileCard.js.map +1 -1
  50. package/dist/components/SegmentedTabs.cjs +2 -2
  51. package/dist/components/SegmentedTabs.cjs.map +1 -1
  52. package/dist/components/SegmentedTabs.js +2 -2
  53. package/dist/components/SegmentedTabs.js.map +1 -1
  54. package/dist/components/SocialCard.cjs +1 -1
  55. package/dist/components/SocialCard.cjs.map +1 -1
  56. package/dist/components/SocialCard.js +1 -1
  57. package/dist/components/SocialCard.js.map +1 -1
  58. package/dist/components/Tabs.cjs +2 -2
  59. package/dist/components/Tabs.cjs.map +1 -1
  60. package/dist/components/Tabs.js +2 -2
  61. package/dist/components/Tabs.js.map +1 -1
  62. package/dist/components/Toast.cjs +2 -2
  63. package/dist/components/Toast.cjs.map +1 -1
  64. package/dist/components/Toast.js +2 -2
  65. package/dist/components/Toast.js.map +1 -1
  66. package/dist/components/Tooltip.cjs +1 -1
  67. package/dist/components/Tooltip.cjs.map +1 -1
  68. package/dist/components/Tooltip.d.cts +3 -1
  69. package/dist/components/Tooltip.d.ts +3 -1
  70. package/dist/components/Tooltip.js +1 -1
  71. package/dist/components/Tooltip.js.map +1 -1
  72. package/dist/index.cjs +5 -5
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.cts +4 -1
  75. package/dist/index.d.ts +4 -1
  76. package/dist/index.js +5 -5
  77. package/dist/index.js.map +1 -1
  78. package/dist/styles/styles.css +1 -1
  79. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Pressable.tsx","../../src/utils/tailwind.ts","../../src/components/Carousel.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","focusRingStyles","Pressable","children","type","disabled","Carousel","gap","scrollContainerRef","useRef","showLeftPaddle","setShowLeftPaddle","useState","showRightPaddle","setShowRightPaddle","isHoveringStart","setIsHoveringStart","isHoveringEnd","setIsHoveringEnd","checkScrollPosition","useCallback","container","scrollLeft","scrollWidth","clientWidth","handleMouseMove","rect","mouseX","HOVER_THRESHOLD","useEffect","observer","scroll","direction","scrollAmount","targetScroll","handleKeyDown","handleWheel","isHorizontalScroll","child"],"mappings":"2MAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,QAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAwC,CAAA,CAC5C,QAAS,SACT,CAAA,SAAA,CAAW,UACX,KAAO,CAAA,SAAA,CACP,YAAa,SACb,CAAA,QAAA,CAAU,SACZ,CAEMC,CAAAA,CAAAA,CAA6C,CACjD,EAAI,CAAA,OAAA,CACJ,GAAI,OACJ,CAAA,EAAA,CAAI,SACJ,EAAI,CAAA,QAAA,CACJ,MAAO,QACT,CAAA,CAEMC,EACJC,CACwB,EAAA,CACxB,GAAI,CAACA,CAAAA,CAAO,OAAO,CAAE,KAAA,CAAO,OAAQ,MAAQ,CAAA,MAAO,EAEnD,IAAMC,CAAAA,CAAY,MAAM,OAAQD,CAAAA,CAAK,EAAIA,CAAQ,CAAA,CAACA,CAAK,CACjDE,CAAAA,CAAAA,CAAuC,EACzCC,CAAAA,CAAAA,CAGJ,OAAAF,CAAAA,CAAU,QAASG,CAAS,EAAA,CAC1B,GAAI,OAA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AA,CAAAA,CAAA,CAAK,IAAK,CAAA,aAAA,CAAc,KAAM,EAAI,CAAA,KAAA,CAAM,QAAQ,CACnD,CACF,CAEJ,CAEJ","file":"Carousel.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import { 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, { useCallback, useEffect, useRef, useState } from \"react\";\nimport * as ScrollArea from \"@radix-ui/react-scroll-area\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type CarouselProps = {\n children: React.ReactNode;\n /** Optional className for the root element */\n className?: string;\n /** Optional gap between items in pixels */\n gap?: number;\n};\n\nexport const Carousel = ({\n children,\n className = \"\",\n gap = 20\n}: CarouselProps) => {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const [showLeftPaddle, setShowLeftPaddle] = useState(false);\n const [showRightPaddle, setShowRightPaddle] = useState(false);\n const [isHoveringStart, setIsHoveringStart] = useState(false);\n const [isHoveringEnd, setIsHoveringEnd] = useState(false);\n\n const checkScrollPosition = useCallback(() => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const { scrollLeft, scrollWidth, clientWidth } = container;\n setShowLeftPaddle(scrollLeft > 0);\n setShowRightPaddle(Math.ceil(scrollLeft + clientWidth) < scrollWidth);\n }, []);\n\n const handleMouseMove = useCallback((e: React.MouseEvent) => {\n const container = e.currentTarget;\n const rect = container.getBoundingClientRect();\n const mouseX = e.clientX - rect.left;\n const HOVER_THRESHOLD = 300; // Increased threshold for better detection\n\n setIsHoveringStart(mouseX < HOVER_THRESHOLD);\n setIsHoveringEnd(mouseX > rect.width - HOVER_THRESHOLD);\n }, []);\n\n useEffect(() => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const observer = new ResizeObserver(checkScrollPosition);\n observer.observe(container);\n\n container.addEventListener(\"scroll\", checkScrollPosition);\n return () => {\n observer.disconnect();\n container.removeEventListener(\"scroll\", checkScrollPosition);\n };\n }, [checkScrollPosition]);\n\n const scroll = useCallback((direction: \"left\" | \"right\") => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const scrollAmount = container.clientWidth * 0.8;\n const targetScroll =\n container.scrollLeft +\n (direction === \"left\" ? -scrollAmount : scrollAmount);\n\n container.scrollTo({\n left: targetScroll,\n behavior: \"smooth\"\n });\n }, []);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"ArrowLeft\") {\n scroll(\"left\");\n } else if (e.key === \"ArrowRight\") {\n scroll(\"right\");\n }\n },\n [scroll]\n );\n\n const handleWheel = useCallback((e: WheelEvent) => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n // Check if the scroll is predominantly horizontal\n const isHorizontalScroll = Math.abs(e.deltaX) > Math.abs(e.deltaY);\n\n // Only handle horizontal scrolls or shift+scroll\n if (!isHorizontalScroll && !e.shiftKey) {\n return;\n }\n\n // Prevent default only for horizontal scrolls\n e.preventDefault();\n\n // Adjust these multipliers to control scroll sensitivity\n const SCROLL_MULTIPLIER = 0.5;\n const TRACKPAD_MULTIPLIER = 1.2;\n\n // Calculate scroll amount based on input type\n const scrollAmount = isHorizontalScroll\n ? e.deltaX * SCROLL_MULTIPLIER\n : e.deltaY * TRACKPAD_MULTIPLIER;\n\n // Apply smooth scrolling with the calculated amount\n container.scrollBy({\n left: scrollAmount,\n behavior: \"smooth\"\n });\n }, []);\n\n useEffect(() => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n container.addEventListener(\"wheel\", handleWheel, { passive: false });\n return () => {\n container.removeEventListener(\"wheel\", handleWheel);\n };\n }, [handleWheel]);\n\n return (\n <div\n className={`relative group ${className}`}\n onKeyDown={handleKeyDown}\n onMouseMove={handleMouseMove}\n onMouseLeave={() => {\n setIsHoveringStart(false);\n setIsHoveringEnd(false);\n }}\n role=\"region\"\n aria-label=\"Carousel\"\n >\n <ScrollArea.Root className=\"overflow-hidden\" type=\"hover\">\n <ScrollArea.Viewport\n ref={scrollContainerRef}\n className=\"w-full overflow-x-auto snap-x snap-mandatory\"\n style={{\n scrollbarWidth: \"none\",\n msOverflowStyle: \"none\",\n WebkitOverflowScrolling: \"touch\"\n }}\n >\n <div className=\"inline-flex\" style={{ gap: `${gap}px` }}>\n {React.Children.map(children, (child) => (\n <div className=\"snap-start\">{child}</div>\n ))}\n </div>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n\n {/* Left Paddle */}\n {showLeftPaddle && isHoveringStart && (\n <Pressable\n onClick={() => scroll(\"left\")}\n className=\"absolute left-4 top-1/2 -translate-y-1/2 z-20 transition-opacity duration-200\"\n aria-label=\"Scroll left\"\n >\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-overlay backdrop-blur-sm\">\n <Icon name=\"arrow-left\" size={24} color=\"white\" />\n </div>\n </Pressable>\n )}\n\n {/* Right Paddle */}\n {showRightPaddle && isHoveringEnd && (\n <Pressable\n onClick={() => scroll(\"right\")}\n className=\"absolute right-4 top-1/2 -translate-y-1/2 z-20 transition-opacity duration-200\"\n aria-label=\"Scroll right\"\n >\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-overlay backdrop-blur-sm\">\n <Icon name=\"arrow-right\" size={24} color=\"white\" />\n </div>\n </Pressable>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/utils/tailwind.ts","../../src/components/Pressable.tsx","../../src/hooks/useMediaQuery.ts","../../src/components/Carousel.tsx"],"names":["cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","focusRingStyles","Pressable","children","type","disabled","useIsomorphicLayoutEffect","useEffect","useMediaQuery","matches","setMatches","useState","getMatches","useCallback","mediaQuery","handleChange","Carousel","gap","showDots","scrollContainerRef","useRef","showLeftPaddle","setShowLeftPaddle","showRightPaddle","setShowRightPaddle","isHoveringStart","setIsHoveringStart","isHoveringEnd","setIsHoveringEnd","activeIndex","setActiveIndex","touchStart","setTouchStart","touchEnd","setTouchEnd","isMobile","totalSlides","checkScrollPosition","container","scrollLeft","scrollWidth","clientWidth","slideElements","maxVisibleArea","mostVisibleIndex","slide","index","rect","containerRect","visibleLeft","visibleRight","visibleArea","handleMouseMove","mouseX","HOVER_THRESHOLD","handleTouchStart","handleTouchMove","handleTouchEnd","distance","itemWidth","direction","targetScroll","handleWheel","isHorizontalScroll","scrollAmount","observer","scroll","handleKeyDown","goToSlide","child","_"],"mappings":"2MAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCcA,IAAMG,CAAAA,CAAwC,CAC5C,OAAA,CAA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U,qFACZ,CAAA,CAAA,KAAA,CAAM,KAAK,CAAE,MAAA,CAAQ8C,CAAY,CAAC,CAAE,CAAA,GAAA,CAAI,CAACkC,CAAAA,CAAGxB,IAC3CxD,CAAA,CAAA,aAAA,CAAC,QACC,CAAA,CAAA,GAAA,CAAKwD,CACL,CAAA,OAAA,CAAS,IAAMsB,CAAAA,CAAUtB,CAAK,CAC9B,CAAA,SAAA,CAAW,CACTA,oCAAAA,EAAAA,CAAAA,GAAUjB,CACN,CAAA,oBAAA,CACA,+BACN,CAAA,CAAA,CACA,aAAY,CAAeiB,YAAAA,EAAAA,CAAAA,CAAQ,CAAC,CAAA,IAAA,EAAOV,CAAW,CAAA,CAAA,CACxD,CACD,CACH,CAEJ,CAEJ","file":"Carousel.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","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, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import { useCallback, useEffect, useState } from \"react\";\n\nconst useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useEffect : () => {};\n\nexport const useMediaQuery = (query: string): boolean => {\n // Initialize with null to prevent hydration mismatch\n const [matches, setMatches] = useState<boolean | null>(null);\n\n const getMatches = useCallback((query: string): boolean => {\n if (typeof window !== \"undefined\") {\n return window.matchMedia(query).matches;\n }\n return false;\n }, []);\n\n // Update matches after mount to prevent hydration mismatch\n useIsomorphicLayoutEffect(() => {\n setMatches(getMatches(query));\n }, [query, getMatches]);\n\n useEffect(() => {\n if (typeof window !== \"undefined\") {\n const mediaQuery = window.matchMedia(query);\n\n const handleChange = () => {\n setMatches(getMatches(query));\n };\n\n mediaQuery.addEventListener(\"change\", handleChange);\n\n return () => {\n mediaQuery.removeEventListener(\"change\", handleChange);\n };\n }\n }, [query, getMatches]);\n\n // Return false during SSR, actual value after hydration\n return matches ?? false;\n};\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport * as ScrollArea from \"@radix-ui/react-scroll-area\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\nimport { useMediaQuery } from \"../hooks/useMediaQuery\";\n\nexport type CarouselProps = {\n children: React.ReactNode;\n /** Optional className for the root element */\n className?: string;\n /** Optional gap between items in pixels */\n gap?: number;\n /** Show navigation dots on mobile */\n showDots?: boolean;\n};\n\nexport const Carousel = ({\n children,\n className = \"\",\n gap = 20,\n showDots = true\n}: CarouselProps) => {\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n const [showLeftPaddle, setShowLeftPaddle] = useState(false);\n const [showRightPaddle, setShowRightPaddle] = useState(false);\n const [isHoveringStart, setIsHoveringStart] = useState(false);\n const [isHoveringEnd, setIsHoveringEnd] = useState(false);\n const [activeIndex, setActiveIndex] = useState(0);\n const [touchStart, setTouchStart] = useState<number | null>(null);\n const [touchEnd, setTouchEnd] = useState<number | null>(null);\n const isMobile = useMediaQuery(\"(max-width: 768px)\");\n\n const childrenArray = React.Children.toArray(children);\n const totalSlides = childrenArray.length;\n\n const checkScrollPosition = useCallback(() => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const { scrollLeft, scrollWidth, clientWidth } = container;\n setShowLeftPaddle(scrollLeft > 0);\n setShowRightPaddle(Math.ceil(scrollLeft + clientWidth) < scrollWidth);\n\n // Find the most visible slide\n const slideElements = container.querySelectorAll(\".snap-start\");\n let maxVisibleArea = 0;\n let mostVisibleIndex = 0;\n\n slideElements.forEach((slide, index) => {\n const rect = slide.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n // Calculate how much of the slide is visible\n const visibleLeft = Math.max(rect.left, containerRect.left);\n const visibleRight = Math.min(rect.right, containerRect.right);\n const visibleArea = Math.max(0, visibleRight - visibleLeft);\n\n if (visibleArea > maxVisibleArea) {\n maxVisibleArea = visibleArea;\n mostVisibleIndex = index;\n }\n });\n\n setActiveIndex(mostVisibleIndex);\n }, []);\n\n const handleMouseMove = useCallback(\n (e: React.MouseEvent) => {\n if (isMobile) return;\n\n const container = e.currentTarget;\n const rect = container.getBoundingClientRect();\n const mouseX = e.clientX - rect.left;\n const HOVER_THRESHOLD = 300;\n\n setIsHoveringStart(mouseX < HOVER_THRESHOLD);\n setIsHoveringEnd(mouseX > rect.width - HOVER_THRESHOLD);\n },\n [isMobile]\n );\n\n // Touch handling\n const handleTouchStart = useCallback((e: React.TouchEvent) => {\n setTouchStart(e.touches[0].clientX);\n setTouchEnd(null);\n }, []);\n\n const handleTouchMove = useCallback((e: React.TouchEvent) => {\n setTouchEnd(e.touches[0].clientX);\n }, []);\n\n const handleTouchEnd = useCallback(() => {\n if (!touchStart || !touchEnd) return;\n\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const distance = touchStart - touchEnd;\n const minSwipeDistance = 50;\n\n if (Math.abs(distance) < minSwipeDistance) {\n return;\n }\n\n const itemWidth = container.clientWidth;\n const direction = distance > 0 ? 1 : -1;\n const targetScroll = container.scrollLeft + itemWidth * direction;\n\n container.scrollTo({\n left: targetScroll,\n behavior: \"smooth\"\n });\n }, [touchStart, touchEnd]);\n\n const handleWheel = useCallback((e: WheelEvent) => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n // Check if the scroll is predominantly horizontal or if shift key is pressed\n const isHorizontalScroll = Math.abs(e.deltaX) > Math.abs(e.deltaY);\n if (!isHorizontalScroll && !e.shiftKey) return;\n\n e.preventDefault();\n\n // Determine the scroll amount based on the input type\n const scrollAmount = isHorizontalScroll ? e.deltaX : e.deltaY;\n\n // Apply smooth scrolling\n container.scrollBy({\n left: scrollAmount,\n behavior: \"smooth\"\n });\n }, []);\n\n useEffect(() => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const observer = new ResizeObserver(checkScrollPosition);\n observer.observe(container);\n\n container.addEventListener(\"scroll\", checkScrollPosition);\n container.addEventListener(\"wheel\", handleWheel, { passive: false });\n\n return () => {\n observer.disconnect();\n container.removeEventListener(\"scroll\", checkScrollPosition);\n container.removeEventListener(\"wheel\", handleWheel);\n };\n }, [checkScrollPosition, handleWheel]);\n\n const scroll = useCallback((direction: \"left\" | \"right\") => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const scrollAmount = container.clientWidth;\n const targetScroll =\n container.scrollLeft +\n (direction === \"left\" ? -scrollAmount : scrollAmount);\n\n container.scrollTo({\n left: targetScroll,\n behavior: \"smooth\"\n });\n }, []);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"ArrowLeft\") {\n scroll(\"left\");\n } else if (e.key === \"ArrowRight\") {\n scroll(\"right\");\n }\n },\n [scroll]\n );\n\n const goToSlide = useCallback((index: number) => {\n const container = scrollContainerRef.current;\n if (!container) return;\n\n const { clientWidth } = container;\n const targetScroll = clientWidth * index;\n\n container.scrollTo({\n left: targetScroll,\n behavior: \"smooth\"\n });\n }, []);\n\n return (\n <div\n className={`relative group ${className}`}\n onKeyDown={handleKeyDown}\n onMouseMove={handleMouseMove}\n onMouseLeave={() => {\n setIsHoveringStart(false);\n setIsHoveringEnd(false);\n }}\n onTouchStart={handleTouchStart}\n onTouchMove={handleTouchMove}\n onTouchEnd={handleTouchEnd}\n role=\"region\"\n aria-label=\"Carousel\"\n >\n <ScrollArea.Root className=\"overflow-hidden\" type=\"hover\">\n <ScrollArea.Viewport\n ref={scrollContainerRef}\n className=\"w-full overflow-x-auto snap-x snap-mandatory\"\n style={{\n scrollbarWidth: \"none\",\n msOverflowStyle: \"none\",\n WebkitOverflowScrolling: \"touch\"\n }}\n >\n <div\n className=\"inline-flex\"\n style={{\n gap: `${gap}px`\n }}\n >\n {React.Children.map(children, (child) => (\n <div className=\"snap-start shrink-0\">{child}</div>\n ))}\n </div>\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n\n {/* Navigation Paddles - Only show on desktop */}\n {!isMobile && (\n <>\n {showLeftPaddle && isHoveringStart && (\n <Pressable\n onClick={() => scroll(\"left\")}\n className=\"absolute left-4 top-1/2 -translate-y-1/2 z-20 transition-opacity duration-200\"\n aria-label=\"Scroll left\"\n >\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-overlay backdrop-blur-sm\">\n <Icon name=\"arrow-left\" size={24} color=\"white\" />\n </div>\n </Pressable>\n )}\n\n {showRightPaddle && isHoveringEnd && (\n <Pressable\n onClick={() => scroll(\"right\")}\n className=\"absolute right-4 top-1/2 -translate-y-1/2 z-20 transition-opacity duration-200\"\n aria-label=\"Scroll right\"\n >\n <div className=\"flex items-center justify-center w-10 h-10 rounded-full bg-overlay backdrop-blur-sm\">\n <Icon name=\"arrow-right\" size={24} color=\"white\" />\n </div>\n </Pressable>\n )}\n </>\n )}\n\n {/* Navigation Dots - Only show on mobile */}\n {isMobile && showDots && totalSlides > 1 && (\n <div className=\"absolute -bottom-2 left-1/2 -translate-x-1/2 flex gap-2 bg-overlay rounded-full p-2\">\n {Array.from({ length: totalSlides }).map((_, index) => (\n <button\n key={index}\n onClick={() => goToSlide(index)}\n className={`w-2 h-2 rounded-full transition-all ${\n index === activeIndex\n ? \"bg-white scale-125\"\n : \"bg-white/50 hover:bg-white/75\"\n }`}\n aria-label={`Go to slide ${index + 1} of ${totalSlides}`}\n />\n ))}\n </div>\n )}\n </div>\n );\n};\n"]}
@@ -1,2 +1,10 @@
1
- 'use strict';var s=require('react'),p=require('@radix-ui/react-collapsible'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var s__default=/*#__PURE__*/_interopDefault(s);var p__namespace=/*#__PURE__*/_interopNamespace(p);var b="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";function i(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var y=s__default.default.forwardRef(({children:e,type:r="button",className:t,disabled:n,...o},a)=>s__default.default.createElement("button",{ref:a,type:r,disabled:n,className:i("appearance-none hover:opacity-80 transition-all active:scale-95",b,n&&"opacity-50 cursor-not-allowed",t),...o},e));y.displayName="Pressable";var L={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},E=e=>{let[r,t]=e.split("-");return r==="heading"?L[t]||"p":r==="label"?"label":"p"},x={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,o]=t.split(":");return `${n}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",h=s__default.default.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:n,children:o,weight:a,...c},m)=>{let l=R(e),T=r==="inherit"?"text-inherit":`text-text-${r}`,g=s__default.default.useMemo(()=>{let f=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return E(f)},[e]);return s__default.default.createElement(t||g,{ref:m,className:`font-sans antialiased ${l} ${T} ${a?`!${x[a]}`:""} ${n??""}`,...c},o)});h.displayName="Text";var v=({children:e,maxHeight:r=100})=>{let[t,n]=s__default.default.useState(!1),o=s.useRef(null),[a,c]=s.useState(r);s.useLayoutEffect(()=>{if(!o.current)return;let l=new ResizeObserver(T=>{for(let g of T)c(g.target.scrollHeight);});return l.observe(o.current),()=>l.disconnect()},[]);let m=a>r;return s__default.default.createElement(p__namespace.Root,{open:t,onOpenChange:n},s__default.default.createElement("div",{className:"relative"},s__default.default.createElement("div",{className:"overflow-hidden transition-[height] duration-300 ease-in-out",style:{height:t?`${a}px`:`${r}px`}},s__default.default.createElement("div",{ref:o,className:"w-full"},e)),m&&s__default.default.createElement(p__namespace.Trigger,{asChild:!0},s__default.default.createElement(y,{className:i("absolute -bottom-8 left-0 right-0","flex items-end justify-center","h-16 pt-8 pb-2",!t&&"bg-gradient-to-b from-transparent via-white to-white","hover:opacity-100 transition-opacity")},s__default.default.createElement(h,{variant:"label-default",color:"secondary"},t?"See less":"See more")))))};v.displayName="Collapsible";exports.Collapsible=v;//# sourceMappingURL=Collapsible.cjs.map
1
+ 'use strict';var a=require('react'),T=require('@radix-ui/react-collapsible'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),m=require('@radix-ui/react-toast'),icons=require('@deckai/icons');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var a__namespace=/*#__PURE__*/_interopNamespace(a);var T__namespace=/*#__PURE__*/_interopNamespace(T);var m__namespace=/*#__PURE__*/_interopNamespace(m);var b="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var x=a__namespace.default.forwardRef(({children:e,type:r="button",className:t,disabled:s,...o},n)=>a__namespace.default.createElement("button",{ref:n,type:r,disabled:s,className:c("appearance-none hover:opacity-80 transition-all active:scale-95",b,s&&"opacity-50 cursor-not-allowed",t),...o},e));x.displayName="Pressable";var k={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},S=e=>{let[r,t]=e.split("-");return r==="heading"?k[t]||"p":r==="label"?"label":"p"},B={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},O=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[s,o]=t.split(":");return `${s}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",f=a__namespace.default.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:s,children:o,weight:n,...i},l)=>{let p=O(e),d=r==="inherit"?"text-inherit":`text-text-${r}`,g=a__namespace.default.useMemo(()=>{let $=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return S($)},[e]);return a__namespace.default.createElement(t||g,{ref:l,className:`font-sans antialiased ${p} ${d} ${n?`!${B[n]}`:""} ${s??""}`,...i},o)});f.displayName="Text";var C={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},V={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},j=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],t={},s;return r.forEach(o=>{if(typeof o=="number")s=`${o}px`;else {let[n,i]=o.split(":"),l=parseInt(i,10);t[`@media (min-width: ${V[n]})`]=`${l}px`;}}),{width:s||"24px",height:s||"24px",...Object.entries(t).reduce((o,[n,i])=>({...o,[n]:{width:i,height:i}}),{})}},h=a__namespace.default.forwardRef(({name:e,size:r=24,color:t="primary",title:s,className:o,style:n={},...i},l)=>{let p=icons.IconMap[e],d=j(r);return a__namespace.default.createElement("div",{className:c("flex justify-center items-center",o),style:{...d,"--icon-stroke":C[t],...n}},a__namespace.default.createElement(p,{ref:l,"aria-hidden":!s,"aria-label":s,stroke:e.includes("filled")?void 0:C[t],...i}))});h.displayName="Icon";var z={black:"bg-text-text text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},G={black:"border border-text text-text",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},H=a__namespace.forwardRef(({className:e,variant:r="filled",color:t="black",isLoading:s=!1,children:o,disabled:n,end:i,...l},p)=>a__namespace.createElement("button",{ref:p,className:c(`
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`,b,r==="filled"?z[t]:G[t],e),disabled:n||s,type:"button",...l},typeof o=="string"?a__namespace.createElement(f,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},o):o,i));H.displayName="Button";var K={default:{icon:"information",className:"bg-gray-900 text-white"},success:{icon:"check",className:"bg-green-600 text-white"},error:{icon:"danger",className:"bg-tertiary-10 text-white"},warning:{icon:"warning-2",className:"bg-tertiary-20 text-white"}},P=a__namespace.forwardRef(({title:e,message:r,action:t,variant:s="default",duration:o=5e3,className:n,onOpenChange:i,...l},p)=>{let d=K[s],g=a__namespace.useCallback(E=>{i?.(E);},[i]);return a__namespace.createElement(m__namespace.Root,{ref:p,onOpenChange:g,duration:o,className:c("group pointer-events-auto relative flex w-full gap-4 rounded-lg p-4","shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full",d.className,n),...l},a__namespace.createElement(h,{name:d.icon,className:"h-5 w-5 shrink-0",color:"white"}),a__namespace.createElement("div",{className:"flex-1 gap-2"},e&&a__namespace.createElement(m__namespace.Title,{asChild:!0},a__namespace.createElement(f,{variant:"body-default-bold",color:"inherit"},e)),a__namespace.createElement(m__namespace.Description,{asChild:!0},a__namespace.createElement(f,{variant:"body-xs-medium",color:"inherit"},r))),a__namespace.createElement("div",{className:"flex gap-2"},t&&a__namespace.createElement(m__namespace.Action,{asChild:!0,altText:t.label},a__namespace.createElement("div",null,a__namespace.createElement(H,{variant:"outlined",color:"black",className:"border-white text-white hover:bg-white/10 ml-auto",onClick:t.onClick},t.label))),a__namespace.createElement(m__namespace.Close,{className:"p-2 hover:bg-white/10","aria-label":"Close"},a__namespace.createElement(h,{name:"close",size:16,color:"white"}))))});P.displayName="Toast";var w=typeof window<"u"?a.useLayoutEffect:a.useEffect;var F=({children:e,maxHeight:r=100})=>{let[t,s]=a__namespace.default.useState(!1),o=a.useRef(null),[n,i]=a.useState(r);w(()=>{if(!o.current)return;let p=new ResizeObserver(d=>{for(let g of d)i(g.target.scrollHeight);});return p.observe(o.current),()=>p.disconnect()},[]);let l=n>r;return a__namespace.default.createElement(T__namespace.Root,{open:t,onOpenChange:s},a__namespace.default.createElement("div",{className:"relative"},a__namespace.default.createElement("div",{className:"overflow-hidden transition-[height] duration-300 ease-in-out",style:{height:t?`${n}px`:`${r}px`}},a__namespace.default.createElement("div",{ref:o,className:"w-full"},e)),l&&a__namespace.default.createElement(T__namespace.Trigger,{asChild:!0},a__namespace.default.createElement(x,{className:c("absolute -bottom-8 left-0 right-0","flex items-end justify-center","h-16 pt-8 pb-2",!t&&"bg-gradient-to-b from-transparent via-white to-white","hover:opacity-100 transition-opacity")},a__namespace.default.createElement(f,{variant:"label-default",color:"secondary"},t?"See less":"See more")))))};F.displayName="Collapsible";exports.Collapsible=F;//# sourceMappingURL=Collapsible.cjs.map
2
10
  //# sourceMappingURL=Collapsible.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Pressable.tsx","../../src/components/Text.tsx","../../src/components/Collapsible.tsx"],"names":["focusRingStyles","cn","inputs","twMerge","clsx","Pressable","React","children","type","className","disabled","props","ref","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","size","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","color","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Collapsible","maxHeight","open","setOpen","contentRef","useRef","contentHeight","setContentHeight","useState","useLayoutEffect","resizeObserver","entries","entry","shouldShowTrigger","p"],"mappings":"gmBAmEO,IAAMA,CAAAA,CACX,qGCpEF,CAGO,SAASC,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCCO,IAAMG,CAAYC,CAAAA,kBAAAA,CAAM,WAC7B,CAAC,CAAE,QAAAC,CAAAA,CAAAA,CAAU,IAAAC,CAAAA,CAAAA,CAAO,SAAU,SAAAC,CAAAA,CAAAA,CAAW,QAAAC,CAAAA,CAAAA,CAAU,GAAGC,CAAM,EAAGC,CAC7DN,GAAAA,kBAAAA,CAAA,cAAC,QACC,CAAA,CAAA,GAAA,CAAKM,EACL,IAAMJ,CAAAA,CAAAA,CACN,QAAUE,CAAAA,CAAAA,CACV,SAAWT,CAAAA,CAAAA,CACT,kEACAD,CACAU,CAAAA,CAAAA,EAAY,+BACZD,CAAAA,CACF,CACC,CAAA,GAAGE,GAEHJ,CACH,CAEJ,CAEAF,CAAAA,CAAAA,CAAU,WAAc,CAAA,WAAA,CC6CxB,IAAMQ,CAAAA,CAAmD,CACvD,EAAA,CAAI,KACJ,EAAI,CAAA,IAAA,CACJ,EAAI,CAAA,IAAA,CACJ,EAAI,CAAA,IAAA,CACJ,GAAI,IACN,CAAA,CAEMC,CAAyBC,CAAAA,CAAAA,EAAwC,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,CAAIF,CAAAA,CAAAA,CAAQ,KAAM,CAAA,GAAG,EAE1C,OAAIC,CAAAA,GAAa,UACRH,CAAoBI,CAAAA,CAAI,GAAK,GAGlCD,CAAAA,C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,EAAE,CAEL,CAAA,IAAMG,EAAoBP,CAAgBL,CAAAA,CAAAA,CAE1C,OACE1B,kBAAAA,CAAA,aAAkB,CAAAuC,YAAA,CAAA,IAAA,CAAjB,CAAsB,IAAMZ,CAAAA,CAAAA,CAAM,YAAcC,CAAAA,CAAAA,CAAAA,CAC/C5B,kBAAA,CAAA,aAAA,CAAC,OAAI,SAAU,CAAA,UAAA,CAAA,CACbA,kBAAA,CAAA,aAAA,CAAC,KACC,CAAA,CAAA,SAAA,CAAU,+DACV,KAAO,CAAA,CACL,MAAQ2B,CAAAA,CAAAA,CAAO,CAAGI,EAAAA,CAAa,KAAO,CAAGL,EAAAA,CAAS,CACpD,EAAA,CAAA,CAAA,CAAA,CAEA1B,kBAAA,CAAA,aAAA,CAAC,OAAI,GAAK6B,CAAAA,CAAAA,CAAY,SAAU,CAAA,QAAA,CAAA,CAC7B5B,CACH,CACF,EAECqC,CACCtC,EAAAA,kBAAAA,CAAA,aAAkB,CAAAuC,YAAA,CAAA,OAAA,CAAjB,CAAyB,OAAA,CAAO,IAC/BvC,kBAAA,CAAA,aAAA,CAACD,CAAA,CAAA,CACC,SAAWJ,CAAAA,CAAAA,CACT,oCACA,+BACA,CAAA,gBAAA,CACA,CAACgC,CAAAA,EAAQ,sDACT,CAAA,sCACF,GAEA3B,kBAAA,CAAA,aAAA,CAACiB,CAAA,CAAA,CAAK,OAAQ,CAAA,eAAA,CAAgB,MAAM,WACjCU,CAAAA,CAAAA,CAAAA,CAAO,UAAa,CAAA,UACvB,CACF,CACF,CAEJ,CACF,CAEJ,EAEAF,CAAAA,CAAY,WAAc,CAAA,aAAA","file":"Collapsible.cjs","sourcesContent":["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 { 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, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React, { useRef, useLayoutEffect, useState } from \"react\";\nimport * as RadixCollapsible from \"@radix-ui/react-collapsible\";\nimport { Pressable } from \"./Pressable\";\nimport { Text } from \"./Text\";\nimport { cn } from \"../utils\";\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n maxHeight?: number;\n};\n\nexport const Collapsible = ({\n children,\n maxHeight = 100\n}: CollapsibleProps) => {\n const [open, setOpen] = React.useState(false);\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number>(maxHeight);\n\n // Measure content height on mount and resize\n useLayoutEffect(() => {\n if (!contentRef.current) return;\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setContentHeight(entry.target.scrollHeight);\n }\n });\n\n resizeObserver.observe(contentRef.current);\n return () => resizeObserver.disconnect();\n }, []);\n\n const shouldShowTrigger = contentHeight > maxHeight;\n\n return (\n <RadixCollapsible.Root open={open} onOpenChange={setOpen}>\n <div className=\"relative\">\n <div\n className=\"overflow-hidden transition-[height] duration-300 ease-in-out\"\n style={{\n height: open ? `${contentHeight}px` : `${maxHeight}px`\n }}\n >\n <div ref={contentRef} className=\"w-full\">\n {children}\n </div>\n </div>\n\n {shouldShowTrigger && (\n <RadixCollapsible.Trigger asChild>\n <Pressable\n className={cn(\n \"absolute -bottom-8 left-0 right-0\",\n \"flex items-end justify-center\",\n \"h-16 pt-8 pb-2\",\n !open && \"bg-gradient-to-b from-transparent via-white to-white\",\n \"hover:opacity-100 transition-opacity\"\n )}\n >\n <Text variant=\"label-default\" color=\"secondary\">\n {open ? \"See less\" : \"See more\"}\n </Text>\n </Pressable>\n </RadixCollapsible.Trigger>\n )}\n </div>\n </RadixCollapsible.Root>\n );\n};\n\nCollapsible.displayName = \"Collapsible\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Pressable.tsx","../../src/components/Text.tsx","../../src/components/Icon.tsx","../../src/components/Button.tsx","../../src/components/Toast.tsx","../../src/hooks/useMediaQuery.ts","../../src/hooks/useIsomorphicLayoutEffect.tsx","../../src/components/Collapsible.tsx"],"names":["focusRingStyles","cn","inputs","twMerge","clsx","Pressable","React","children","type","className","disabled","props","ref","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","size","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","color","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","valueStr","value","acc","query","Icon","name","title","style","IconComponent","IconMap","sizeStyles","filled","outlined","Button","y","isLoading","end","Toast","a","message","action","duration","onOpenChange","variantConfig","handleOpenChange","open","m","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","Collapsible","maxHeight","setOpen","contentRef","useRef","contentHeight","setContentHeight","useState","resizeObserver","entries","entry","shouldShowTrigger","T"],"mappings":"wpBAmEO,IAAMA,CACX,CAAA,qGAAA,CCjEK,SAASC,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CCCO,IAAMG,CAAYC,CAAAA,oBAAAA,CAAM,UAC7B,CAAA,CAAC,CAAE,QAAAC,CAAAA,CAAAA,CAAU,IAAAC,CAAAA,CAAAA,CAAO,QAAU,CAAA,SAAA,CAAAC,CAAW,CAAA,QAAA,CAAAC,EAAU,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAC7DN,oBAAA,CAAA,aAAA,CAAC,QACC,CAAA,CAAA,GAAA,CAAKM,EACL,IAAMJ,CAAAA,CAAAA,CACN,QAAUE,CAAAA,CAAAA,CACV,SAAWT,CAAAA,CAAAA,CACT,iEACAD,CAAAA,CAAAA,CACAU,GAAY,+BACZD,CAAAA,CACF,CACC,CAAA,GAAGE,CAEHJ,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAEAF,EAAU,WAAc,CAAA,WAAA,CC6CxB,IAAMQ,CAAmD,CAAA,CACvD,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,CAAwC,EAAA,CACrE,GAAM,CAACC,CAAUC,CAAAA,CAAI,EAAIF,CAAQ,CAAA,KAAA,CAAM,GAAG,CAAA,CAE1C,OAAIC,CAAAA,GAAa,SACRH,CAAAA,CAAAA,CAAoBI,CAAI,CAAK,EAAA,GAAA,CAGlCD,CAAa,GAAA,OAAA,CACR,OAGF,CAAA,GACT,CAIME,CAAAA,CAAAA,CAAqC,CACzC,KAAO,CAAA,YAAA,CACP,OAAS,CAAA,cAAA,CACT,QAAU,CAA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AAA,CAAA,CAC/B1E,qBAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,SAAA,CAAWJ,CACT,CAAA,mCAAA,CACA,gCACA,gBACA,CAAA,CAAC8D,GAAQ,sDACT,CAAA,sCACF,GAEAzD,oBAAA,CAAA,aAAA,CAACiB,CAAA,CAAA,CAAK,OAAQ,CAAA,eAAA,CAAgB,MAAM,WACjCwC,CAAAA,CAAAA,CAAAA,CAAO,UAAa,CAAA,UACvB,CACF,CACF,CAEJ,CACF,CAEJ,EAEAK,CAAAA,CAAY,WAAc,CAAA,aAAA","file":"Collapsible.cjs","sourcesContent":["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 { 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, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type ButtonProps = {\n /** @default filled */\n variant?: \"filled\" | \"outlined\";\n /** @default primary */\n color?: \"black\" | \"accent\" | \"secondary\";\n isLoading?: boolean;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n start?: React.ReactNode;\n end?: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const filled = {\n black: \"bg-text-text text-white\",\n // fade it slightly\n accent: \"bg-primary-100 text-white\",\n secondary: \"bg-secondary-100 text-secondary\"\n};\n\nexport const outlined = {\n black: \"border border-text text-text\",\n accent: \"border border-primary-100 text-primary-100\",\n secondary: \"border border-text-secondary text-secondary\"\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"filled\",\n color = \"black\",\n isLoading = false,\n children,\n disabled,\n end,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={cn(\n `\n sm:px-7 px-4\n py-2\n inline-flex items-center justify-center\n rounded-lg \n transition-colors duration-200\n disabled:opacity-50 disabled:pointer-events-none\n hover:opacity-80 active:scale-95 \n truncate`,\n focusRingStyles,\n variant === \"filled\" ? 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 {end}\n </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import * as React from \"react\";\nimport * as ToastPrimitive from \"@radix-ui/react-toast\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\nimport { Button } from \"./Button\";\nimport { IconName } from \"@deckai/icons\";\n\nexport type ToastProps = ToastPrimitive.ToastProps & {\n /** Optional title for the toast */\n title?: string;\n /** Main message content */\n message: string;\n /** Optional action button configuration */\n action?: {\n label: string;\n onClick: () => void;\n };\n /** Optional variant to change the visual style */\n variant?: \"default\" | \"success\" | \"error\" | \"warning\";\n\n /** Optional className for custom styling */\n className?: string;\n};\n\nconst variants: Record<\n NonNullable<ToastProps[\"variant\"]>,\n {\n icon: IconName;\n className: string;\n }\n> = {\n default: {\n icon: \"information\",\n className: \"bg-gray-900 text-white\"\n },\n success: {\n icon: \"check\",\n className: \"bg-green-600 text-white\"\n },\n error: {\n icon: \"danger\",\n className: \"bg-tertiary-10 text-white\"\n },\n warning: {\n icon: \"warning-2\",\n className: \"bg-tertiary-20 text-white\"\n }\n} as const;\n\nexport const Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitive.Root>,\n ToastProps\n>(\n (\n {\n title,\n message,\n action,\n variant = \"default\",\n duration = 5000,\n className,\n onOpenChange,\n ...props\n },\n ref\n ) => {\n const variantConfig = variants[variant];\n\n const handleOpenChange = React.useCallback(\n (open: boolean) => {\n onOpenChange?.(open);\n },\n [onOpenChange]\n );\n\n return (\n <ToastPrimitive.Root\n ref={ref}\n onOpenChange={handleOpenChange}\n duration={duration}\n className={cn(\n \"group pointer-events-auto relative flex w-full gap-4 rounded-lg p-4\",\n \"shadow-lg\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full\",\n variantConfig.className,\n className\n )}\n {...props}\n >\n <Icon\n name={variantConfig.icon}\n className=\"h-5 w-5 shrink-0\"\n color=\"white\"\n />\n\n <div className=\"flex-1 gap-2\">\n {title && (\n <ToastPrimitive.Title asChild>\n <Text variant=\"body-default-bold\" color=\"inherit\">\n {title}\n </Text>\n </ToastPrimitive.Title>\n )}\n <ToastPrimitive.Description asChild>\n <Text variant=\"body-xs-medium\" color=\"inherit\">\n {message}\n </Text>\n </ToastPrimitive.Description>\n </div>\n\n <div className=\"flex gap-2\">\n {action && (\n <ToastPrimitive.Action asChild altText={action.label}>\n <div>\n <Button\n variant=\"outlined\"\n color=\"black\"\n className=\"border-white text-white hover:bg-white/10 ml-auto\"\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </div>\n </ToastPrimitive.Action>\n )}\n <ToastPrimitive.Close\n className=\"p-2 hover:bg-white/10\"\n aria-label=\"Close\"\n >\n <Icon name=\"close\" size={16} color=\"white\" />\n </ToastPrimitive.Close>\n </div>\n </ToastPrimitive.Root>\n );\n }\n);\n\nToast.displayName = \"Toast\";\n","import { useCallback, useEffect, useState } from \"react\";\n\nconst useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useEffect : () => {};\n\nexport const useMediaQuery = (query: string): boolean => {\n // Initialize with null to prevent hydration mismatch\n const [matches, setMatches] = useState<boolean | null>(null);\n\n const getMatches = useCallback((query: string): boolean => {\n if (typeof window !== \"undefined\") {\n return window.matchMedia(query).matches;\n }\n return false;\n }, []);\n\n // Update matches after mount to prevent hydration mismatch\n useIsomorphicLayoutEffect(() => {\n setMatches(getMatches(query));\n }, [query, getMatches]);\n\n useEffect(() => {\n if (typeof window !== \"undefined\") {\n const mediaQuery = window.matchMedia(query);\n\n const handleChange = () => {\n setMatches(getMatches(query));\n };\n\n mediaQuery.addEventListener(\"change\", handleChange);\n\n return () => {\n mediaQuery.removeEventListener(\"change\", handleChange);\n };\n }\n }, [query, getMatches]);\n\n // Return false during SSR, actual value after hydration\n return matches ?? false;\n};\n","import { useEffect, useLayoutEffect } from \"react\";\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n","import React, { useRef, useState } from \"react\";\nimport * as RadixCollapsible from \"@radix-ui/react-collapsible\";\nimport { Pressable } from \"./Pressable\";\nimport { Text } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { useIsomorphicLayoutEffect } from \"../hooks\";\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n maxHeight?: number;\n};\n\nexport const Collapsible = ({\n children,\n maxHeight = 100\n}: CollapsibleProps) => {\n const [open, setOpen] = React.useState(false);\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number>(maxHeight);\n\n // Measure content height on mount and resize\n useIsomorphicLayoutEffect(() => {\n if (!contentRef.current) return;\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setContentHeight(entry.target.scrollHeight);\n }\n });\n\n resizeObserver.observe(contentRef.current);\n return () => resizeObserver.disconnect();\n }, []);\n\n const shouldShowTrigger = contentHeight > maxHeight;\n\n return (\n <RadixCollapsible.Root open={open} onOpenChange={setOpen}>\n <div className=\"relative\">\n <div\n className=\"overflow-hidden transition-[height] duration-300 ease-in-out\"\n style={{\n height: open ? `${contentHeight}px` : `${maxHeight}px`\n }}\n >\n <div ref={contentRef} className=\"w-full\">\n {children}\n </div>\n </div>\n\n {shouldShowTrigger && (\n <RadixCollapsible.Trigger asChild>\n <Pressable\n className={cn(\n \"absolute -bottom-8 left-0 right-0\",\n \"flex items-end justify-center\",\n \"h-16 pt-8 pb-2\",\n !open && \"bg-gradient-to-b from-transparent via-white to-white\",\n \"hover:opacity-100 transition-opacity\"\n )}\n >\n <Text variant=\"label-default\" color=\"secondary\">\n {open ? \"See less\" : \"See more\"}\n </Text>\n </Pressable>\n </RadixCollapsible.Trigger>\n )}\n </div>\n </RadixCollapsible.Root>\n );\n};\n\nCollapsible.displayName = \"Collapsible\";\n"]}
@@ -1,2 +1,10 @@
1
- import s,{useRef,useState,useLayoutEffect}from'react';import*as p from'@radix-ui/react-collapsible';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var b="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";function i(...e){return twMerge(clsx(e))}var y=s.forwardRef(({children:e,type:r="button",className:t,disabled:n,...o},a)=>s.createElement("button",{ref:a,type:r,disabled:n,className:i("appearance-none hover:opacity-80 transition-all active:scale-95",b,n&&"opacity-50 cursor-not-allowed",t),...o},e));y.displayName="Pressable";var L={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},E=e=>{let[r,t]=e.split("-");return r==="heading"?L[t]||"p":r==="label"?"label":"p"},x={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},R=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[n,o]=t.split(":");return `${n}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",h=s.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:n,children:o,weight:a,...c},m)=>{let l=R(e),T=r==="inherit"?"text-inherit":`text-text-${r}`,g=s.useMemo(()=>{let f=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return E(f)},[e]);return s.createElement(t||g,{ref:m,className:`font-sans antialiased ${l} ${T} ${a?`!${x[a]}`:""} ${n??""}`,...c},o)});h.displayName="Text";var v=({children:e,maxHeight:r=100})=>{let[t,n]=s.useState(!1),o=useRef(null),[a,c]=useState(r);useLayoutEffect(()=>{if(!o.current)return;let l=new ResizeObserver(T=>{for(let g of T)c(g.target.scrollHeight);});return l.observe(o.current),()=>l.disconnect()},[]);let m=a>r;return s.createElement(p.Root,{open:t,onOpenChange:n},s.createElement("div",{className:"relative"},s.createElement("div",{className:"overflow-hidden transition-[height] duration-300 ease-in-out",style:{height:t?`${a}px`:`${r}px`}},s.createElement("div",{ref:o,className:"w-full"},e)),m&&s.createElement(p.Trigger,{asChild:!0},s.createElement(y,{className:i("absolute -bottom-8 left-0 right-0","flex items-end justify-center","h-16 pt-8 pb-2",!t&&"bg-gradient-to-b from-transparent via-white to-white","hover:opacity-100 transition-opacity")},s.createElement(h,{variant:"label-default",color:"secondary"},t?"See less":"See more")))))};v.displayName="Collapsible";export{v as Collapsible};//# sourceMappingURL=Collapsible.js.map
1
+ import*as a from'react';import a__default,{useRef,useState,useLayoutEffect,useEffect}from'react';import*as T from'@radix-ui/react-collapsible';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import*as m from'@radix-ui/react-toast';import {IconMap}from'@deckai/icons';var b="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";function c(...e){return twMerge(clsx(e))}var x=a__default.forwardRef(({children:e,type:r="button",className:t,disabled:s,...o},n)=>a__default.createElement("button",{ref:n,type:r,disabled:s,className:c("appearance-none hover:opacity-80 transition-all active:scale-95",b,s&&"opacity-50 cursor-not-allowed",t),...o},e));x.displayName="Pressable";var k={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},S=e=>{let[r,t]=e.split("-");return r==="heading"?k[t]||"p":r==="label"?"label":"p"},B={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},O=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[s,o]=t.split(":");return `${s}:text-${o}`}return `text-${t}`}).join(" "):"text-body-default",f=a__default.forwardRef(({variant:e="body-default",color:r="primary",as:t,className:s,children:o,weight:n,...i},l)=>{let p=O(e),d=r==="inherit"?"text-inherit":`text-text-${r}`,g=a__default.useMemo(()=>{let $=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return S($)},[e]);return a__default.createElement(t||g,{ref:l,className:`font-sans antialiased ${p} ${d} ${n?`!${B[n]}`:""} ${s??""}`,...i},o)});f.displayName="Text";var C={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},V={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},j=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],t={},s;return r.forEach(o=>{if(typeof o=="number")s=`${o}px`;else {let[n,i]=o.split(":"),l=parseInt(i,10);t[`@media (min-width: ${V[n]})`]=`${l}px`;}}),{width:s||"24px",height:s||"24px",...Object.entries(t).reduce((o,[n,i])=>({...o,[n]:{width:i,height:i}}),{})}},h=a__default.forwardRef(({name:e,size:r=24,color:t="primary",title:s,className:o,style:n={},...i},l)=>{let p=IconMap[e],d=j(r);return a__default.createElement("div",{className:c("flex justify-center items-center",o),style:{...d,"--icon-stroke":C[t],...n}},a__default.createElement(p,{ref:l,"aria-hidden":!s,"aria-label":s,stroke:e.includes("filled")?void 0:C[t],...i}))});h.displayName="Icon";var z={black:"bg-text-text text-white",accent:"bg-primary-100 text-white",secondary:"bg-secondary-100 text-secondary"},G={black:"border border-text text-text",accent:"border border-primary-100 text-primary-100",secondary:"border border-text-secondary text-secondary"},H=a.forwardRef(({className:e,variant:r="filled",color:t="black",isLoading:s=!1,children:o,disabled:n,end:i,...l},p)=>a.createElement("button",{ref:p,className:c(`
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`,b,r==="filled"?z[t]:G[t],e),disabled:n||s,type:"button",...l},typeof o=="string"?a.createElement(f,{variant:["sm:body-default-bold","body-xxs-semibold"],color:"inherit"},o):o,i));H.displayName="Button";var K={default:{icon:"information",className:"bg-gray-900 text-white"},success:{icon:"check",className:"bg-green-600 text-white"},error:{icon:"danger",className:"bg-tertiary-10 text-white"},warning:{icon:"warning-2",className:"bg-tertiary-20 text-white"}},P=a.forwardRef(({title:e,message:r,action:t,variant:s="default",duration:o=5e3,className:n,onOpenChange:i,...l},p)=>{let d=K[s],g=a.useCallback(E=>{i?.(E);},[i]);return a.createElement(m.Root,{ref:p,onOpenChange:g,duration:o,className:c("group pointer-events-auto relative flex w-full gap-4 rounded-lg p-4","shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full",d.className,n),...l},a.createElement(h,{name:d.icon,className:"h-5 w-5 shrink-0",color:"white"}),a.createElement("div",{className:"flex-1 gap-2"},e&&a.createElement(m.Title,{asChild:!0},a.createElement(f,{variant:"body-default-bold",color:"inherit"},e)),a.createElement(m.Description,{asChild:!0},a.createElement(f,{variant:"body-xs-medium",color:"inherit"},r))),a.createElement("div",{className:"flex gap-2"},t&&a.createElement(m.Action,{asChild:!0,altText:t.label},a.createElement("div",null,a.createElement(H,{variant:"outlined",color:"black",className:"border-white text-white hover:bg-white/10 ml-auto",onClick:t.onClick},t.label))),a.createElement(m.Close,{className:"p-2 hover:bg-white/10","aria-label":"Close"},a.createElement(h,{name:"close",size:16,color:"white"}))))});P.displayName="Toast";var w=typeof window<"u"?useLayoutEffect:useEffect;var F=({children:e,maxHeight:r=100})=>{let[t,s]=a__default.useState(!1),o=useRef(null),[n,i]=useState(r);w(()=>{if(!o.current)return;let p=new ResizeObserver(d=>{for(let g of d)i(g.target.scrollHeight);});return p.observe(o.current),()=>p.disconnect()},[]);let l=n>r;return a__default.createElement(T.Root,{open:t,onOpenChange:s},a__default.createElement("div",{className:"relative"},a__default.createElement("div",{className:"overflow-hidden transition-[height] duration-300 ease-in-out",style:{height:t?`${n}px`:`${r}px`}},a__default.createElement("div",{ref:o,className:"w-full"},e)),l&&a__default.createElement(T.Trigger,{asChild:!0},a__default.createElement(x,{className:c("absolute -bottom-8 left-0 right-0","flex items-end justify-center","h-16 pt-8 pb-2",!t&&"bg-gradient-to-b from-transparent via-white to-white","hover:opacity-100 transition-opacity")},a__default.createElement(f,{variant:"label-default",color:"secondary"},t?"See less":"See more")))))};F.displayName="Collapsible";export{F as Collapsible};//# sourceMappingURL=Collapsible.js.map
2
10
  //# sourceMappingURL=Collapsible.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Pressable.tsx","../../src/components/Text.tsx","../../src/components/Collapsible.tsx"],"names":["focusRingStyles","cn","inputs","twMerge","clsx","Pressable","React","children","type","className","disabled","props","ref","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","size","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","color","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Collapsible","maxHeight","open","setOpen","contentRef","useRef","contentHeight","setContentHeight","useState","useLayoutEffect","resizeObserver","entries","entry","shouldShowTrigger"],"mappings":"iKAmEO,IAAMA,CAAAA,CACX,qGCpEF,CAGO,SAASC,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCCO,IAAMG,CAAYC,CAAAA,CAAAA,CAAM,WAC7B,CAAC,CAAE,QAAAC,CAAAA,CAAAA,CAAU,IAAAC,CAAAA,CAAAA,CAAO,SAAU,SAAAC,CAAAA,CAAAA,CAAW,QAAAC,CAAAA,CAAAA,CAAU,GAAGC,CAAM,EAAGC,CAC7DN,GAAAA,CAAAA,CAAA,cAAC,QACC,CAAA,CAAA,GAAA,CAAKM,EACL,IAAMJ,CAAAA,CAAAA,CACN,QAAUE,CAAAA,CAAAA,CACV,SAAWT,CAAAA,CAAAA,CACT,kEACAD,CACAU,CAAAA,CAAAA,EAAY,+BACZD,CAAAA,CACF,CACC,CAAA,GAAGE,GAEHJ,CACH,CAEJ,CAEAF,CAAAA,CAAAA,CAAU,WAAc,CAAA,WAAA,CC6CxB,IAAMQ,CAAAA,CAA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A,UACvB,CACF,CACF,CAEJ,CACF,CAEJ,EAEAF,CAAAA,CAAY,WAAc,CAAA,aAAA","file":"Collapsible.js","sourcesContent":["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 { 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, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React, { useRef, useLayoutEffect, useState } from \"react\";\nimport * as RadixCollapsible from \"@radix-ui/react-collapsible\";\nimport { Pressable } from \"./Pressable\";\nimport { Text } from \"./Text\";\nimport { cn } from \"../utils\";\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n maxHeight?: number;\n};\n\nexport const Collapsible = ({\n children,\n maxHeight = 100\n}: CollapsibleProps) => {\n const [open, setOpen] = React.useState(false);\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number>(maxHeight);\n\n // Measure content height on mount and resize\n useLayoutEffect(() => {\n if (!contentRef.current) return;\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setContentHeight(entry.target.scrollHeight);\n }\n });\n\n resizeObserver.observe(contentRef.current);\n return () => resizeObserver.disconnect();\n }, []);\n\n const shouldShowTrigger = contentHeight > maxHeight;\n\n return (\n <RadixCollapsible.Root open={open} onOpenChange={setOpen}>\n <div className=\"relative\">\n <div\n className=\"overflow-hidden transition-[height] duration-300 ease-in-out\"\n style={{\n height: open ? `${contentHeight}px` : `${maxHeight}px`\n }}\n >\n <div ref={contentRef} className=\"w-full\">\n {children}\n </div>\n </div>\n\n {shouldShowTrigger && (\n <RadixCollapsible.Trigger asChild>\n <Pressable\n className={cn(\n \"absolute -bottom-8 left-0 right-0\",\n \"flex items-end justify-center\",\n \"h-16 pt-8 pb-2\",\n !open && \"bg-gradient-to-b from-transparent via-white to-white\",\n \"hover:opacity-100 transition-opacity\"\n )}\n >\n <Text variant=\"label-default\" color=\"secondary\">\n {open ? \"See less\" : \"See more\"}\n </Text>\n </Pressable>\n </RadixCollapsible.Trigger>\n )}\n </div>\n </RadixCollapsible.Root>\n );\n};\n\nCollapsible.displayName = \"Collapsible\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Pressable.tsx","../../src/components/Text.tsx","../../src/components/Icon.tsx","../../src/components/Button.tsx","../../src/components/Toast.tsx","../../src/hooks/useMediaQuery.ts","../../src/hooks/useIsomorphicLayoutEffect.tsx","../../src/components/Collapsible.tsx"],"names":["focusRingStyles","cn","inputs","twMerge","clsx","Pressable","React","children","type","className","disabled","props","ref","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","size","fontWeight","processVariants","variants","breakpoint","typographyClass","Text","color","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","valueStr","value","acc","query","Icon","name","title","style","IconComponent","IconMap","sizeStyles","filled","outlined","Button","y","isLoading","end","Toast","message","action","duration","onOpenChange","variantConfig","handleOpenChange","open","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","Collapsible","maxHeight","setOpen","contentRef","useRef","contentHeight","setContentHeight","useState","resizeObserver","entries","entry","shouldShowTrigger"],"mappings":"wRAmEO,IAAMA,CACX,CAAA,qGAAA,CCjEK,SAASC,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCCO,IAAMG,CAAYC,CAAAA,UAAAA,CAAM,UAC7B,CAAA,CAAC,CAAE,QAAAC,CAAAA,CAAAA,CAAU,IAAAC,CAAAA,CAAAA,CAAO,QAAU,CAAA,SAAA,CAAAC,CAAW,CAAA,QAAA,CAAAC,EAAU,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAC7DN,UAAA,CAAA,aAAA,CAAC,QACC,CAAA,CAAA,GAAA,CAAKM,EACL,IAAMJ,CAAAA,CAAAA,CACN,QAAUE,CAAAA,CAAAA,CACV,SAAWT,CAAAA,CAAAA,CACT,iEACAD,CAAAA,CAAAA,CACAU,GAAY,+BACZD,CAAAA,CACF,CACC,CAAA,GAAGE,CAEHJ,CAAAA,CAAAA,CACH,CAEJ,CAAA,CAEAF,EAAU,WAAc,CAAA,WAAA,CC6CxB,IAAMQ,CAAmD,CAAA,CACvD,GAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACJ,CAAA,EAAA,CAAI,IACN,CAEMC,CAAAA,CAAAA,CAAyBC,CAAwC,EAAA,CACrE,GAAM,CAACC,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,IACpD,CAEA7D,CAAAA,CAAAA,UAAAA,CAAA,cAAC,KAAI,CAAA,CAAA,GAAA,CAAK+D,EAAY,SAAU,CAAA,QAAA,CAAA,CAC7B9D,CACH,CACF,CAECsE,CAAAA,CAAAA,EACCvE,WAAA,aAAkB,CAAA,CAAA,CAAA,OAAA,CAAjB,CAAyB,OAAO,CAAA,CAAA,CAAA,CAAA,CAC/BA,WAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,SAAA,CAAWJ,CACT,CAAA,mCAAA,CACA,gCACA,gBACA,CAAA,CAAC6D,GAAQ,sDACT,CAAA,sCACF,GAEAxD,UAAA,CAAA,aAAA,CAACiB,CAAA,CAAA,CAAK,OAAQ,CAAA,eAAA,CAAgB,MAAM,WACjCuC,CAAAA,CAAAA,CAAAA,CAAO,UAAa,CAAA,UACvB,CACF,CACF,CAEJ,CACF,CAEJ,EAEAI,CAAAA,CAAY,WAAc,CAAA,aAAA","file":"Collapsible.js","sourcesContent":["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 { 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, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable = React.forwardRef<HTMLButtonElement, PressableProps>(\n ({ children, type = \"button\", className, disabled, ...props }, ref) => (\n <button\n ref={ref}\n type={type}\n disabled={disabled}\n className={cn(\n \"appearance-none hover:opacity-80 transition-all active:scale-95\",\n focusRingStyles,\n disabled && \"opacity-50 cursor-not-allowed\",\n className\n )}\n {...props}\n >\n {children}\n </button>\n )\n);\n\nPressable.displayName = \"Pressable\";\n","import React from \"react\";\nimport { Typography } from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype TextColor =\n | \"primary\"\n | \"secondary\"\n | \"white\"\n | \"primary-blue\"\n | \"disabled\"\n | \"danger\"\n | \"inherit\";\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: TextColor;\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color === \"inherit\" ? \"text-inherit\" : `text-text-${color}`;\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\",\n disabled: \"#888888\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { Text } from \"./Text\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { cn } from \"../utils\";\n\nexport type ButtonProps = {\n /** @default filled */\n variant?: \"filled\" | \"outlined\";\n /** @default primary */\n color?: \"black\" | \"accent\" | \"secondary\";\n isLoading?: boolean;\n children: React.ReactNode;\n className?: string;\n disabled?: boolean;\n start?: React.ReactNode;\n end?: React.ReactNode;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const filled = {\n black: \"bg-text-text text-white\",\n // fade it slightly\n accent: \"bg-primary-100 text-white\",\n secondary: \"bg-secondary-100 text-secondary\"\n};\n\nexport const outlined = {\n black: \"border border-text text-text\",\n accent: \"border border-primary-100 text-primary-100\",\n secondary: \"border border-text-secondary text-secondary\"\n};\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant = \"filled\",\n color = \"black\",\n isLoading = false,\n children,\n disabled,\n end,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={cn(\n `\n sm:px-7 px-4\n py-2\n inline-flex items-center justify-center\n rounded-lg \n transition-colors duration-200\n disabled:opacity-50 disabled:pointer-events-none\n hover:opacity-80 active:scale-95 \n truncate`,\n focusRingStyles,\n variant === \"filled\" ? 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 {end}\n </button>\n )\n);\n\nButton.displayName = \"Button\";\n","import * as React from \"react\";\nimport * as ToastPrimitive from \"@radix-ui/react-toast\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\nimport { Button } from \"./Button\";\nimport { IconName } from \"@deckai/icons\";\n\nexport type ToastProps = ToastPrimitive.ToastProps & {\n /** Optional title for the toast */\n title?: string;\n /** Main message content */\n message: string;\n /** Optional action button configuration */\n action?: {\n label: string;\n onClick: () => void;\n };\n /** Optional variant to change the visual style */\n variant?: \"default\" | \"success\" | \"error\" | \"warning\";\n\n /** Optional className for custom styling */\n className?: string;\n};\n\nconst variants: Record<\n NonNullable<ToastProps[\"variant\"]>,\n {\n icon: IconName;\n className: string;\n }\n> = {\n default: {\n icon: \"information\",\n className: \"bg-gray-900 text-white\"\n },\n success: {\n icon: \"check\",\n className: \"bg-green-600 text-white\"\n },\n error: {\n icon: \"danger\",\n className: \"bg-tertiary-10 text-white\"\n },\n warning: {\n icon: \"warning-2\",\n className: \"bg-tertiary-20 text-white\"\n }\n} as const;\n\nexport const Toast = React.forwardRef<\n React.ElementRef<typeof ToastPrimitive.Root>,\n ToastProps\n>(\n (\n {\n title,\n message,\n action,\n variant = \"default\",\n duration = 5000,\n className,\n onOpenChange,\n ...props\n },\n ref\n ) => {\n const variantConfig = variants[variant];\n\n const handleOpenChange = React.useCallback(\n (open: boolean) => {\n onOpenChange?.(open);\n },\n [onOpenChange]\n );\n\n return (\n <ToastPrimitive.Root\n ref={ref}\n onOpenChange={handleOpenChange}\n duration={duration}\n className={cn(\n \"group pointer-events-auto relative flex w-full gap-4 rounded-lg p-4\",\n \"shadow-lg\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n \"data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full\",\n variantConfig.className,\n className\n )}\n {...props}\n >\n <Icon\n name={variantConfig.icon}\n className=\"h-5 w-5 shrink-0\"\n color=\"white\"\n />\n\n <div className=\"flex-1 gap-2\">\n {title && (\n <ToastPrimitive.Title asChild>\n <Text variant=\"body-default-bold\" color=\"inherit\">\n {title}\n </Text>\n </ToastPrimitive.Title>\n )}\n <ToastPrimitive.Description asChild>\n <Text variant=\"body-xs-medium\" color=\"inherit\">\n {message}\n </Text>\n </ToastPrimitive.Description>\n </div>\n\n <div className=\"flex gap-2\">\n {action && (\n <ToastPrimitive.Action asChild altText={action.label}>\n <div>\n <Button\n variant=\"outlined\"\n color=\"black\"\n className=\"border-white text-white hover:bg-white/10 ml-auto\"\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </div>\n </ToastPrimitive.Action>\n )}\n <ToastPrimitive.Close\n className=\"p-2 hover:bg-white/10\"\n aria-label=\"Close\"\n >\n <Icon name=\"close\" size={16} color=\"white\" />\n </ToastPrimitive.Close>\n </div>\n </ToastPrimitive.Root>\n );\n }\n);\n\nToast.displayName = \"Toast\";\n","import { useCallback, useEffect, useState } from \"react\";\n\nconst useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useEffect : () => {};\n\nexport const useMediaQuery = (query: string): boolean => {\n // Initialize with null to prevent hydration mismatch\n const [matches, setMatches] = useState<boolean | null>(null);\n\n const getMatches = useCallback((query: string): boolean => {\n if (typeof window !== \"undefined\") {\n return window.matchMedia(query).matches;\n }\n return false;\n }, []);\n\n // Update matches after mount to prevent hydration mismatch\n useIsomorphicLayoutEffect(() => {\n setMatches(getMatches(query));\n }, [query, getMatches]);\n\n useEffect(() => {\n if (typeof window !== \"undefined\") {\n const mediaQuery = window.matchMedia(query);\n\n const handleChange = () => {\n setMatches(getMatches(query));\n };\n\n mediaQuery.addEventListener(\"change\", handleChange);\n\n return () => {\n mediaQuery.removeEventListener(\"change\", handleChange);\n };\n }\n }, [query, getMatches]);\n\n // Return false during SSR, actual value after hydration\n return matches ?? false;\n};\n","import { useEffect, useLayoutEffect } from \"react\";\n\nexport const useIsomorphicLayoutEffect =\n typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n","import React, { useRef, useState } from \"react\";\nimport * as RadixCollapsible from \"@radix-ui/react-collapsible\";\nimport { Pressable } from \"./Pressable\";\nimport { Text } from \"./Text\";\nimport { cn } from \"../utils\";\nimport { useIsomorphicLayoutEffect } from \"../hooks\";\n\nexport type CollapsibleProps = {\n children: React.ReactNode;\n maxHeight?: number;\n};\n\nexport const Collapsible = ({\n children,\n maxHeight = 100\n}: CollapsibleProps) => {\n const [open, setOpen] = React.useState(false);\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number>(maxHeight);\n\n // Measure content height on mount and resize\n useIsomorphicLayoutEffect(() => {\n if (!contentRef.current) return;\n\n const resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n setContentHeight(entry.target.scrollHeight);\n }\n });\n\n resizeObserver.observe(contentRef.current);\n return () => resizeObserver.disconnect();\n }, []);\n\n const shouldShowTrigger = contentHeight > maxHeight;\n\n return (\n <RadixCollapsible.Root open={open} onOpenChange={setOpen}>\n <div className=\"relative\">\n <div\n className=\"overflow-hidden transition-[height] duration-300 ease-in-out\"\n style={{\n height: open ? `${contentHeight}px` : `${maxHeight}px`\n }}\n >\n <div ref={contentRef} className=\"w-full\">\n {children}\n </div>\n </div>\n\n {shouldShowTrigger && (\n <RadixCollapsible.Trigger asChild>\n <Pressable\n className={cn(\n \"absolute -bottom-8 left-0 right-0\",\n \"flex items-end justify-center\",\n \"h-16 pt-8 pb-2\",\n !open && \"bg-gradient-to-b from-transparent via-white to-white\",\n \"hover:opacity-100 transition-opacity\"\n )}\n >\n <Text variant=\"label-default\" color=\"secondary\">\n {open ? \"See less\" : \"See more\"}\n </Text>\n </Pressable>\n </RadixCollapsible.Trigger>\n )}\n </div>\n </RadixCollapsible.Root>\n );\n};\n\nCollapsible.displayName = \"Collapsible\";\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var l=require('react'),g=require('@radix-ui/react-popover'),h=require('@radix-ui/react-collapsible'),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 l__namespace=/*#__PURE__*/_interopNamespace(l);var g__namespace=/*#__PURE__*/_interopNamespace(g);var h__namespace=/*#__PURE__*/_interopNamespace(h);function m(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var S={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},Q={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},D=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],o={},n;return r.forEach(s=>{if(typeof s=="number")n=`${s}px`;else {let[p,i]=s.split(":"),d=parseInt(i,10);o[`@media (min-width: ${Q[p]})`]=`${d}px`;}}),{width:n||"24px",height:n||"24px",...Object.entries(o).reduce((s,[p,i])=>({...s,[p]:{width:i,height:i}}),{})}},H=l__namespace.default.forwardRef(({name:e,size:r=24,color:o="primary",title:n,className:s,style:p={},...i},d)=>{let f=icons.IconMap[e],c=D(r);return l__namespace.default.createElement("div",{className:m("flex justify-center items-center",s),style:{...c,"--icon-stroke":S[o],...p}},l__namespace.default.createElement(f,{ref:d,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?void 0:S[o],...i}))});H.displayName="Icon";var k=({className:e,end:r,iconName:o,color:n,size:s,title:p,label:i,labelClassName:d,id:f,children:c,forceShowFocusRing:b,...x})=>l__namespace.createElement("div",{className:"py-2"},i&&l__namespace.createElement("label",{htmlFor:f,className:m("block text-sm font-medium text-text-primary",d)},i),l__namespace.createElement("div",{className:m("relative flex flex-col gap-2 w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background disabled:opacity-50",{"ring-2 ring-primary ring-offset-2":b,"focus-within:ring-2 focus-within:ring-primary focus-within:ring-offset-2":!b})},l__namespace.createElement("div",{className:"flex relative"},l__namespace.createElement("input",{id:f,className:m("font-sans lg:text-body-default text-xs flex w-full file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text disabled:cursor-not-allowed md:text-md focus:outline-none",r&&"pr-10",e),...x}),r&&l__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center"},o?l__namespace.createElement(H,{name:o,color:n,size:s,title:p}):r)),c));var J={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},U=e=>{let[r,o]=e.split("-");return r==="heading"?J[o]||"p":r==="label"?"label":"p"},X={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},Y=e=>e?(Array.isArray(e)?e:[e]).map(o=>{if(o.includes(":")){let[n,s]=o.split(":");return `${n}:text-${s}`}return `text-${o}`}).join(" "):"text-body-default",M=l__namespace.default.forwardRef(({variant:e="body-default",color:r="primary",as:o,className:n,children:s,weight:p,...i},d)=>{let f=Y(e),c=r==="inherit"?"text-inherit":`text-text-${r}`,b=l__namespace.default.useMemo(()=>{let E=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return U(E)},[e]);return l__namespace.default.createElement(o||b,{ref:d,className:`font-sans antialiased ${f} ${c} ${p?`!${X[p]}`:""} ${n??""}`,...i},s)});M.displayName="Text";var I="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var G=({value:e,label:r,onChange:o,selected:n,color:s,disabled:p,className:i})=>l__namespace.default.createElement("button",{type:"button",disabled:p,className:m("relative w-full text-left px-2 py-1.5 text-sm rounded","cursor-pointer hover:bg-gray-100","disabled:opacity-50 disabled:cursor-not-allowed",n&&"bg-gray-100","flex items-center gap-2",I,i),onClick:()=>{o?.(e);}},l__namespace.default.createElement(M,{variant:"body-default-medium",color:s==="danger"?"danger":"inherit"},r));var Pe=({options:e,placeholder:r="Select an item...",value:o,onChange:n,end:s,className:p,label:i,labelClassName:d,id:f,disabled:c,container:b})=>{let[x,E]=l.useState(!1),[T,v]=l.useState(""),[N,w]=l.useState({}),y=l.useMemo(()=>e.length>0&&"options"in e[0],[e]),A=l.useMemo(()=>y?e.reduce((t,a)=>[...t,...a.options],[]):e,[y,e]),B=l.useMemo(()=>o===void 0?"":A.find(a=>a.value===o)?.label?.toString()||"",[o,A]),O=l.useMemo(()=>{if(!y){let t=e.filter(a=>T&&typeof a.label=="string"?a.label.toLowerCase().includes(T.toLowerCase()):!0);return t.length>0?[{label:"",options:t}]:[]}return e.map(t=>({...t,options:t.options.filter(a=>T&&typeof a.label=="string"?a.label.toLowerCase().includes(T.toLowerCase()):!0)})).filter(t=>t.options.length>0)},[y,e,T]),z=l.useCallback(t=>{n(t),E(!1),v("");},[n]),K=l.useCallback(t=>{w(a=>({...a,[t]:!a[t]}));},[]);return l__namespace.default.useEffect(()=>{if(y){let t=e.reduce((a,L)=>({...a,[L.label]:!0}),{});w(t);}},[y,e]),l__namespace.default.createElement(g__namespace.Root,{open:x&&!c,onOpenChange:t=>{c||(E(t),t||v(""));}},l__namespace.default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${p}`},l__namespace.default.createElement(g__namespace.Trigger,{asChild:!0},l__namespace.default.createElement("button",{type:"button",className:"w-full text-left",disabled:c},l__namespace.default.createElement(k,{id:f,label:i,labelClassName:d,placeholder:r,value:B,onChange:t=>v(t.target.value),end:s,className:"flex-1",forceShowFocusRing:x,disabled:c}))),l__namespace.default.createElement(g__namespace.Portal,{container:b},l__namespace.default.createElement(g__namespace.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-[9999] data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out",sideOffset:5,side:"bottom",align:"start"},l__namespace.default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},O.length>0?O.map((t,a)=>l__namespace.default.createElement(h__namespace.Root,{key:t.label||a,className:"w-full",open:N[t.label]??!0,onOpenChange:()=>t.label&&K(t.label)},t.label&&l__namespace.default.createElement(h__namespace.Trigger,{asChild:!0},l__namespace.default.createElement("button",{className:"w-full flex items-center justify-between px-2 py-1.5 hover:bg-gray-50"},l__namespace.default.createElement(M,{variant:"body-default-bold",color:"secondary"},t.label),l__namespace.default.createElement(H,{name:"arrow-down",className:m("transition-transform",N[t.label]&&"rotate-180"),size:16}))),l__namespace.default.createElement(h__namespace.Content,{className:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up"},t.options.map((L,F)=>l__namespace.default.createElement(G,{onChange:z,value:L.value,key:`${a}-${F}`,label:L.label,className:"pl-4"}))))):l__namespace.default.createElement("div",{className:"px-2 py-1.5 text-sm text-gray-500"},"No results found"))))))};exports.Combobox=Pe;//# sourceMappingURL=Combobox.cjs.map
1
+ 'use strict';var l=require('react'),g=require('@radix-ui/react-popover'),h=require('@radix-ui/react-collapsible'),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 l__namespace=/*#__PURE__*/_interopNamespace(l);var g__namespace=/*#__PURE__*/_interopNamespace(g);var h__namespace=/*#__PURE__*/_interopNamespace(h);function m(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var S={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},Q={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},D=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],o={},n;return r.forEach(s=>{if(typeof s=="number")n=`${s}px`;else {let[p,i]=s.split(":"),d=parseInt(i,10);o[`@media (min-width: ${Q[p]})`]=`${d}px`;}}),{width:n||"24px",height:n||"24px",...Object.entries(o).reduce((s,[p,i])=>({...s,[p]:{width:i,height:i}}),{})}},H=l__namespace.default.forwardRef(({name:e,size:r=24,color:o="primary",title:n,className:s,style:p={},...i},d)=>{let u=icons.IconMap[e],c=D(r);return l__namespace.default.createElement("div",{className:m("flex justify-center items-center",s),style:{...c,"--icon-stroke":S[o],...p}},l__namespace.default.createElement(u,{ref:d,"aria-hidden":!n,"aria-label":n,stroke:e.includes("filled")?void 0:S[o],...i}))});H.displayName="Icon";var k=({className:e,end:r,iconName:o,color:n,size:s,title:p,label:i,labelClassName:d,id:u,children:c,forceShowFocusRing:b,...x})=>l__namespace.createElement("div",{className:"py-2"},i&&l__namespace.createElement("label",{htmlFor:u,className:m("block text-sm font-medium text-text-primary",d)},i),l__namespace.createElement("div",{className:m("relative flex flex-col gap-2 w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background disabled:opacity-50",{"ring-2 ring-primary ring-offset-2":b,"focus-within:ring-2 focus-within:ring-primary focus-within:ring-offset-2":!b})},l__namespace.createElement("div",{className:"flex relative"},l__namespace.createElement("input",{id:u,className:m("font-sans lg:text-body-default text-xs flex w-full file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text disabled:cursor-not-allowed md:text-md focus:outline-none",r&&"pr-10",e),...x}),r&&l__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center"},o?l__namespace.createElement(H,{name:o,color:n,size:s,title:p}):r)),c));var J={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},U=e=>{let[r,o]=e.split("-");return r==="heading"?J[o]||"p":r==="label"?"label":"p"},X={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},Y=e=>e?(Array.isArray(e)?e:[e]).map(o=>{if(o.includes(":")){let[n,s]=o.split(":");return `${n}:text-${s}`}return `text-${o}`}).join(" "):"text-body-default",M=l__namespace.default.forwardRef(({variant:e="body-default",color:r="primary",as:o,className:n,children:s,weight:p,...i},d)=>{let u=Y(e),c=r==="inherit"?"text-inherit":`text-text-${r}`,b=l__namespace.default.useMemo(()=>{let E=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return U(E)},[e]);return l__namespace.default.createElement(o||b,{ref:d,className:`font-sans antialiased ${u} ${c} ${p?`!${X[p]}`:""} ${n??""}`,...i},s)});M.displayName="Text";var I="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var G=({value:e,label:r,onChange:o,selected:n,color:s,disabled:p,className:i})=>l__namespace.default.createElement("button",{type:"button",disabled:p,className:m("relative w-full text-left px-2 py-1.5 text-sm rounded","cursor-pointer hover:bg-gray-100","disabled:opacity-50 disabled:cursor-not-allowed",n&&"bg-gray-100","flex items-center gap-2",I,i),onClick:()=>{o?.(e);}},l__namespace.default.createElement(M,{variant:"body-default-medium",color:s==="danger"?"danger":"inherit"},r));var Pe=({options:e,placeholder:r="Select an item...",value:o,onChange:n,end:s,className:p,label:i,labelClassName:d,id:u,disabled:c,container:b})=>{let[x,E]=l.useState(!1),[T,v]=l.useState(""),[N,w]=l.useState({}),y=l.useMemo(()=>e.length>0&&"options"in e[0],[e]),A=l.useMemo(()=>y?e.reduce((t,a)=>[...t,...a.options],[]):e,[y,e]),B=l.useMemo(()=>o===void 0?"":A.find(a=>a.value===o)?.label?.toString()||"",[o,A]),O=l.useMemo(()=>{if(!y){let t=e.filter(a=>T&&typeof a.label=="string"?a.label.toLowerCase().includes(T.toLowerCase()):!0);return t.length>0?[{label:"",options:t}]:[]}return e.map(t=>({...t,options:t.options.filter(a=>T&&typeof a.label=="string"?a.label.toLowerCase().includes(T.toLowerCase()):!0)})).filter(t=>t.options.length>0)},[y,e,T]),z=l.useCallback(t=>{n(t),E(!1),v("");},[n]),K=l.useCallback(t=>{w(a=>({...a,[t]:!a[t]}));},[]);return l__namespace.default.useEffect(()=>{if(y){let t=e.reduce((a,L)=>({...a,[L.label]:!0}),{});w(t);}},[y,e]),l__namespace.default.createElement(g__namespace.Root,{open:x&&!c,onOpenChange:t=>{c||(E(t),t||v(""));}},l__namespace.default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${p}`},l__namespace.default.createElement(g__namespace.Trigger,{asChild:!0},l__namespace.default.createElement("button",{type:"button",className:"w-full text-left",disabled:c},l__namespace.default.createElement(k,{id:u,label:i,labelClassName:d,placeholder:r,value:B,onChange:t=>v(t.target.value),end:s,className:"flex-1",forceShowFocusRing:x,disabled:c}))),l__namespace.default.createElement(g__namespace.Portal,{container:b},l__namespace.default.createElement(g__namespace.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border z-[9999] data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out",side:"bottom",align:"start"},l__namespace.default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},O.length>0?O.map((t,a)=>l__namespace.default.createElement(h__namespace.Root,{key:t.label||a,className:"w-full",open:N[t.label]??!0,onOpenChange:()=>t.label&&K(t.label)},t.label&&l__namespace.default.createElement(h__namespace.Trigger,{asChild:!0},l__namespace.default.createElement("button",{className:"w-full flex items-center justify-between px-2 py-1.5 hover:bg-gray-50"},l__namespace.default.createElement(M,{variant:"body-default-bold",color:"secondary"},t.label),l__namespace.default.createElement(H,{name:"arrow-down",className:m("transition-transform",N[t.label]&&"rotate-180"),size:16}))),l__namespace.default.createElement(h__namespace.Content,{className:"data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up"},t.options.map((L,F)=>l__namespace.default.createElement(G,{onChange:z,value:L.value,key:`${a}-${F}`,label:L.label,className:"pl-4"}))))):l__namespace.default.createElement("div",{className:"px-2 py-1.5 text-sm text-gray-500"},"No results found"))))))};exports.Combobox=Pe;//# sourceMappingURL=Combobox.cjs.map
2
2
  //# sourceMappingURL=Combobox.cjs.map