@deckai/deck-ui 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/README.md +4 -2
  2. package/dist/components/AboutCard.cjs +1 -9
  3. package/dist/components/AboutCard.cjs.map +1 -1
  4. package/dist/components/AboutCard.js +1 -9
  5. package/dist/components/AboutCard.js.map +1 -1
  6. package/dist/components/Accordion.cjs +2 -0
  7. package/dist/components/Accordion.cjs.map +1 -0
  8. package/dist/components/Accordion.js +2 -0
  9. package/dist/components/Accordion.js.map +1 -0
  10. package/dist/components/AddWorkCard.cjs +117 -0
  11. package/dist/components/AddWorkCard.cjs.map +1 -0
  12. package/dist/components/AddWorkCard.js +117 -0
  13. package/dist/components/AddWorkCard.js.map +1 -0
  14. package/dist/components/Avatar.cjs +1 -1
  15. package/dist/components/Avatar.cjs.map +1 -1
  16. package/dist/components/Avatar.js +1 -1
  17. package/dist/components/Avatar.js.map +1 -1
  18. package/dist/components/Badge.cjs +1 -1
  19. package/dist/components/Badge.cjs.map +1 -1
  20. package/dist/components/Badge.js +1 -1
  21. package/dist/components/Badge.js.map +1 -1
  22. package/dist/components/Breadcrumbs.cjs +1 -1
  23. package/dist/components/Breadcrumbs.cjs.map +1 -1
  24. package/dist/components/Breadcrumbs.js +1 -1
  25. package/dist/components/Breadcrumbs.js.map +1 -1
  26. package/dist/components/Button.cjs +2 -2
  27. package/dist/components/Button.cjs.map +1 -1
  28. package/dist/components/Button.js +2 -2
  29. package/dist/components/Button.js.map +1 -1
  30. package/dist/components/Carousel.cjs +2 -0
  31. package/dist/components/Carousel.cjs.map +1 -0
  32. package/dist/components/Carousel.js +2 -0
  33. package/dist/components/Carousel.js.map +1 -0
  34. package/dist/components/Collapsible.cjs +1 -1
  35. package/dist/components/Collapsible.cjs.map +1 -1
  36. package/dist/components/Collapsible.js +1 -1
  37. package/dist/components/Collapsible.js.map +1 -1
  38. package/dist/components/Combobox.cjs +1 -1
  39. package/dist/components/Combobox.cjs.map +1 -1
  40. package/dist/components/Combobox.js +1 -1
  41. package/dist/components/Combobox.js.map +1 -1
  42. package/dist/components/ContactItem.cjs +1 -1
  43. package/dist/components/ContactItem.cjs.map +1 -1
  44. package/dist/components/ContactItem.js +1 -1
  45. package/dist/components/ContactItem.js.map +1 -1
  46. package/dist/components/Dropdown.cjs +2 -0
  47. package/dist/components/Dropdown.cjs.map +1 -0
  48. package/dist/components/Dropdown.js +2 -0
  49. package/dist/components/Dropdown.js.map +1 -0
  50. package/dist/components/EditButton.cjs +2 -2
  51. package/dist/components/EditButton.cjs.map +1 -1
  52. package/dist/components/EditButton.js +2 -2
  53. package/dist/components/EditButton.js.map +1 -1
  54. package/dist/components/Icon.cjs +1 -1
  55. package/dist/components/Icon.cjs.map +1 -1
  56. package/dist/components/Icon.js +1 -1
  57. package/dist/components/Icon.js.map +1 -1
  58. package/dist/components/Input.cjs +1 -1
  59. package/dist/components/Input.cjs.map +1 -1
  60. package/dist/components/Input.js +1 -1
  61. package/dist/components/Input.js.map +1 -1
  62. package/dist/components/Link.cjs +1 -1
  63. package/dist/components/Link.cjs.map +1 -1
  64. package/dist/components/Link.js +1 -1
  65. package/dist/components/Link.js.map +1 -1
  66. package/dist/components/MultiSelectCombobox.cjs +1 -1
  67. package/dist/components/MultiSelectCombobox.cjs.map +1 -1
  68. package/dist/components/MultiSelectCombobox.js +1 -1
  69. package/dist/components/MultiSelectCombobox.js.map +1 -1
  70. package/dist/components/Navbar.cjs +2 -2
  71. package/dist/components/Navbar.cjs.map +1 -1
  72. package/dist/components/Navbar.js +2 -2
  73. package/dist/components/Navbar.js.map +1 -1
  74. package/dist/components/NavbarItem.cjs +1 -1
  75. package/dist/components/NavbarItem.cjs.map +1 -1
  76. package/dist/components/NavbarItem.js +1 -1
  77. package/dist/components/NavbarItem.js.map +1 -1
  78. package/dist/components/Option.cjs +1 -1
  79. package/dist/components/Option.cjs.map +1 -1
  80. package/dist/components/Option.js +1 -1
  81. package/dist/components/Option.js.map +1 -1
  82. package/dist/components/Pressable.cjs +1 -1
  83. package/dist/components/Pressable.cjs.map +1 -1
  84. package/dist/components/Pressable.js +1 -1
  85. package/dist/components/Pressable.js.map +1 -1
  86. package/dist/components/ProfileCard.cjs +1 -9
  87. package/dist/components/ProfileCard.cjs.map +1 -1
  88. package/dist/components/ProfileCard.js +1 -9
  89. package/dist/components/ProfileCard.js.map +1 -1
  90. package/dist/components/ProgressBar.cjs +2 -0
  91. package/dist/components/ProgressBar.cjs.map +1 -0
  92. package/dist/components/ProgressBar.js +2 -0
  93. package/dist/components/ProgressBar.js.map +1 -0
  94. package/dist/components/SegmentedTabs.cjs +10 -0
  95. package/dist/components/SegmentedTabs.cjs.map +1 -0
  96. package/dist/components/SegmentedTabs.js +10 -0
  97. package/dist/components/SegmentedTabs.js.map +1 -0
  98. package/dist/components/Sidebar.cjs +1 -1
  99. package/dist/components/Sidebar.cjs.map +1 -1
  100. package/dist/components/Sidebar.js +1 -1
  101. package/dist/components/Sidebar.js.map +1 -1
  102. package/dist/components/SocialCard.cjs +1 -1
  103. package/dist/components/SocialCard.cjs.map +1 -1
  104. package/dist/components/SocialCard.js +1 -1
  105. package/dist/components/SocialCard.js.map +1 -1
  106. package/dist/components/Spinner.cjs +1 -1
  107. package/dist/components/Spinner.cjs.map +1 -1
  108. package/dist/components/Spinner.js +1 -1
  109. package/dist/components/Spinner.js.map +1 -1
  110. package/dist/components/Switch.cjs +1 -1
  111. package/dist/components/Switch.cjs.map +1 -1
  112. package/dist/components/Switch.js +1 -1
  113. package/dist/components/Switch.js.map +1 -1
  114. package/dist/components/Tabs.cjs +9 -1
  115. package/dist/components/Tabs.cjs.map +1 -1
  116. package/dist/components/Tabs.js +9 -1
  117. package/dist/components/Tabs.js.map +1 -1
  118. package/dist/components/Tag.cjs +1 -1
  119. package/dist/components/Tag.cjs.map +1 -1
  120. package/dist/components/Tag.js +1 -1
  121. package/dist/components/Tag.js.map +1 -1
  122. package/dist/components/Text.cjs +1 -1
  123. package/dist/components/Text.cjs.map +1 -1
  124. package/dist/components/Text.js +1 -1
  125. package/dist/components/Text.js.map +1 -1
  126. package/dist/components/TextArea.cjs +1 -1
  127. package/dist/components/TextArea.cjs.map +1 -1
  128. package/dist/components/TextArea.js +1 -1
  129. package/dist/components/TextArea.js.map +1 -1
  130. package/dist/components/Toast.cjs +10 -0
  131. package/dist/components/Toast.cjs.map +1 -0
  132. package/dist/components/Toast.js +10 -0
  133. package/dist/components/Toast.js.map +1 -0
  134. package/dist/components/ToastProvider.cjs +2 -0
  135. package/dist/components/ToastProvider.cjs.map +1 -0
  136. package/dist/components/ToastProvider.js +2 -0
  137. package/dist/components/ToastProvider.js.map +1 -0
  138. package/dist/components/Tooltip.cjs +1 -1
  139. package/dist/components/Tooltip.cjs.map +1 -1
  140. package/dist/components/Tooltip.js +1 -1
  141. package/dist/components/Tooltip.js.map +1 -1
  142. package/dist/components/WorkCard.cjs +1 -1
  143. package/dist/components/WorkCard.cjs.map +1 -1
  144. package/dist/components/WorkCard.js +1 -1
  145. package/dist/components/WorkCard.js.map +1 -1
  146. package/dist/index.cjs +111 -3
  147. package/dist/index.cjs.map +1 -1
  148. package/dist/index.js +111 -3
  149. package/dist/index.js.map +1 -1
  150. package/dist/styles/styles.css +1 -1
  151. package/package.json +7 -2
  152. package/dist/components/AboutCard.d.cts +0 -13
  153. package/dist/components/AboutCard.d.ts +0 -13
  154. package/dist/components/Avatar.d.cts +0 -12
  155. package/dist/components/Avatar.d.ts +0 -12
  156. package/dist/components/Badge.d.cts +0 -13
  157. package/dist/components/Badge.d.ts +0 -13
  158. package/dist/components/Breadcrumbs.d.cts +0 -15
  159. package/dist/components/Breadcrumbs.d.ts +0 -15
  160. package/dist/components/Button.d.cts +0 -38
  161. package/dist/components/Button.d.ts +0 -38
  162. package/dist/components/Collapsible.d.cts +0 -12
  163. package/dist/components/Collapsible.d.ts +0 -12
  164. package/dist/components/Combobox.d.cts +0 -20
  165. package/dist/components/Combobox.d.ts +0 -20
  166. package/dist/components/ContactItem.d.cts +0 -10
  167. package/dist/components/ContactItem.d.ts +0 -10
  168. package/dist/components/EditButton.d.cts +0 -12
  169. package/dist/components/EditButton.d.ts +0 -12
  170. package/dist/components/Icon.d.cts +0 -19
  171. package/dist/components/Icon.d.ts +0 -19
  172. package/dist/components/IconRenderer.d.cts +0 -13
  173. package/dist/components/IconRenderer.d.ts +0 -13
  174. package/dist/components/Illustration.d.cts +0 -10
  175. package/dist/components/Illustration.d.ts +0 -10
  176. package/dist/components/Input.d.cts +0 -18
  177. package/dist/components/Input.d.ts +0 -18
  178. package/dist/components/Link.d.cts +0 -13
  179. package/dist/components/Link.d.ts +0 -13
  180. package/dist/components/Logo.d.cts +0 -8
  181. package/dist/components/Logo.d.ts +0 -8
  182. package/dist/components/MultiSelectCombobox.d.cts +0 -21
  183. package/dist/components/MultiSelectCombobox.d.ts +0 -21
  184. package/dist/components/Navbar.d.cts +0 -19
  185. package/dist/components/Navbar.d.ts +0 -19
  186. package/dist/components/NavbarItem.d.cts +0 -13
  187. package/dist/components/NavbarItem.d.ts +0 -13
  188. package/dist/components/Option.d.cts +0 -11
  189. package/dist/components/Option.d.ts +0 -11
  190. package/dist/components/Pressable.d.cts +0 -6
  191. package/dist/components/Pressable.d.ts +0 -6
  192. package/dist/components/ProfileCard.d.cts +0 -17
  193. package/dist/components/ProfileCard.d.ts +0 -17
  194. package/dist/components/Sidebar.d.cts +0 -37
  195. package/dist/components/Sidebar.d.ts +0 -37
  196. package/dist/components/SocialCard.d.cts +0 -12
  197. package/dist/components/SocialCard.d.ts +0 -12
  198. package/dist/components/Spinner.d.cts +0 -19
  199. package/dist/components/Spinner.d.ts +0 -19
  200. package/dist/components/Switch.d.cts +0 -13
  201. package/dist/components/Switch.d.ts +0 -13
  202. package/dist/components/Tabs.d.cts +0 -16
  203. package/dist/components/Tabs.d.ts +0 -16
  204. package/dist/components/Tag.d.cts +0 -12
  205. package/dist/components/Tag.d.ts +0 -12
  206. package/dist/components/Text.d.cts +0 -46
  207. package/dist/components/Text.d.ts +0 -46
  208. package/dist/components/TextArea.d.cts +0 -19
  209. package/dist/components/TextArea.d.ts +0 -19
  210. package/dist/components/Tooltip.d.cts +0 -13
  211. package/dist/components/Tooltip.d.ts +0 -13
  212. package/dist/components/WorkCard.d.cts +0 -13
  213. package/dist/components/WorkCard.d.ts +0 -13
  214. package/dist/index.d.cts +0 -153
  215. package/dist/index.d.ts +0 -153
  216. package/dist/styles/fonts.d.cts +0 -2
  217. package/dist/styles/fonts.d.ts +0 -2
  218. package/dist/styles/styles.d.cts +0 -2
  219. package/dist/styles/styles.d.ts +0 -2
  220. package/dist/tailwind-CIZ10fKA.d.cts +0 -36
  221. package/dist/tailwind-CIZ10fKA.d.ts +0 -36
@@ -1,2 +1,2 @@
1
- import i,{useCallback,useEffect,useMemo,useState}from'react';import*as r from'@radix-ui/react-dialog';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';var S=typeof window<"u"?useEffect:()=>{},h=e=>{let[n,s]=useState(null),t=useCallback(o=>typeof window<"u"?window.matchMedia(o).matches:!1,[]);return S(()=>{s(t(e));},[e,t]),useEffect(()=>{if(typeof window<"u"){let o=window.matchMedia(e),a=()=>{s(t(e));};return o.addEventListener("change",a),()=>{o.removeEventListener("change",a);}}},[e,t]),n??!1};function p(...e){return twMerge(clsx(e))}var y={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},M={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},I=e=>{if(!e)return {width:"24px",height:"24px"};let n=Array.isArray(e)?e:[e],s={},t;return n.forEach(o=>{if(typeof o=="number")t=`${o}px`;else {let[a,l]=o.split(":"),c=parseInt(l,10);s[`@media (min-width: ${M[a]})`]=`${c}px`;}}),{width:t||"24px",height:t||"24px",...Object.entries(s).reduce((o,[a,l])=>({...o,[a]:{width:l,height:l}}),{})}},g=i.forwardRef(({name:e,size:n=24,color:s="primary",title:t,className:o,style:a={},...l},c)=>{let f=IconMap[e],d=I(n);return i.createElement("div",{className:p("flex justify-center items-center",o),style:{...d,"--icon-stroke":y[s],...a}},i.createElement(f,{ref:c,"aria-hidden":!t,"aria-label":t,stroke:e.includes("filled")?void 0:y[s],...l}))});g.displayName="Icon";var x="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var v=({children:e,type:n="button",className:s,disabled:t,...o})=>i.createElement("button",{type:n,disabled:t,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${x} ${s} ${t?"opacity-50 cursor-not-allowed":""}`,...o},e);var te=({children:e,open:n,onClose:s,width:t=480,className:o,title:a,footer:l,position:c="left"})=>{let f=h("(max-width: 834px)"),d=useCallback(w=>{w.key==="Escape"&&s();},[s]);useEffect(()=>(n?(document.addEventListener("keydown",d),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",d),document.body.style.overflow="unset"),()=>{document.removeEventListener("keydown",d),document.body.style.overflow="unset";}),[n,d]);let m=useMemo(()=>c==="right"?{position:"right-0",enter:"data-[state=open]:animate-slide-in-from-right",exit:"data-[state=closed]:animate-slide-out-to-right",transform:"translate-x-full"}:{position:"left-0",enter:"data-[state=open]:animate-slide-in-from-left",exit:"data-[state=closed]:animate-slide-out-to-left",transform:"-translate-x-full"},[c]);return i.createElement(r.Root,{open:n,onOpenChange:s},i.createElement(r.Portal,null,i.createElement(r.Overlay,{className:p("fixed inset-0 z-50 bg-sidebarOverlay backdrop-blur-[2px]","data-[state=open]:animate-overlay-show","data-[state=closed]:animate-overlay-hide")}),i.createElement(r.Content,{className:p("fixed top-0 z-50 flex h-full flex-col bg-white",m.position,m.enter,m.exit,typeof window>"u"||!f?c==="right"?"border-l":"border-r":"w-full","border-stroke",o),style:{width:typeof window>"u"||!f?t:"100%"}},i.createElement("div",{className:"flex items-center justify-between border-b border-secondary-50 px-8 py-6"},i.createElement(r.Title,{className:"text-heading-xs text-center w-full"},a),i.createElement(r.Close,{asChild:!0},i.createElement(v,{className:"inline-flex items-center justify-center text-text-secondary hover:bg-secondary-100 rounded-lg","aria-label":"Close"},i.createElement(g,{name:"close",size:12})))),i.createElement("div",{className:"flex-1 overflow-y-auto p-6"},e),l&&i.createElement("div",{className:"px-6 pb-6"},l))))};if (exports.default) module.exports = exports.default;export{te as Sidebar};//# sourceMappingURL=Sidebar.js.map
1
+ import a,{useCallback,useEffect,useMemo,useState}from'react';import*as n from'@radix-ui/react-dialog';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';var $=typeof window<"u"?useEffect:()=>{},h=e=>{let[i,s]=useState(null),t=useCallback(o=>typeof window<"u"?window.matchMedia(o).matches:!1,[]);return $(()=>{s(t(e));},[e,t]),useEffect(()=>{if(typeof window<"u"){let o=window.matchMedia(e),r=()=>{s(t(e));};return o.addEventListener("change",r),()=>{o.removeEventListener("change",r);}}},[e,t]),i??!1};function c(...e){return twMerge(clsx(e))}var x={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},I={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},N=e=>{if(!e)return {width:"24px",height:"24px"};let i=Array.isArray(e)?e:[e],s={},t;return i.forEach(o=>{if(typeof o=="number")t=`${o}px`;else {let[r,l]=o.split(":"),d=parseInt(l,10);s[`@media (min-width: ${I[r]})`]=`${d}px`;}}),{width:t||"24px",height:t||"24px",...Object.entries(s).reduce((o,[r,l])=>({...o,[r]:{width:l,height:l}}),{})}},g=a.forwardRef(({name:e,size:i=24,color:s="primary",title:t,className:o,style:r={},...l},d)=>{let f=IconMap[e],p=N(i);return a.createElement("div",{className:c("flex justify-center items-center",o),style:{...p,"--icon-stroke":x[s],...r}},a.createElement(f,{ref:d,"aria-hidden":!t,"aria-label":t,stroke:e.includes("filled")?void 0:x[s],...l}))});g.displayName="Icon";var v="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var b=a.forwardRef(({children:e,type:i="button",className:s,disabled:t,...o},r)=>a.createElement("button",{ref:r,type:i,disabled:t,className:c("appearance-none hover:opacity-80 transition-all active:scale-95",v,t&&"opacity-50 cursor-not-allowed",s),...o},e));b.displayName="Pressable";var oe=({children:e,open:i,onClose:s,width:t=480,className:o,title:r,footer:l,position:d="left"})=>{let f=h("(max-width: 834px)"),p=useCallback(C=>{C.key==="Escape"&&s();},[s]);useEffect(()=>(i?(document.addEventListener("keydown",p),document.body.style.overflow="hidden"):(document.removeEventListener("keydown",p),document.body.style.overflow="unset"),()=>{document.removeEventListener("keydown",p),document.body.style.overflow="unset";}),[i,p]);let m=useMemo(()=>d==="right"?{position:"right-0",enter:"data-[state=open]:animate-slide-in-from-right",exit:"data-[state=closed]:animate-slide-out-to-right",transform:"translate-x-full"}:{position:"left-0",enter:"data-[state=open]:animate-slide-in-from-left",exit:"data-[state=closed]:animate-slide-out-to-left",transform:"-translate-x-full"},[d]);return a.createElement(n.Root,{open:i,onOpenChange:s},a.createElement(n.Portal,null,a.createElement(n.Overlay,{className:c("fixed inset-0 z-50 bg-sidebarOverlay backdrop-blur-[2px]","data-[state=open]:animate-overlay-show","data-[state=closed]:animate-overlay-hide")}),a.createElement(n.Content,{className:c("fixed top-0 z-50 flex h-full flex-col bg-white",m.position,m.enter,m.exit,typeof window>"u"||!f?d==="right"?"border-l":"border-r":"w-full","border-stroke",o),style:{width:typeof window>"u"||!f?t:"100%"}},a.createElement("div",{className:"flex items-center justify-between border-b border-secondary-50 px-8 py-6"},a.createElement(n.Title,{className:"text-heading-xs text-center w-full"},r),a.createElement(n.Close,{asChild:!0},a.createElement(b,{className:"inline-flex items-center justify-center text-text-secondary hover:bg-secondary-100 rounded-lg","aria-label":"Close"},a.createElement(g,{name:"close",size:12})))),a.createElement("div",{className:"flex-1 overflow-y-auto p-6"},e),l&&a.createElement("div",{className:"px-6 pb-6 bg-background"},l))))};if (exports.default) module.exports = exports.default;export{oe as Sidebar};//# sourceMappingURL=Sidebar.js.map
2
2
  //# sourceMappingURL=Sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hooks/useMediaQuery.ts","../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/utils/tailwind.ts","../../src/components/Pressable.tsx","../../src/components/Sidebar.tsx"],"names":["useIsomorphicLayoutEffect","useEffect","useMediaQuery","query","matches","setMatches","useState","getMatches","useCallback","mediaQuery","handleChange","cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","focusRingStyles","Pressable","children","type","disabled","Sidebar","open","onClose","width","footer","position","isMobile","handleEscapeKey","event","positionClasses","useMemo"],"mappings":"uMAEA,IAAMA,CACJ,CAAA,OAAO,MAAW,CAAA,GAAA,CAAcC,UAAY,IAAM,EAEvCC,CAAAA,CAAAA,CAAiBC,GAA2B,CAEvD,GAAM,CAACC,CAAAA,CAASC,CAAU,CAAIC,CAAAA,QAAAA,CAAyB,IAAI,CAAA,CAErDC,EAAaC,WAAaL,CAAAA,CAAAA,EAC1B,OAAO,MAAA,CAAW,IACb,MAAO,CAAA,UAAA,CAAWA,CAAK,CAAA,CAAE,QAE3B,CACN,CAAA,CAAA,EAAE,CAAA,CAGL,OAAAH,CAA0B,CAAA,IAAM,CAC9BK,CAAAA,CAAWE,EAAWJ,CAAK,CAAC,EAC9B,CAAA,CAAG,CAACA,CAAOI,CAAAA,CAAU,CAAC,CAAA,CAEtBN,UAAU,IAAM,CACd,GAAI,OAAO,OAAW,GAAa,CAAA,CACjC,IAAMQ,CAAAA,CAAa,MAAO,CAAA,UAAA,CAAWN,CAAK,CAAA,CAEpCO,EAAe,IAAM,CACzBL,CAAWE,CAAAA,CAAAA,CAAWJ,CAAK,CAAC,EAC9B,CAEA,CAAA,OAAAM,EAAW,gBAAiB,CAAA,QAAA,CAAUC,CAAY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A,+FAAA,CACV,aAAW,OAEXZ,CAAAA,CAAAA,CAAAA,CAAA,aAACD,CAAAA,CAAAA,CAAA,CAAK,IAAK,CAAA,OAAA,CAAQ,IAAM,CAAA,EAAA,CAAI,CAC/B,CACF,CACF,CAGAC,CAAAA,CAAAA,CAAA,cAAC,KAAI,CAAA,CAAA,SAAA,CAAU,4BAA8Ba,CAAAA,CAAAA,CAAS,EAGrDO,CAAUpB,EAAAA,CAAAA,CAAA,aAAC,CAAA,KAAA,CAAA,CAAI,UAAU,WAAaoB,CAAAA,CAAAA,CAAO,CAChD,CACF,CACF,CAEJ","file":"Sidebar.js","sourcesContent":["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 { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","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\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React, { useCallback, useEffect, useMemo, type ReactNode } from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { useMediaQuery } from \"../hooks/useMediaQuery\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type SidebarProps = {\n /**\n * The content to be rendered inside the sidebar\n */\n children: ReactNode;\n /**\n * Whether the sidebar is open\n */\n open: boolean;\n /**\n * Callback fired when the sidebar is closed\n */\n onClose: () => void;\n /** @default left */\n position?: \"left\" | \"right\";\n /**\n * The width of the sidebar on desktop. Defaults to 480px.\n */\n width?: number;\n /**\n * Additional class names to be applied to the sidebar\n */\n className?: string;\n /**\n * The title to display in the header\n */\n title?: string;\n /**\n * Optional footer content\n */\n footer?: ReactNode;\n};\n\nexport const Sidebar = ({\n children,\n open,\n onClose,\n width = 480,\n className,\n title,\n footer,\n position = \"left\"\n}: SidebarProps) => {\n const isMobile = useMediaQuery(\"(max-width: 834px)\");\n\n // Handle escape key press\n const handleEscapeKey = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onClose();\n }\n },\n [onClose]\n );\n\n useEffect(() => {\n if (open) {\n document.addEventListener(\"keydown\", handleEscapeKey);\n // Prevent body scroll when sidebar is open\n document.body.style.overflow = \"hidden\";\n } else {\n // Ensure we clean up when sidebar is closed\n document.removeEventListener(\"keydown\", handleEscapeKey);\n document.body.style.overflow = \"unset\";\n }\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscapeKey);\n document.body.style.overflow = \"unset\";\n };\n }, [open, handleEscapeKey]);\n\n const positionClasses = useMemo(\n () =>\n position === \"right\"\n ? {\n position: \"right-0\",\n enter: \"data-[state=open]:animate-slide-in-from-right\",\n exit: \"data-[state=closed]:animate-slide-out-to-right\",\n transform: \"translate-x-full\"\n }\n : {\n position: \"left-0\",\n enter: \"data-[state=open]:animate-slide-in-from-left\",\n exit: \"data-[state=closed]:animate-slide-out-to-left\",\n transform: \"-translate-x-full\"\n },\n [position]\n );\n\n return (\n <Dialog.Root open={open} onOpenChange={onClose}>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-sidebarOverlay backdrop-blur-[2px]\",\n \"data-[state=open]:animate-overlay-show\",\n \"data-[state=closed]:animate-overlay-hide\"\n )}\n />\n <Dialog.Content\n className={cn(\n \"fixed top-0 z-50 flex h-full flex-col bg-white\",\n positionClasses.position,\n positionClasses.enter,\n positionClasses.exit,\n // During SSR, default to desktop layout\n typeof window === \"undefined\" || !isMobile\n ? position === \"right\"\n ? \"border-l\"\n : \"border-r\"\n : \"w-full\",\n \"border-stroke\",\n className\n )}\n style={{\n width: typeof window === \"undefined\" || !isMobile ? width : \"100%\"\n }}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-secondary-50 px-8 py-6\">\n <Dialog.Title className=\"text-heading-xs text-center w-full\">\n {title}\n </Dialog.Title>\n <Dialog.Close asChild>\n <Pressable\n className=\"inline-flex items-center justify-center text-text-secondary hover:bg-secondary-100 rounded-lg\"\n aria-label=\"Close\"\n >\n <Icon name=\"close\" size={12} />\n </Pressable>\n </Dialog.Close>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-6\">{children}</div>\n\n {/* Footer */}\n {footer && <div className=\"px-6 pb-6\">{footer}</div>}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../src/hooks/useMediaQuery.ts","../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Pressable.tsx","../../src/utils/tailwind.ts","../../src/components/Sidebar.tsx"],"names":["useIsomorphicLayoutEffect","useEffect","useMediaQuery","query","matches","setMatches","useState","getMatches","useCallback","mediaQuery","handleChange","cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","focusRingStyles","Pressable","children","type","disabled","Sidebar","open","onClose","width","footer","position","isMobile","handleEscapeKey","event","positionClasses","useMemo"],"mappings":"uMAEA,IAAMA,EACJ,OAAO,MAAA,CAAW,GAAcC,CAAAA,SAAAA,CAAY,IAAM,EAAC,CAExCC,CAAiBC,CAAAA,CAAAA,EAA2B,CAEvD,GAAM,CAACC,CAASC,CAAAA,CAAU,EAAIC,QAAyB,CAAA,IAAI,CAErDC,CAAAA,CAAAA,CAAaC,YAAaL,CAC1B,EAAA,OAAO,MAAW,CAAA,GAAA,CACb,OAAO,UAAWA,CAAAA,CAAK,CAAE,CAAA,OAAA,CAE3B,GACN,EAAE,CAGL,CAAA,OAAAH,EAA0B,IAAM,CAC9BK,CAAWE,CAAAA,CAAAA,CAAWJ,CAAK,CAAC,EAC9B,CAAG,CAAA,CAACA,EAAOI,CAAU,CAAC,CAEtBN,CAAAA,SAAAA,CAAU,IAAM,CACd,GAAI,OAAO,MAAA,CAAW,IAAa,CACjC,IAAMQ,CAAa,CAAA,MAAA,CAAO,WAAWN,CAAK,CAAA,CAEpCO,CAAe,CAAA,IAAM,CACzBL,CAAWE,CAAAA,CAAAA,CAAWJ,CAAK,CAAC,EAC9B,CAEA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A,cAAQ,CAAP,CAAA,KAAA,CAAA,CAAa,OAAO,CAAA,CAAA,CAAA,CAAA,CACnBA,EAAA,aAACY,CAAAA,CAAAA,CAAA,CACC,SAAA,CAAU,gGACV,YAAW,CAAA,OAAA,CAAA,CAEXZ,CAAA,CAAA,aAAA,CAACD,EAAA,CAAK,IAAA,CAAK,OAAQ,CAAA,IAAA,CAAM,GAAI,CAC/B,CACF,CACF,CAAA,CAGAC,EAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,4BAAA,CAAA,CAA8Ba,CAAS,CAGrDO,CAAAA,CAAAA,EAAUpB,CAAA,CAAA,aAAA,CAAC,OAAI,SAAU,CAAA,yBAAA,CAAA,CAA2BoB,CAAO,CAC9D,CACF,CACF,CAEJ","file":"Sidebar.js","sourcesContent":["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 { 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, useMemo, type ReactNode } from \"react\";\nimport * as Dialog from \"@radix-ui/react-dialog\";\nimport { useMediaQuery } from \"../hooks/useMediaQuery\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\nimport { Pressable } from \"./Pressable\";\n\nexport type SidebarProps = {\n /**\n * The content to be rendered inside the sidebar\n */\n children: ReactNode;\n /**\n * Whether the sidebar is open\n */\n open: boolean;\n /**\n * Callback fired when the sidebar is closed\n */\n onClose: () => void;\n /** @default left */\n position?: \"left\" | \"right\";\n /**\n * The width of the sidebar on desktop. Defaults to 480px.\n */\n width?: number;\n /**\n * Additional class names to be applied to the sidebar\n */\n className?: string;\n /**\n * The title to display in the header\n */\n title?: string;\n /**\n * Optional footer content\n */\n footer?: ReactNode;\n};\n\nexport const Sidebar = ({\n children,\n open,\n onClose,\n width = 480,\n className,\n title,\n footer,\n position = \"left\"\n}: SidebarProps) => {\n const isMobile = useMediaQuery(\"(max-width: 834px)\");\n\n // Handle escape key press\n const handleEscapeKey = useCallback(\n (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onClose();\n }\n },\n [onClose]\n );\n\n useEffect(() => {\n if (open) {\n document.addEventListener(\"keydown\", handleEscapeKey);\n // Prevent body scroll when sidebar is open\n document.body.style.overflow = \"hidden\";\n } else {\n // Ensure we clean up when sidebar is closed\n document.removeEventListener(\"keydown\", handleEscapeKey);\n document.body.style.overflow = \"unset\";\n }\n\n return () => {\n document.removeEventListener(\"keydown\", handleEscapeKey);\n document.body.style.overflow = \"unset\";\n };\n }, [open, handleEscapeKey]);\n\n const positionClasses = useMemo(\n () =>\n position === \"right\"\n ? {\n position: \"right-0\",\n enter: \"data-[state=open]:animate-slide-in-from-right\",\n exit: \"data-[state=closed]:animate-slide-out-to-right\",\n transform: \"translate-x-full\"\n }\n : {\n position: \"left-0\",\n enter: \"data-[state=open]:animate-slide-in-from-left\",\n exit: \"data-[state=closed]:animate-slide-out-to-left\",\n transform: \"-translate-x-full\"\n },\n [position]\n );\n\n return (\n <Dialog.Root open={open} onOpenChange={onClose}>\n <Dialog.Portal>\n <Dialog.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-sidebarOverlay backdrop-blur-[2px]\",\n \"data-[state=open]:animate-overlay-show\",\n \"data-[state=closed]:animate-overlay-hide\"\n )}\n />\n <Dialog.Content\n className={cn(\n \"fixed top-0 z-50 flex h-full flex-col bg-white\",\n positionClasses.position,\n positionClasses.enter,\n positionClasses.exit,\n // During SSR, default to desktop layout\n typeof window === \"undefined\" || !isMobile\n ? position === \"right\"\n ? \"border-l\"\n : \"border-r\"\n : \"w-full\",\n \"border-stroke\",\n className\n )}\n style={{\n width: typeof window === \"undefined\" || !isMobile ? width : \"100%\"\n }}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between border-b border-secondary-50 px-8 py-6\">\n <Dialog.Title className=\"text-heading-xs text-center w-full\">\n {title}\n </Dialog.Title>\n <Dialog.Close asChild>\n <Pressable\n className=\"inline-flex items-center justify-center text-text-secondary hover:bg-secondary-100 rounded-lg\"\n aria-label=\"Close\"\n >\n <Icon name=\"close\" size={12} />\n </Pressable>\n </Dialog.Close>\n </div>\n\n {/* Content */}\n <div className=\"flex-1 overflow-y-auto p-6\">{children}</div>\n\n {/* Footer */}\n {footer && <div className=\"px-6 pb-6 bg-background\">{footer}</div>}\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n );\n};\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var n=require('react'),icons=require('@deckai/icons'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var n__default=/*#__PURE__*/_interopDefault(n);var g="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var u=({children:e,type:r="button",className:t,disabled:o,...s})=>n__default.default.createElement("button",{type:r,disabled:o,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${g} ${t} ${o?"opacity-50 cursor-not-allowed":""}`,...s},e);function f(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var h={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},C={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},$=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],t={},o;return r.forEach(s=>{if(typeof s=="number")o=`${s}px`;else {let[a,i]=s.split(":"),l=parseInt(i,10);t[`@media (min-width: ${C[a]})`]=`${l}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(t).reduce((s,[a,i])=>({...s,[a]:{width:i,height:i}}),{})}},p=n__default.default.forwardRef(({name:e,size:r=24,color:t="primary",title:o,className:s,style:a={},...i},l)=>{let c=icons.IconMap[e],y=$(r);return n__default.default.createElement("div",{className:f("flex justify-center items-center",s),style:{...y,"--icon-stroke":h[t],...a}},n__default.default.createElement(c,{ref:l,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:h[t],...i}))});p.displayName="Icon";var R={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},S=e=>{let[r,t]=e.split("-");return r==="heading"?R[t]||"p":r==="label"?"label":"p"},A={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},P=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[o,s]=t.split(":");return `${o}:text-${s}`}return `text-${t}`}).join(" "):"text-body-default",m=n__default.default.forwardRef(({variant:e="body-default",color:r="text-primary",as:t,className:o,children:s,weight:a,...i},l)=>{let c=P(e),y=r&&r==="inherit"?"inherit":r?`text-${r}`:"",b=n__default.default.useMemo(()=>{let x=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return S(x)},[e]);return n__default.default.createElement(t||b,{ref:l,className:`font-sans antialiased ${c} ${y} ${a?`!${A[a]}`:""} ${o??""}`,...i},s)});m.displayName="Text";var Z=({icon:e,followers:r,engagement:t,...o})=>n__default.default.createElement(u,{className:"sm:w-max w-full hover:bg-secondary-400",...o},n__default.default.createElement("div",{className:"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg"},n__default.default.createElement(p,{name:e,size:["lg:40",32],color:"primaryBlue"}),n__default.default.createElement("div",{className:"flex items-center sm:pt-0 pt-3"},n__default.default.createElement(p,{name:"profile",size:["sm:20",16]}),n__default.default.createElement(m,{variant:["body-default-medium","md:body-xs-medium"]},r)),n__default.default.createElement("div",{className:"flex items-center"},n__default.default.createElement(p,{name:"like-1",size:["sm:20",16]}),n__default.default.createElement(m,{variant:["body-default-medium","md:body-xs-medium"]},t))));if (exports.default) module.exports = exports.default;exports.SocialCard=Z;//# sourceMappingURL=SocialCard.cjs.map
1
+ 'use strict';var a=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var a__default=/*#__PURE__*/_interopDefault(a);var f="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";function m(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var g=a__default.default.forwardRef(({children:e,type:o="button",className:t,disabled:r,...s},n)=>a__default.default.createElement("button",{ref:n,type:o,disabled:r,className:m("appearance-none hover:opacity-80 transition-all active:scale-95",f,r&&"opacity-50 cursor-not-allowed",t),...s},e));g.displayName="Pressable";var b={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},$={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},R=e=>{if(!e)return {width:"24px",height:"24px"};let o=Array.isArray(e)?e:[e],t={},r;return o.forEach(s=>{if(typeof s=="number")r=`${s}px`;else {let[n,i]=s.split(":"),p=parseInt(i,10);t[`@media (min-width: ${$[n]})`]=`${p}px`;}}),{width:r||"24px",height:r||"24px",...Object.entries(t).reduce((s,[n,i])=>({...s,[n]:{width:i,height:i}}),{})}},l=a__default.default.forwardRef(({name:e,size:o=24,color:t="primary",title:r,className:s,style:n={},...i},p)=>{let d=icons.IconMap[e],y=R(o);return a__default.default.createElement("div",{className:m("flex justify-center items-center",s),style:{...y,"--icon-stroke":b[t],...n}},a__default.default.createElement(d,{ref:p,"aria-hidden":!r,"aria-label":r,stroke:e.includes("filled")?void 0:b[t],...i}))});l.displayName="Icon";var A={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},C=e=>{let[o,t]=e.split("-");return o==="heading"?A[t]||"p":o==="label"?"label":"p"},P={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},S=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[r,s]=t.split(":");return `${r}:text-${s}`}return `text-${t}`}).join(" "):"text-body-default",c=a__default.default.forwardRef(({variant:e="body-default",color:o="primary",as:t,className:r,children:s,weight:n,...i},p)=>{let d=S(e),y=o==="inherit"?"text-inherit":`text-text-${o}`,x=a__default.default.useMemo(()=>{let H=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return C(H)},[e]);return a__default.default.createElement(t||x,{ref:p,className:`font-sans antialiased ${d} ${y} ${n?`!${P[n]}`:""} ${r??""}`,...i},s)});c.displayName="Text";var ee=({icon:e,followers:o,engagement:t,...r})=>a__default.default.createElement(g,{className:"sm:w-max w-full hover:bg-secondary-400",...r},a__default.default.createElement("div",{className:"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg"},a__default.default.createElement(l,{name:e,size:["lg:40",32],color:"primaryBlue"}),a__default.default.createElement("div",{className:"flex items-center sm:pt-0 pt-3"},a__default.default.createElement(l,{name:"profile",size:["sm:20",16]}),a__default.default.createElement(c,{variant:["body-default-medium","md:body-xs-medium"]},o)),a__default.default.createElement("div",{className:"flex items-center"},a__default.default.createElement(l,{name:"like-1",size:["sm:20",16]}),a__default.default.createElement(c,{variant:["body-default-medium","md:body-xs-medium"]},t))));if (exports.default) module.exports = exports.default;exports.SocialCard=ee;//# sourceMappingURL=SocialCard.cjs.map
2
2
  //# sourceMappingURL=SocialCard.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/components/Pressable.tsx","../../src/components/Icon.tsx","../../src/utils/index.ts","../../src/components/Text.tsx","../../src/components/SocialCard.tsx"],"names":["focusRingStyles","Pressable","children","type","className","disabled","props","React","cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","name","color","title","style","ref","IconComponent","IconMap","sizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","SocialCard","icon","followers","engagement","pressableProps"],"mappings":"gPAmEO,IAAMA,CAAAA,CACX,qGC/DK,CAAA,IAAMC,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AAAC,CAAAA,CAAAA,CACA,GAAGC,CACL,IACE9C,kBAAA,CAAA,aAAA,CAACN,CAAA,CAAA,CACC,UAAU,wCACT,CAAA,GAAGoD,CAEJ9C,CAAAA,CAAAA,kBAAAA,CAAA,cAAC,KAAI,CAAA,CAAA,SAAA,CAAU,8GACbA,CAAAA,CAAAA,kBAAAA,CAAA,aAACkB,CAAAA,CAAAA,CAAA,CAAK,IAAA,CAAMyB,EAAM,IAAM,CAAA,CAAC,OAAS,CAAA,EAAE,CAAG,CAAA,KAAA,CAAM,aAAc,CAAA,CAAA,CAC3D3C,mBAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,gCAAA,CAAA,CACbA,kBAAA,CAAA,aAAA,CAACkB,CAAA,CAAA,CAAK,KAAK,SAAU,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAG,CAAA,CAAA,CAC1ClB,kBAAA,CAAA,aAAA,CAACmC,EAAA,CAAK,OAAA,CAAS,CAAC,qBAAA,CAAuB,mBAAmB,CAAA,CAAA,CACvDS,CACH,CACF,EACA5C,kBAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,qBACbA,kBAAA,CAAA,aAAA,CAACkB,CAAA,CAAA,CAAK,KAAK,QAAS,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAA,CAAG,CACzClB,CAAAA,kBAAAA,CAAA,cAACmC,CAAA,CAAA,CAAK,OAAS,CAAA,CAAC,sBAAuB,mBAAmB,CAAA,CAAA,CACvDU,CACH,CACF,CACF,CACF","file":"SocialCard.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 React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React from \"react\";\nimport {\n Colors,\n TextColorVariant,\n PrimaryShades,\n SecondaryShades,\n TertiaryShades,\n Typography\n} from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype ColorCategory = keyof Omit<Colors, \"stroke\" | \"background\">;\ntype ColorValue<T extends ColorCategory> = T extends \"text\"\n ? TextColorVariant\n : T extends \"primary\"\n ? keyof PrimaryShades\n : T extends \"secondary\"\n ? keyof SecondaryShades\n : T extends \"tertiary\"\n ? keyof TertiaryShades\n : never;\n\ntype ColorKey = {\n [T in ColorCategory]: `${T}-${ColorValue<T>}`;\n}[ColorCategory];\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: ColorKey | \"inherit\";\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"text-primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color && color === \"inherit\" ? \"inherit\" : color ? `text-${color}` : \"\";\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React from \"react\";\nimport { Pressable, PressableProps } from \"./Pressable\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\nimport { IconName } from \"@deckai/icons\";\n\nexport type SocialCardProps = {\n icon: IconName;\n followers: string;\n engagement: string;\n} & PressableProps;\n\nexport const SocialCard = ({\n icon,\n followers,\n engagement,\n ...pressableProps\n}: SocialCardProps) => (\n <Pressable\n className=\"sm:w-max w-full hover:bg-secondary-400\"\n {...pressableProps}\n >\n <div className=\"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg\">\n <Icon name={icon} size={[\"lg:40\", 32]} color=\"primaryBlue\" />\n <div className=\"flex items-center sm:pt-0 pt-3\">\n <Icon name=\"profile\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {followers}\n </Text>\n </div>\n <div className=\"flex items-center\">\n <Icon name=\"like-1\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {engagement}\n </Text>\n </div>\n </div>\n </Pressable>\n);\n"]}
1
+ {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Pressable.tsx","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/SocialCard.tsx"],"names":["focusRingStyles","cn","inputs","twMerge","clsx","Pressable","React","children","type","className","disabled","props","ref","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","name","color","title","style","IconComponent","IconMap","sizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","SocialCard","icon","followers","engagement","pressableProps"],"mappings":"gPAmEO,IAAMA,CAAAA,CACX,qGCpEF,CAGO,SAASC,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1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AA,SAAA,CAAAC,CACA,CAAA,UAAA,CAAAC,CACA,CAAA,GAAGC,CACL,CACE/C,GAAAA,kBAAAA,CAAA,aAACD,CAAAA,CAAAA,CAAA,CACC,SAAU,CAAA,wCAAA,CACT,GAAGgD,CAAAA,CAAAA,CAEJ/C,mBAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,8GAAA,CAAA,CACbA,kBAAA,CAAA,aAAA,CAACoB,CAAA,CAAA,CAAK,KAAMwB,CAAM,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAG,CAAA,KAAA,CAAM,aAAc,CAAA,CAAA,CAC3D5C,mBAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,gCAAA,CAAA,CACbA,kBAAA,CAAA,aAAA,CAACoB,CAAA,CAAA,CAAK,KAAK,SAAU,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAG,CAAA,CAAA,CAC1CpB,kBAAA,CAAA,aAAA,CAACoC,EAAA,CAAK,OAAA,CAAS,CAAC,qBAAA,CAAuB,mBAAmB,CAAA,CAAA,CACvDS,CACH,CACF,EACA7C,kBAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,qBACbA,kBAAA,CAAA,aAAA,CAACoB,CAAA,CAAA,CAAK,KAAK,QAAS,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAA,CAAG,CACzCpB,CAAAA,kBAAAA,CAAA,cAACoC,CAAA,CAAA,CAAK,OAAS,CAAA,CAAC,sBAAuB,mBAAmB,CAAA,CAAA,CACvDU,CACH,CACF,CACF,CACF","file":"SocialCard.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, { 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 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 from \"react\";\nimport { Pressable, PressableProps } from \"./Pressable\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\nimport { IconName } from \"@deckai/icons\";\n\nexport type SocialCardProps = {\n icon: IconName;\n followers: string;\n engagement: string;\n} & PressableProps;\n\nexport const SocialCard = ({\n icon,\n followers,\n engagement,\n ...pressableProps\n}: SocialCardProps) => (\n <Pressable\n className=\"sm:w-max w-full hover:bg-secondary-400\"\n {...pressableProps}\n >\n <div className=\"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg\">\n <Icon name={icon} size={[\"lg:40\", 32]} color=\"primaryBlue\" />\n <div className=\"flex items-center sm:pt-0 pt-3\">\n <Icon name=\"profile\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {followers}\n </Text>\n </div>\n <div className=\"flex items-center\">\n <Icon name=\"like-1\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {engagement}\n </Text>\n </div>\n </div>\n </Pressable>\n);\n"]}
@@ -1,2 +1,2 @@
1
- import n from'react';import {IconMap}from'@deckai/icons';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var g="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var u=({children:e,type:r="button",className:t,disabled:o,...s})=>n.createElement("button",{type:r,disabled:o,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${g} ${t} ${o?"opacity-50 cursor-not-allowed":""}`,...s},e);function f(...e){return twMerge(clsx(e))}var h={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},C={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},$=e=>{if(!e)return {width:"24px",height:"24px"};let r=Array.isArray(e)?e:[e],t={},o;return r.forEach(s=>{if(typeof s=="number")o=`${s}px`;else {let[a,i]=s.split(":"),l=parseInt(i,10);t[`@media (min-width: ${C[a]})`]=`${l}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(t).reduce((s,[a,i])=>({...s,[a]:{width:i,height:i}}),{})}},p=n.forwardRef(({name:e,size:r=24,color:t="primary",title:o,className:s,style:a={},...i},l)=>{let c=IconMap[e],y=$(r);return n.createElement("div",{className:f("flex justify-center items-center",s),style:{...y,"--icon-stroke":h[t],...a}},n.createElement(c,{ref:l,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:h[t],...i}))});p.displayName="Icon";var R={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},S=e=>{let[r,t]=e.split("-");return r==="heading"?R[t]||"p":r==="label"?"label":"p"},A={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},P=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[o,s]=t.split(":");return `${o}:text-${s}`}return `text-${t}`}).join(" "):"text-body-default",m=n.forwardRef(({variant:e="body-default",color:r="text-primary",as:t,className:o,children:s,weight:a,...i},l)=>{let c=P(e),y=r&&r==="inherit"?"inherit":r?`text-${r}`:"",b=n.useMemo(()=>{let x=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return S(x)},[e]);return n.createElement(t||b,{ref:l,className:`font-sans antialiased ${c} ${y} ${a?`!${A[a]}`:""} ${o??""}`,...i},s)});m.displayName="Text";var Z=({icon:e,followers:r,engagement:t,...o})=>n.createElement(u,{className:"sm:w-max w-full hover:bg-secondary-400",...o},n.createElement("div",{className:"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg"},n.createElement(p,{name:e,size:["lg:40",32],color:"primaryBlue"}),n.createElement("div",{className:"flex items-center sm:pt-0 pt-3"},n.createElement(p,{name:"profile",size:["sm:20",16]}),n.createElement(m,{variant:["body-default-medium","md:body-xs-medium"]},r)),n.createElement("div",{className:"flex items-center"},n.createElement(p,{name:"like-1",size:["sm:20",16]}),n.createElement(m,{variant:["body-default-medium","md:body-xs-medium"]},t))));if (exports.default) module.exports = exports.default;export{Z as SocialCard};//# sourceMappingURL=SocialCard.js.map
1
+ import a from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';var f="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";function m(...e){return twMerge(clsx(e))}var g=a.forwardRef(({children:e,type:o="button",className:t,disabled:r,...s},n)=>a.createElement("button",{ref:n,type:o,disabled:r,className:m("appearance-none hover:opacity-80 transition-all active:scale-95",f,r&&"opacity-50 cursor-not-allowed",t),...s},e));g.displayName="Pressable";var b={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB",disabled:"#888888"},$={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},R=e=>{if(!e)return {width:"24px",height:"24px"};let o=Array.isArray(e)?e:[e],t={},r;return o.forEach(s=>{if(typeof s=="number")r=`${s}px`;else {let[n,i]=s.split(":"),p=parseInt(i,10);t[`@media (min-width: ${$[n]})`]=`${p}px`;}}),{width:r||"24px",height:r||"24px",...Object.entries(t).reduce((s,[n,i])=>({...s,[n]:{width:i,height:i}}),{})}},l=a.forwardRef(({name:e,size:o=24,color:t="primary",title:r,className:s,style:n={},...i},p)=>{let d=IconMap[e],y=R(o);return a.createElement("div",{className:m("flex justify-center items-center",s),style:{...y,"--icon-stroke":b[t],...n}},a.createElement(d,{ref:p,"aria-hidden":!r,"aria-label":r,stroke:e.includes("filled")?void 0:b[t],...i}))});l.displayName="Icon";var A={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},C=e=>{let[o,t]=e.split("-");return o==="heading"?A[t]||"p":o==="label"?"label":"p"},P={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},S=e=>e?(Array.isArray(e)?e:[e]).map(t=>{if(t.includes(":")){let[r,s]=t.split(":");return `${r}:text-${s}`}return `text-${t}`}).join(" "):"text-body-default",c=a.forwardRef(({variant:e="body-default",color:o="primary",as:t,className:r,children:s,weight:n,...i},p)=>{let d=S(e),y=o==="inherit"?"text-inherit":`text-text-${o}`,x=a.useMemo(()=>{let H=typeof e=="string"?e.split(":").pop():Array.isArray(e)?e[0].split(":").pop():"body-default";return C(H)},[e]);return a.createElement(t||x,{ref:p,className:`font-sans antialiased ${d} ${y} ${n?`!${P[n]}`:""} ${r??""}`,...i},s)});c.displayName="Text";var ee=({icon:e,followers:o,engagement:t,...r})=>a.createElement(g,{className:"sm:w-max w-full hover:bg-secondary-400",...r},a.createElement("div",{className:"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg"},a.createElement(l,{name:e,size:["lg:40",32],color:"primaryBlue"}),a.createElement("div",{className:"flex items-center sm:pt-0 pt-3"},a.createElement(l,{name:"profile",size:["sm:20",16]}),a.createElement(c,{variant:["body-default-medium","md:body-xs-medium"]},o)),a.createElement("div",{className:"flex items-center"},a.createElement(l,{name:"like-1",size:["sm:20",16]}),a.createElement(c,{variant:["body-default-medium","md:body-xs-medium"]},t))));if (exports.default) module.exports = exports.default;export{ee as SocialCard};//# sourceMappingURL=SocialCard.js.map
2
2
  //# sourceMappingURL=SocialCard.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/components/Pressable.tsx","../../src/components/Icon.tsx","../../src/utils/index.ts","../../src/components/Text.tsx","../../src/components/SocialCard.tsx"],"names":["focusRingStyles","Pressable","children","type","className","disabled","props","React","cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","name","color","title","style","ref","IconComponent","IconMap","sizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","SocialCard","icon","followers","engagement","pressableProps"],"mappings":"sHAmEO,IAAMA,CAAAA,CACX,qGC/DK,CAAA,IAAMC,CAAsC,CAAA,CAAC,CAClD,QAAA,CAAAC,EACA,IAAAC,CAAAA,CAAAA,CAAO,QACP,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UAAU,wCACT,CAAA,GAAGoD,CAEJ9C,CAAAA,CAAAA,CAAAA,CAAA,cAAC,KAAI,CAAA,CAAA,SAAA,CAAU,8GACbA,CAAAA,CAAAA,CAAAA,CAAA,aAACkB,CAAAA,CAAAA,CAAA,CAAK,IAAA,CAAMyB,EAAM,IAAM,CAAA,CAAC,OAAS,CAAA,EAAE,CAAG,CAAA,KAAA,CAAM,aAAc,CAAA,CAAA,CAC3D3C,EAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,gCAAA,CAAA,CACbA,CAAA,CAAA,aAAA,CAACkB,CAAA,CAAA,CAAK,KAAK,SAAU,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAG,CAAA,CAAA,CAC1ClB,CAAA,CAAA,aAAA,CAACmC,EAAA,CAAK,OAAA,CAAS,CAAC,qBAAA,CAAuB,mBAAmB,CAAA,CAAA,CACvDS,CACH,CACF,EACA5C,CAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,qBACbA,CAAA,CAAA,aAAA,CAACkB,CAAA,CAAA,CAAK,KAAK,QAAS,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAA,CAAG,CACzClB,CAAAA,CAAAA,CAAA,cAACmC,CAAA,CAAA,CAAK,OAAS,CAAA,CAAC,sBAAuB,mBAAmB,CAAA,CAAA,CACvDU,CACH,CACF,CACF,CACF","file":"SocialCard.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 React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React from \"react\";\nimport {\n Colors,\n TextColorVariant,\n PrimaryShades,\n SecondaryShades,\n TertiaryShades,\n Typography\n} from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype ColorCategory = keyof Omit<Colors, \"stroke\" | \"background\">;\ntype ColorValue<T extends ColorCategory> = T extends \"text\"\n ? TextColorVariant\n : T extends \"primary\"\n ? keyof PrimaryShades\n : T extends \"secondary\"\n ? keyof SecondaryShades\n : T extends \"tertiary\"\n ? keyof TertiaryShades\n : never;\n\ntype ColorKey = {\n [T in ColorCategory]: `${T}-${ColorValue<T>}`;\n}[ColorCategory];\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: ColorKey | \"inherit\";\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"text-primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color && color === \"inherit\" ? \"inherit\" : color ? `text-${color}` : \"\";\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React from \"react\";\nimport { Pressable, PressableProps } from \"./Pressable\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\nimport { IconName } from \"@deckai/icons\";\n\nexport type SocialCardProps = {\n icon: IconName;\n followers: string;\n engagement: string;\n} & PressableProps;\n\nexport const SocialCard = ({\n icon,\n followers,\n engagement,\n ...pressableProps\n}: SocialCardProps) => (\n <Pressable\n className=\"sm:w-max w-full hover:bg-secondary-400\"\n {...pressableProps}\n >\n <div className=\"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg\">\n <Icon name={icon} size={[\"lg:40\", 32]} color=\"primaryBlue\" />\n <div className=\"flex items-center sm:pt-0 pt-3\">\n <Icon name=\"profile\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {followers}\n </Text>\n </div>\n <div className=\"flex items-center\">\n <Icon name=\"like-1\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {engagement}\n </Text>\n </div>\n </div>\n </Pressable>\n);\n"]}
1
+ {"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Pressable.tsx","../../src/components/Icon.tsx","../../src/components/Text.tsx","../../src/components/SocialCard.tsx"],"names":["focusRingStyles","cn","inputs","twMerge","clsx","Pressable","React","children","type","className","disabled","props","ref","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","name","color","title","style","IconComponent","IconMap","sizeStyles","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","SocialCard","icon","followers","engagement","pressableProps"],"mappings":"sHAmEO,IAAMA,CAAAA,CACX,qGCpEF,CAGO,SAASC,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCCO,IAAMG,CAAYC,CAAAA,CAAAA,CAAM,UAC7B,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A,CAAA,CACC,SAAU,CAAA,wCAAA,CACT,GAAGgD,CAAAA,CAAAA,CAEJ/C,EAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,8GAAA,CAAA,CACbA,CAAA,CAAA,aAAA,CAACoB,CAAA,CAAA,CAAK,KAAMwB,CAAM,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAG,CAAA,KAAA,CAAM,aAAc,CAAA,CAAA,CAC3D5C,EAAA,aAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,gCAAA,CAAA,CACbA,CAAA,CAAA,aAAA,CAACoB,CAAA,CAAA,CAAK,KAAK,SAAU,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAG,CAAA,CAAA,CAC1CpB,CAAA,CAAA,aAAA,CAACoC,EAAA,CAAK,OAAA,CAAS,CAAC,qBAAA,CAAuB,mBAAmB,CAAA,CAAA,CACvDS,CACH,CACF,EACA7C,CAAA,CAAA,aAAA,CAAC,KAAI,CAAA,CAAA,SAAA,CAAU,qBACbA,CAAA,CAAA,aAAA,CAACoB,CAAA,CAAA,CAAK,KAAK,QAAS,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAA,CAAG,CACzCpB,CAAAA,CAAAA,CAAA,cAACoC,CAAA,CAAA,CAAK,OAAS,CAAA,CAAC,sBAAuB,mBAAmB,CAAA,CAAA,CACvDU,CACH,CACF,CACF,CACF","file":"SocialCard.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, { 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 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 from \"react\";\nimport { Pressable, PressableProps } from \"./Pressable\";\nimport { Icon } from \"./Icon\";\nimport { Text } from \"./Text\";\nimport { IconName } from \"@deckai/icons\";\n\nexport type SocialCardProps = {\n icon: IconName;\n followers: string;\n engagement: string;\n} & PressableProps;\n\nexport const SocialCard = ({\n icon,\n followers,\n engagement,\n ...pressableProps\n}: SocialCardProps) => (\n <Pressable\n className=\"sm:w-max w-full hover:bg-secondary-400\"\n {...pressableProps}\n >\n <div className=\"flex sm:flex-row flex-col items-center sm:gap-4 gap-1 sm:px-6 sm:py-4 p-2 border border-secondary rounded-lg\">\n <Icon name={icon} size={[\"lg:40\", 32]} color=\"primaryBlue\" />\n <div className=\"flex items-center sm:pt-0 pt-3\">\n <Icon name=\"profile\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {followers}\n </Text>\n </div>\n <div className=\"flex items-center\">\n <Icon name=\"like-1\" size={[\"sm:20\", 16]} />\n <Text variant={[\"body-default-medium\", \"md:body-xs-medium\"]}>\n {engagement}\n </Text>\n </div>\n </div>\n </Pressable>\n);\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var d=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var d__namespace=/*#__PURE__*/_interopNamespace(d);var f=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,y=clsx.clsx,V=(t,r)=>e=>{var o;if(r?.variants==null)return y(t,e?.class,e?.className);let{variants:u,defaultVariants:a}=r,b=Object.keys(u).map(n=>{let s=e?.[n],l=a?.[n];if(s===null)return null;let i=f(s)||f(l);return u[n][i]}),c=e&&Object.entries(e).reduce((n,s)=>{let[l,i]=s;return i===void 0||(n[l]=i),n},{}),x=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((n,s)=>{let{class:l,className:i,...h}=s;return Object.entries(h).every(N=>{let[v,m]=N;return Array.isArray(m)?m.includes({...a,...c}[v]):{...a,...c}[v]===m})?[...n,l,i]:n},[]);return y(t,b,x,e?.class,e?.className)};function p(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var g=V("animate-spin rounded-full border-current border-t-transparent",{variants:{size:{sm:"h-4 w-4 border-4",md:"h-6 w-6 border-4",lg:"h-8 w-8 border-8"}},defaultVariants:{size:"md"}}),M=d__namespace.forwardRef(({size:t,className:r,customSize:e,...o},u)=>{let a=e?{width:e,height:e,borderWidth:Math.max(2,Math.floor(e/16))}:{};return d__namespace.createElement("div",{role:"status","aria-label":"Loading",ref:u,className:p(g({size:t}),"text-primary-100",r),style:a,...o},d__namespace.createElement("span",{className:"sr-only"},"Loading..."))});M.displayName="Spinner";if (exports.default) module.exports = exports.default;exports.Spinner=M;//# sourceMappingURL=Spinner.cjs.map
1
+ 'use strict';var d=require('react'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var d__namespace=/*#__PURE__*/_interopNamespace(d);var f=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,y=clsx.clsx,V=(t,r)=>e=>{var o;if(r?.variants==null)return y(t,e?.class,e?.className);let{variants:u,defaultVariants:a}=r,b=Object.keys(u).map(n=>{let s=e?.[n],l=a?.[n];if(s===null)return null;let i=f(s)||f(l);return u[n][i]}),c=e&&Object.entries(e).reduce((n,s)=>{let[l,i]=s;return i===void 0||(n[l]=i),n},{}),x=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((n,s)=>{let{class:l,className:i,...h}=s;return Object.entries(h).every(N=>{let[v,m]=N;return Array.isArray(m)?m.includes({...a,...c}[v]):{...a,...c}[v]===m})?[...n,l,i]:n},[]);return y(t,b,x,e?.class,e?.className)};function p(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var g=V("animate-spin rounded-full border-current border-t-transparent",{variants:{size:{sm:"h-4 w-4 border-3",md:"h-6 w-6 border-4",lg:"h-8 w-8 border-8"}},defaultVariants:{size:"md"}}),M=d__namespace.forwardRef(({size:t,className:r,customSize:e,...o},u)=>{let a=e?{width:e,height:e,borderWidth:Math.max(2,Math.floor(e/16))}:{};return d__namespace.createElement("div",{role:"status","aria-label":"Loading",ref:u,className:p(g({size:t}),"text-primary-100",r),style:a,...o},d__namespace.createElement("span",{className:"sr-only"},"Loading..."))});M.displayName="Spinner";if (exports.default) module.exports = exports.default;exports.Spinner=M;//# sourceMappingURL=Spinner.cjs.map
2
2
  //# sourceMappingURL=Spinner.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/class-variance-authority/dist/index.mjs","../../src/utils/index.ts","../../src/components/Spinner.tsx"],"names":["falsyToString","value","cx","clsx","cva","base","config","props","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","cn","inputs","twMerge","spinnerVariants","Spinner","d","size","className","customSize","ref","styles"],"mappings":"ucAeA,IAAMA,CAAAA,CAAiBC,CAAQ,EAAA,OAAOA,GAAU,SAAY,CAAA,CAAA,EAAGA,CAAK,CAAA,CAAA,CAAKA,IAAU,CAAI,CAAA,GAAA,CAAMA,CAChFC,CAAAA,CAAAA,CAAKC,UACLC,CAAM,CAAA,CAACC,CAAMC,CAAAA,CAAAA,GAAUC,GAAQ,CACpC,IAAIC,CACJ,CAAA,GAAqDF,GAAO,QAAa,EAAA,IAAA,CAAM,OAAOJ,CAAAA,CAAGG,EAAoDE,CAAM,EAAA,KAAA,CAAqDA,CAAM,EAAA,SAAS,EACvN,GAAM,CAAE,QAAAE,CAAAA,CAAAA,CAAU,gBAAAC,CAAgB,CAAA,CAAIJ,CAChCK,CAAAA,CAAAA,CAAuB,OAAO,IAAKF,CAAAA,CAAQ,CAAE,CAAA,GAAA,CAAKG,GAAU,CAC9D,IAAMC,CAA4DN,CAAAA,CAAAA,GAAMK,CAAO,CACzEE,CAAAA,C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","file":"Spinner.cjs","sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\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 * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst spinnerVariants = cva(\n \"animate-spin rounded-full border-current border-t-transparent\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 border-4\",\n md: \"h-6 w-6 border-4\",\n lg: \"h-8 w-8 border-8\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport type SpinnerProps = {\n className?: string;\n customSize?: number;\n} & VariantProps<typeof spinnerVariants>;\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ size, className, customSize, ...props }, ref) => {\n const styles = customSize\n ? {\n width: customSize,\n height: customSize,\n borderWidth: Math.max(2, Math.floor(customSize / 16))\n }\n : {};\n\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n ref={ref}\n className={cn(spinnerVariants({ size }), \"text-primary-100\", className)}\n style={styles}\n {...props}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n"]}
1
+ {"version":3,"sources":["../../../../node_modules/class-variance-authority/dist/index.mjs","../../src/utils/index.ts","../../src/components/Spinner.tsx"],"names":["falsyToString","value","cx","clsx","cva","base","config","props","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","cn","inputs","twMerge","spinnerVariants","Spinner","d","size","className","customSize","ref","styles"],"mappings":"ucAeA,IAAMA,CAAAA,CAAiBC,CAAQ,EAAA,OAAOA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,KAAOA,CAAAA,CAAAA,CACP,MAAQA,CAAAA,CAAAA,CACR,YAAa,IAAK,CAAA,GAAA,CAAI,CAAG,CAAA,IAAA,CAAK,MAAMA,CAAa,CAAA,EAAE,CAAC,CACtD,EACA,EAAC,CAEL,OACEH,YAAA,CAAA,aAAA,CAAC,OACC,IAAK,CAAA,QAAA,CACL,YAAW,CAAA,SAAA,CACX,IAAKI,CACL,CAAA,SAAA,CAAWT,CAAGG,CAAAA,CAAAA,CAAgB,CAAE,IAAAG,CAAAA,CAAK,CAAC,CAAA,CAAG,mBAAoBC,CAAS,CAAA,CACtE,KAAOG,CAAAA,CAAAA,CACN,GAAG3B,CAEJ,CAAA,CAAAsB,YAAA,CAAA,aAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,WAAU,YAAU,CACtC,CAEJ,CACF,EAEAD,EAAQ,WAAc,CAAA,SAAA","file":"Spinner.cjs","sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\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 * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst spinnerVariants = cva(\n \"animate-spin rounded-full border-current border-t-transparent\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 border-3\",\n md: \"h-6 w-6 border-4\",\n lg: \"h-8 w-8 border-8\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport type SpinnerProps = {\n className?: string;\n customSize?: number;\n} & VariantProps<typeof spinnerVariants>;\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ size, className, customSize, ...props }, ref) => {\n const styles = customSize\n ? {\n width: customSize,\n height: customSize,\n borderWidth: Math.max(2, Math.floor(customSize / 16))\n }\n : {};\n\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n ref={ref}\n className={cn(spinnerVariants({ size }), \"text-primary-100\", className)}\n style={styles}\n {...props}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n"]}
@@ -1,2 +1,2 @@
1
- import*as d from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var f=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,y=clsx,V=(t,r)=>e=>{var o;if(r?.variants==null)return y(t,e?.class,e?.className);let{variants:u,defaultVariants:a}=r,b=Object.keys(u).map(n=>{let s=e?.[n],l=a?.[n];if(s===null)return null;let i=f(s)||f(l);return u[n][i]}),c=e&&Object.entries(e).reduce((n,s)=>{let[l,i]=s;return i===void 0||(n[l]=i),n},{}),x=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((n,s)=>{let{class:l,className:i,...h}=s;return Object.entries(h).every(N=>{let[v,m]=N;return Array.isArray(m)?m.includes({...a,...c}[v]):{...a,...c}[v]===m})?[...n,l,i]:n},[]);return y(t,b,x,e?.class,e?.className)};function p(...t){return twMerge(clsx(t))}var g=V("animate-spin rounded-full border-current border-t-transparent",{variants:{size:{sm:"h-4 w-4 border-4",md:"h-6 w-6 border-4",lg:"h-8 w-8 border-8"}},defaultVariants:{size:"md"}}),M=d.forwardRef(({size:t,className:r,customSize:e,...o},u)=>{let a=e?{width:e,height:e,borderWidth:Math.max(2,Math.floor(e/16))}:{};return d.createElement("div",{role:"status","aria-label":"Loading",ref:u,className:p(g({size:t}),"text-primary-100",r),style:a,...o},d.createElement("span",{className:"sr-only"},"Loading..."))});M.displayName="Spinner";if (exports.default) module.exports = exports.default;export{M as Spinner};//# sourceMappingURL=Spinner.js.map
1
+ import*as d from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';var f=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,y=clsx,V=(t,r)=>e=>{var o;if(r?.variants==null)return y(t,e?.class,e?.className);let{variants:u,defaultVariants:a}=r,b=Object.keys(u).map(n=>{let s=e?.[n],l=a?.[n];if(s===null)return null;let i=f(s)||f(l);return u[n][i]}),c=e&&Object.entries(e).reduce((n,s)=>{let[l,i]=s;return i===void 0||(n[l]=i),n},{}),x=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((n,s)=>{let{class:l,className:i,...h}=s;return Object.entries(h).every(N=>{let[v,m]=N;return Array.isArray(m)?m.includes({...a,...c}[v]):{...a,...c}[v]===m})?[...n,l,i]:n},[]);return y(t,b,x,e?.class,e?.className)};function p(...t){return twMerge(clsx(t))}var g=V("animate-spin rounded-full border-current border-t-transparent",{variants:{size:{sm:"h-4 w-4 border-3",md:"h-6 w-6 border-4",lg:"h-8 w-8 border-8"}},defaultVariants:{size:"md"}}),M=d.forwardRef(({size:t,className:r,customSize:e,...o},u)=>{let a=e?{width:e,height:e,borderWidth:Math.max(2,Math.floor(e/16))}:{};return d.createElement("div",{role:"status","aria-label":"Loading",ref:u,className:p(g({size:t}),"text-primary-100",r),style:a,...o},d.createElement("span",{className:"sr-only"},"Loading..."))});M.displayName="Spinner";if (exports.default) module.exports = exports.default;export{M as Spinner};//# sourceMappingURL=Spinner.js.map
2
2
  //# sourceMappingURL=Spinner.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../node_modules/class-variance-authority/dist/index.mjs","../../src/utils/index.ts","../../src/components/Spinner.tsx"],"names":["falsyToString","value","cx","clsx","cva","base","config","props","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","cn","inputs","twMerge","spinnerVariants","Spinner","size","className","customSize","ref","styles"],"mappings":"qFAeA,IAAMA,CAAAA,CAAiBC,CAAQ,EAAA,OAAOA,GAAU,SAAY,CAAA,CAAA,EAAGA,CAAK,CAAA,CAAA,CAAKA,IAAU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,CAAA,GAAA,CAAI,CAAG,CAAA,IAAA,CAAK,MAAMA,CAAa,CAAA,EAAE,CAAC,CACtD,EACA,EAAC,CAEL,OACE,CAAA,CAAA,aAAA,CAAC,OACC,IAAK,CAAA,QAAA,CACL,YAAW,CAAA,SAAA,CACX,IAAKC,CACL,CAAA,SAAA,CAAWR,CAAGG,CAAAA,CAAAA,CAAgB,CAAE,IAAAE,CAAAA,CAAK,CAAC,CAAA,CAAG,mBAAoBC,CAAS,CAAA,CACtE,KAAOG,CAAAA,CAAAA,CACN,GAAG1B,CAEJ,CAAA,CAAA,CAAA,CAAA,aAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,WAAU,YAAU,CACtC,CAEJ,CACF,EAEAqB,EAAQ,WAAc,CAAA,SAAA","file":"Spinner.js","sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\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 * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst spinnerVariants = cva(\n \"animate-spin rounded-full border-current border-t-transparent\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 border-4\",\n md: \"h-6 w-6 border-4\",\n lg: \"h-8 w-8 border-8\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport type SpinnerProps = {\n className?: string;\n customSize?: number;\n} & VariantProps<typeof spinnerVariants>;\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ size, className, customSize, ...props }, ref) => {\n const styles = customSize\n ? {\n width: customSize,\n height: customSize,\n borderWidth: Math.max(2, Math.floor(customSize / 16))\n }\n : {};\n\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n ref={ref}\n className={cn(spinnerVariants({ size }), \"text-primary-100\", className)}\n style={styles}\n {...props}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n"]}
1
+ {"version":3,"sources":["../../../../node_modules/class-variance-authority/dist/index.mjs","../../src/utils/index.ts","../../src/components/Spinner.tsx"],"names":["falsyToString","value","cx","clsx","cva","base","config","props","_config_compoundVariants","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","acc","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","cn","inputs","twMerge","spinnerVariants","Spinner","size","className","customSize","ref","styles"],"mappings":"qFAeA,IAAMA,CAAAA,CAAiBC,CAAQ,EAAA,OAAOA,GAAU,SAAY,CAAA,CAAA,EAAGA,CAAK,CAAA,CAAA,CAAKA,IAAU,CAAI,CAAA,GAAA,CAAMA,CAChFC,CAAAA,CAAAA,CAAKC,KACLC,CAAM,CAAA,CAACC,CAAMC,CAAAA,CAAAA,GAAUC,GAAQ,CACpC,IAAIC,CACJ,CAAA,GAAqDF,GAAO,QAAa,EAAA,IAAA,CAAM,OAAOJ,CAAAA,CAAGG,EAAoDE,CAAM,EAAA,KAAA,CAAqDA,CAAM,EAAA,SAAS,EACvN,GAAM,CAAE,QAAAE,CAAAA,CAAAA,CAAU,gBAAAC,CAAgB,CAAA,CAAIJ,CAChCK,CAAAA,CAAAA,CAAuB,OAAO,IAAKF,CAAAA,CAAQ,CAAE,CAAA,GAAA,CAAKG,GAAU,CAC9D,IAAMC,CAA4DN,CAAAA,CAAAA,GAAMK,CAAO,CACzEE,CAAAA,CAAAA,CAAuFJ,CAAgBE,GAAAA,CAAO,EACpH,GAAIC,CAAAA,GAAgB,IAAM,CAAA,OAAO,KACjC,IAAME,CAAAA,CAAaf,CAAca,CAAAA,CAAW,GAAKb,CAAcc,CAAAA,CAAkB,CACjF,CAAA,OAAOL,EAASG,CAAO,CAAA,CAAEG,CAAU,C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OC,OAAAA,CAAQvB,IAAKsB,CAAAA,CAAM,CAAC,CAC7B,CCDME,IAAAA,CAAAA,CAAkBvB,EACtB,+DACA,CAAA,CACE,QAAU,CAAA,CACR,KAAM,CACJ,EAAA,CAAI,kBACJ,CAAA,EAAA,CAAI,mBACJ,EAAI,CAAA,kBACN,CACF,CAAA,CACA,gBAAiB,CACf,IAAA,CAAM,IACR,CACF,CACF,CAOawB,CAAAA,CAAAA,CAAgB,CAC3B,CAAA,UAAA,CAAA,CAAC,CAAE,IAAAC,CAAAA,CAAAA,CAAM,SAAAC,CAAAA,CAAAA,CAAW,WAAAC,CAAY,CAAA,GAAGxB,CAAM,CAAA,CAAGyB,IAAQ,CAClD,IAAMC,CAASF,CAAAA,CAAAA,CACX,CACE,KAAOA,CAAAA,CAAAA,CACP,MAAQA,CAAAA,CAAAA,CACR,YAAa,IAAK,CAAA,GAAA,CAAI,CAAG,CAAA,IAAA,CAAK,MAAMA,CAAa,CAAA,EAAE,CAAC,CACtD,EACA,EAAC,CAEL,OACE,CAAA,CAAA,aAAA,CAAC,OACC,IAAK,CAAA,QAAA,CACL,YAAW,CAAA,SAAA,CACX,IAAKC,CACL,CAAA,SAAA,CAAWR,CAAGG,CAAAA,CAAAA,CAAgB,CAAE,IAAAE,CAAAA,CAAK,CAAC,CAAA,CAAG,mBAAoBC,CAAS,CAAA,CACtE,KAAOG,CAAAA,CAAAA,CACN,GAAG1B,CAEJ,CAAA,CAAA,CAAA,CAAA,aAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,WAAU,YAAU,CACtC,CAEJ,CACF,EAEAqB,EAAQ,WAAc,CAAA,SAAA","file":"Spinner.js","sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\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 * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst spinnerVariants = cva(\n \"animate-spin rounded-full border-current border-t-transparent\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 border-3\",\n md: \"h-6 w-6 border-4\",\n lg: \"h-8 w-8 border-8\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport type SpinnerProps = {\n className?: string;\n customSize?: number;\n} & VariantProps<typeof spinnerVariants>;\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ size, className, customSize, ...props }, ref) => {\n const styles = customSize\n ? {\n width: customSize,\n height: customSize,\n borderWidth: Math.max(2, Math.floor(customSize / 16))\n }\n : {};\n\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n ref={ref}\n className={cn(spinnerVariants({ size }), \"text-primary-100\", className)}\n style={styles}\n {...props}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n"]}
@@ -1,2 +1,2 @@
1
- 'use strict';var t=require('react'),e=require('@radix-ui/react-switch'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var t__namespace=/*#__PURE__*/_interopNamespace(t);var e__namespace=/*#__PURE__*/_interopNamespace(e);function i(...s){return tailwindMerge.twMerge(clsx.clsx(s))}var n="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var p=t__namespace.forwardRef(({className:s,label:o,description:r,...a},c)=>t__namespace.createElement("div",{className:"flex items-center gap-2"},t__namespace.createElement(e__namespace.Root,{className:i("peer inline-flex h-6 w-11 shrink-0 cursor-pointer","items-center rounded-full border-2 border-transparent","transition-colors focus-visible:outline-none",n,"disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary-50 data-[state=unchecked]:bg-secondary-50",s),...a,ref:c},t__namespace.createElement(e__namespace.Thumb,{className:i("pointer-events-none block h-5 w-5","rounded-full bg-white shadow-lg ring-0","transition-transform","data-[state=checked]:translate-x-5","data-[state=unchecked]:translate-x-0")})),(o||r)&&t__namespace.createElement("div",{className:"flex flex-col"},o&&t__namespace.createElement("label",{className:"text-sm font-medium text-text-primary",htmlFor:a.id},o),r&&t__namespace.createElement("span",{className:"text-xs text-text-secondary"},r))));p.displayName="Switch";if (exports.default) module.exports = exports.default;exports.Switch=p;//# sourceMappingURL=Switch.cjs.map
1
+ 'use strict';var t=require('react'),e=require('@radix-ui/react-switch'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var t__namespace=/*#__PURE__*/_interopNamespace(t);var e__namespace=/*#__PURE__*/_interopNamespace(e);function i(...s){return tailwindMerge.twMerge(clsx.clsx(s))}var n="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var p=t__namespace.forwardRef(({className:s,label:o,description:r,...a},c)=>t__namespace.createElement("div",{className:"flex items-center gap-2"},t__namespace.createElement(e__namespace.Root,{className:i("peer inline-flex h-6 w-11 shrink-0 cursor-pointer","items-center rounded-full border-2 border-transparent","transition-colors focus-visible:outline-none",n,"disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary-50 data-[state=unchecked]:bg-secondary-50",s),...a,ref:c},t__namespace.createElement(e__namespace.Thumb,{className:i("pointer-events-none block h-5 w-5","rounded-full bg-white shadow-lg ring-0","transition-transform","data-[state=checked]:translate-x-5","data-[state=unchecked]:translate-x-0")})),(o||r)&&t__namespace.createElement("div",{className:"flex flex-col"},o&&t__namespace.createElement("label",{className:"text-sm font-medium text-text",htmlFor:a.id},o),r&&t__namespace.createElement("span",{className:"text-xs text-text-secondary"},r))));p.displayName="Switch";if (exports.default) module.exports = exports.default;exports.Switch=p;//# sourceMappingURL=Switch.cjs.map
2
2
  //# sourceMappingURL=Switch.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Switch.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","Switch","t","className","label","description","props","ref","e"],"mappings":"8hBAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CC8DO,IAAMG,CACX,CAAA,qGAAA,KCxDWC,CAAe,CAAAC,YAAA,CAAA,UAAA,CAG1B,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,KAAA,CAAAC,CAAO,CAAA,WAAA,CAAAC,EAAa,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAC9CL,YAAC,CAAA,aAAA,CAAA,KAAA,CAAA,CAAI,UAAU,yBACb,CAAA,CAAAA,YAAA,CAAA,aAAA,CAAiBM,YAAhB,CAAA,IAAA,CAAA,CACC,SAAWZ,CAAAA,CAAAA,CACT,oDACA,uDACA,CAAA,8CAAA,CACAI,EACA,iDACA,CAAA,2EAAA,CACAG,CACF,CACC,CAAA,GAAGG,CACJ,CAAA,GAAA,CAAKC,CAEL,CAAA,CAAAL,YAAA,CAAA,aAAA,CAAiBM,mBAAhB,CACC,SAAA,CAAWZ,CACT,CAAA,mCAAA,CACA,wCACA,CAAA,sBAAA,CACA,qCACA,sCACF,CAAA,CACF,CACF,CAAA,CAAA,CACEQ,CAASC,EAAAA,CAAAA,GACTH,2BAAC,KAAI,CAAA,CAAA,SAAA,CAAU,iBACZE,CACC,EAAAF,YAAA,CAAA,aAAA,CAAC,SACC,SAAU,CAAA,uCAAA,CACV,OAASI,CAAAA,CAAAA,CAAM,EAEdF,CAAAA,CAAAA,CACH,EAEDC,CACC,EAAAH,YAAA,CAAA,aAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,6BAA+BG,CAAAA,CAAAA,CAAY,CAE/D,CAEJ,CACD,EAEDJ,CAAAA,CAAO,WAAc,CAAA,QAAA","file":"Switch.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: string[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import * as React from \"react\";\nimport * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\n typeof SwitchPrimitive.Root\n> & {\n label?: string;\n description?: string;\n};\n\nexport const Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitive.Root>,\n SwitchProps\n>(({ className, label, description, ...props }, ref) => (\n <div className=\"flex items-center gap-2\">\n <SwitchPrimitive.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer\",\n \"items-center rounded-full border-2 border-transparent\",\n \"transition-colors focus-visible:outline-none\",\n focusRingStyles,\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"data-[state=checked]:bg-primary-50 data-[state=unchecked]:bg-secondary-50\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5\",\n \"rounded-full bg-white shadow-lg ring-0\",\n \"transition-transform\",\n \"data-[state=checked]:translate-x-5\",\n \"data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitive.Root>\n {(label || description) && (\n <div className=\"flex flex-col\">\n {label && (\n <label\n className=\"text-sm font-medium text-text-primary\"\n htmlFor={props.id}\n >\n {label}\n </label>\n )}\n {description && (\n <span className=\"text-xs text-text-secondary\">{description}</span>\n )}\n </div>\n )}\n </div>\n));\n\nSwitch.displayName = \"Switch\";\n"]}
1
+ {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/tailwind.ts","../../src/components/Switch.tsx"],"names":["cn","inputs","twMerge","clsx","focusRingStyles","Switch","t","className","label","description","props","ref","e"],"mappings":"8hBAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,qBAAQC,CAAAA,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CC8DO,IAAMG,CACX,CAAA,qGAAA,KCxDWC,CAAe,CAAAC,YAAA,CAAA,UAAA,CAG1B,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,KAAA,CAAAC,CAAO,CAAA,WAAA,CAAAC,EAAa,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAC9CL,YAAC,CAAA,aAAA,CAAA,KAAA,CAAA,CAAI,UAAU,yBACb,CAAA,CAAAA,YAAA,CAAA,aAAA,CAAiBM,YAAhB,CAAA,IAAA,CAAA,CACC,SAAWZ,CAAAA,CAAAA,CACT,oDACA,uDACA,CAAA,8CAAA,CACAI,EACA,iDACA,CAAA,2EAAA,CACAG,CACF,CACC,CAAA,GAAGG,CACJ,CAAA,GAAA,CAAKC,CAEL,CAAA,CAAAL,YAAA,CAAA,aAAA,CAAiBM,mBAAhB,CACC,SAAA,CAAWZ,CACT,CAAA,mCAAA,CACA,wCACA,CAAA,sBAAA,CACA,qCACA,sCACF,CAAA,CACF,CACF,CAAA,CAAA,CACEQ,CAASC,EAAAA,CAAAA,GACTH,2BAAC,KAAI,CAAA,CAAA,SAAA,CAAU,iBACZE,CACC,EAAAF,YAAA,CAAA,aAAA,CAAC,SAAM,SAAU,CAAA,+BAAA,CAAgC,OAASI,CAAAA,CAAAA,CAAM,EAC7DF,CAAAA,CAAAA,CACH,EAEDC,CACC,EAAAH,YAAA,CAAA,aAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,6BAA+BG,CAAAA,CAAAA,CAAY,CAE/D,CAEJ,CACD,EAEDJ,CAAAA,CAAO,WAAc,CAAA,QAAA","file":"Switch.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: string[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import * as React from \"react\";\nimport * as SwitchPrimitive from \"@radix-ui/react-switch\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type SwitchProps = React.ComponentPropsWithoutRef<\n typeof SwitchPrimitive.Root\n> & {\n label?: string;\n description?: string;\n};\n\nexport const Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitive.Root>,\n SwitchProps\n>(({ className, label, description, ...props }, ref) => (\n <div className=\"flex items-center gap-2\">\n <SwitchPrimitive.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer\",\n \"items-center rounded-full border-2 border-transparent\",\n \"transition-colors focus-visible:outline-none\",\n focusRingStyles,\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"data-[state=checked]:bg-primary-50 data-[state=unchecked]:bg-secondary-50\",\n className\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5\",\n \"rounded-full bg-white shadow-lg ring-0\",\n \"transition-transform\",\n \"data-[state=checked]:translate-x-5\",\n \"data-[state=unchecked]:translate-x-0\"\n )}\n />\n </SwitchPrimitive.Root>\n {(label || description) && (\n <div className=\"flex flex-col\">\n {label && (\n <label className=\"text-sm font-medium text-text\" htmlFor={props.id}>\n {label}\n </label>\n )}\n {description && (\n <span className=\"text-xs text-text-secondary\">{description}</span>\n )}\n </div>\n )}\n </div>\n));\n\nSwitch.displayName = \"Switch\";\n"]}
@@ -1,2 +1,2 @@
1
- import*as t from'react';import*as e from'@radix-ui/react-switch';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function i(...s){return twMerge(clsx(s))}var n="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var p=t.forwardRef(({className:s,label:o,description:r,...a},c)=>t.createElement("div",{className:"flex items-center gap-2"},t.createElement(e.Root,{className:i("peer inline-flex h-6 w-11 shrink-0 cursor-pointer","items-center rounded-full border-2 border-transparent","transition-colors focus-visible:outline-none",n,"disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary-50 data-[state=unchecked]:bg-secondary-50",s),...a,ref:c},t.createElement(e.Thumb,{className:i("pointer-events-none block h-5 w-5","rounded-full bg-white shadow-lg ring-0","transition-transform","data-[state=checked]:translate-x-5","data-[state=unchecked]:translate-x-0")})),(o||r)&&t.createElement("div",{className:"flex flex-col"},o&&t.createElement("label",{className:"text-sm font-medium text-text-primary",htmlFor:a.id},o),r&&t.createElement("span",{className:"text-xs text-text-secondary"},r))));p.displayName="Switch";if (exports.default) module.exports = exports.default;export{p as Switch};//# sourceMappingURL=Switch.js.map
1
+ import*as t from'react';import*as e from'@radix-ui/react-switch';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';function i(...s){return twMerge(clsx(s))}var n="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2";var p=t.forwardRef(({className:s,label:o,description:r,...a},c)=>t.createElement("div",{className:"flex items-center gap-2"},t.createElement(e.Root,{className:i("peer inline-flex h-6 w-11 shrink-0 cursor-pointer","items-center rounded-full border-2 border-transparent","transition-colors focus-visible:outline-none",n,"disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-primary-50 data-[state=unchecked]:bg-secondary-50",s),...a,ref:c},t.createElement(e.Thumb,{className:i("pointer-events-none block h-5 w-5","rounded-full bg-white shadow-lg ring-0","transition-transform","data-[state=checked]:translate-x-5","data-[state=unchecked]:translate-x-0")})),(o||r)&&t.createElement("div",{className:"flex flex-col"},o&&t.createElement("label",{className:"text-sm font-medium text-text",htmlFor:a.id},o),r&&t.createElement("span",{className:"text-xs text-text-secondary"},r))));p.displayName="Switch";if (exports.default) module.exports = exports.default;export{p as Switch};//# sourceMappingURL=Switch.js.map
2
2
  //# sourceMappingURL=Switch.js.map