@hexclave/ui 1.0.0 → 1.0.2
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.
- package/dist/components/action-dialog.d.ts +3 -3
- package/dist/components/action-dialog.d.ts.map +1 -1
- package/dist/components/action-dialog.js.map +1 -1
- package/dist/components/brand-icons.js +3 -3
- package/dist/components/brand-icons.js.map +1 -1
- package/dist/components/copy-button.d.ts +2 -2
- package/dist/components/copy-button.js +2 -2
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/data-table/data-table.js +2 -2
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/data-table/toolbar.js +3 -3
- package/dist/components/data-table/toolbar.js.map +1 -1
- package/dist/components/ui/accordion.js +4 -4
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert.js +4 -4
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.js +4 -4
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.js +2 -2
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +6 -6
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button.js +7 -7
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/card.js +8 -8
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/checkbox.js +2 -2
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/command.js +8 -8
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.js +9 -9
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +5 -5
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +16 -16
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/form.js +8 -8
- package/dist/components/ui/form.js.map +1 -1
- package/dist/components/ui/hover-card.js +2 -2
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/inline-code.js +7 -7
- package/dist/components/ui/inline-code.js.map +1 -1
- package/dist/components/ui/input-otp.js +5 -5
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js +3 -3
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/label.js +3 -3
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.js +2 -2
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.js +7 -7
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/password-input.js +2 -2
- package/dist/components/ui/password-input.js.map +1 -1
- package/dist/components/ui/popover.js +2 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +2 -2
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +3 -3
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +3 -3
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/select.js +8 -8
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js +2 -2
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +5 -5
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/spinner.js +2 -2
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.js +9 -9
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js +9 -9
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +4 -4
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toast.js +7 -7
- package/dist/components/ui/toast.js.map +1 -1
- package/dist/components/ui/toggle-group.js +3 -3
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.js +3 -3
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/ui/typography.d.ts +1 -1
- package/dist/components/ui/typography.js +2 -2
- package/dist/components/ui/typography.js.map +1 -1
- package/dist/esm/components/action-dialog.d.ts +3 -3
- package/dist/esm/components/action-dialog.d.ts.map +1 -1
- package/dist/esm/components/action-dialog.js.map +1 -1
- package/dist/esm/components/brand-icons.js.map +1 -1
- package/dist/esm/components/copy-button.d.ts +2 -2
- package/dist/esm/components/copy-button.js.map +1 -1
- package/dist/esm/components/data-table/data-table.js.map +1 -1
- package/dist/esm/components/data-table/toolbar.js.map +1 -1
- package/dist/esm/components/ui/accordion.js.map +1 -1
- package/dist/esm/components/ui/alert.js.map +1 -1
- package/dist/esm/components/ui/avatar.js.map +1 -1
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/breadcrumb.js.map +1 -1
- package/dist/esm/components/ui/button.js.map +1 -1
- package/dist/esm/components/ui/card.js.map +1 -1
- package/dist/esm/components/ui/checkbox.js.map +1 -1
- package/dist/esm/components/ui/command.js.map +1 -1
- package/dist/esm/components/ui/context-menu.js.map +1 -1
- package/dist/esm/components/ui/dialog.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/form.js.map +1 -1
- package/dist/esm/components/ui/hover-card.js.map +1 -1
- package/dist/esm/components/ui/inline-code.js.map +1 -1
- package/dist/esm/components/ui/input-otp.js.map +1 -1
- package/dist/esm/components/ui/input.js.map +1 -1
- package/dist/esm/components/ui/label.js.map +1 -1
- package/dist/esm/components/ui/menubar.js.map +1 -1
- package/dist/esm/components/ui/navigation-menu.js.map +1 -1
- package/dist/esm/components/ui/password-input.js.map +1 -1
- package/dist/esm/components/ui/popover.js.map +1 -1
- package/dist/esm/components/ui/progress.js.map +1 -1
- package/dist/esm/components/ui/radio-group.js.map +1 -1
- package/dist/esm/components/ui/resizable.d.ts +1 -1
- package/dist/esm/components/ui/resizable.d.ts.map +1 -1
- package/dist/esm/components/ui/scroll-area.js.map +1 -1
- package/dist/esm/components/ui/select.js.map +1 -1
- package/dist/esm/components/ui/separator.js.map +1 -1
- package/dist/esm/components/ui/sheet.js.map +1 -1
- package/dist/esm/components/ui/slider.js.map +1 -1
- package/dist/esm/components/ui/spinner.js.map +1 -1
- package/dist/esm/components/ui/switch.js.map +1 -1
- package/dist/esm/components/ui/table.js.map +1 -1
- package/dist/esm/components/ui/tabs.js.map +1 -1
- package/dist/esm/components/ui/textarea.js.map +1 -1
- package/dist/esm/components/ui/toast.js.map +1 -1
- package/dist/esm/components/ui/toggle-group.js.map +1 -1
- package/dist/esm/components/ui/toggle.js.map +1 -1
- package/dist/esm/components/ui/tooltip.js.map +1 -1
- package/dist/esm/components/ui/typography.d.ts +1 -1
- package/dist/esm/components/ui/typography.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand-icons.js","names":[],"sources":["../../../src/components/brand-icons.tsx"],"sourcesContent":["import { HexclaveAssertionError, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\n\nexport function Google({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 24 24\">\n <path fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"/>\n <path fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"/>\n <path fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"/>\n <path fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"/>\n <path fill=\"none\" d=\"M1 1h22v22H1z\"/>\n </svg>\n );\n}\n\nexport function Facebook({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 512 512\">\n <path fill='#FFFFFF'\n d=\"M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z\"/>\n </svg>\n );\n}\n\nexport function GitHub({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 496 512\">\n <path fill='#FFFFFF'\n d=\"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z\"/>\n </svg>\n );\n}\n\nexport function Microsoft({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 21 21\">\n <title>{\"MS-SymbolLockup\"}</title>\n <path fill=\"#f25022\" d=\"M1 1h9v9H1z\"/>\n <path fill=\"#00a4ef\" d=\"M1 11h9v9H1z\"/>\n <path fill=\"#7fba00\" d=\"M11 1h9v9h-9z\"/>\n <path fill=\"#ffb900\" d=\"M11 11h9v9h-9z\"/>\n </svg>\n );\n}\n\nexport function Spotify({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 496 512\">\n <path fill='#ffffff'\n d=\"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8zm100.7 364.9c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4zm26.9-65.6c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm31-76.2c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3z\"/>\n </svg>\n );\n}\n\nexport function Discord({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 127.14 96.36\">\n <path fill=\"#fff\"\n d=\"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z\"/>\n </svg>\n );\n}\n\nexport function Gitlab({ iconSize }: { iconSize: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={iconSize}\n height={iconSize}\n viewBox=\"0 -10 256 256\"\n version=\"1.1\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <g>\n <path\n d=\"M128.07485,236.074667 L128.07485,236.074667 L175.17885,91.1043048 L80.9708495,91.1043048 L128.07485,236.074667 L128.07485,236.074667 Z\"\n fill=\"#E24329\"></path>\n <path\n d=\"M128.07485,236.074423 L80.9708495,91.104061 L14.9557638,91.104061 L128.07485,236.074423 L128.07485,236.074423 Z\"\n fill=\"#FC6D26\"></path>\n <path\n d=\"M14.9558857,91.1044267 L14.9558857,91.1044267 L0.641828571,135.159589 C-0.663771429,139.17757 0.766171429,143.57955 4.18438095,146.06275 L128.074971,236.074789 L14.9558857,91.1044267 L14.9558857,91.1044267 Z\"\n fill=\"#FCA326\"></path>\n <path\n d=\"M14.9558857,91.1045486 L80.9709714,91.1045486 L52.6000762,3.79026286 C51.1408762,-0.703146667 44.7847619,-0.701927619 43.3255619,3.79026286 L14.9558857,91.1045486 L14.9558857,91.1045486 Z\"\n fill=\"#E24329\"></path>\n <path\n d=\"M128.07485,236.074423 L175.17885,91.104061 L241.193935,91.104061 L128.07485,236.074423 L128.07485,236.074423 Z\"\n fill=\"#FC6D26\"></path>\n <path\n d=\"M241.193935,91.1044267 L241.193935,91.1044267 L255.507992,135.159589 C256.813592,139.17757 255.38365,143.57955 251.96544,146.06275 L128.07485,236.074789 L241.193935,91.1044267 L241.193935,91.1044267 Z\"\n fill=\"#FCA326\"></path>\n <path\n d=\"M241.193935,91.1045486 L175.17885,91.1045486 L203.549745,3.79026286 C205.008945,-0.703146667 211.365059,-0.701927619 212.824259,3.79026286 L241.193935,91.1045486 L241.193935,91.1045486 Z\"\n fill=\"#E24329\"></path>\n </g>\n </svg>\n );\n}\n\nexport function Bitbucket({ iconSize }: { iconSize: number }) {\n return (\n <svg\n preserveAspectRatio=\"xMidYMid\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"-0.9662264221278978 -0.5824607696358868 257.93281329857973 230.8324730411935\"\n width={iconSize}\n height={iconSize}\n >\n <linearGradient\n id=\"a\"\n x1=\"108.633%\"\n x2=\"46.927%\"\n y1=\"13.818%\"\n y2=\"78.776%\"\n >\n <stop offset=\".18\" stopColor=\"#0052cc\"/>\n <stop offset=\"1\" stopColor=\"#2684ff\"/>\n </linearGradient>\n <g fill=\"none\">\n <path d=\"M101.272 152.561h53.449l12.901-75.32H87.06z\"/>\n <path\n d=\"M8.308 0A8.202 8.202 0 0 0 .106 9.516l34.819 211.373a11.155 11.155 0 0 0 10.909 9.31h167.04a8.202 8.202 0 0 0 8.201-6.89l34.82-213.752a8.202 8.202 0 0 0-8.203-9.514zm146.616 152.768h-53.315l-14.436-75.42h80.67z\"\n fill=\"#2684ff\"/>\n <path\n d=\"M244.61 77.242h-76.916l-12.909 75.36h-53.272l-62.902 74.663a11.105 11.105 0 0 0 7.171 2.704H212.73a8.196 8.196 0 0 0 8.196-6.884z\"\n fill=\"url(#a)\"/>\n </g>\n </svg>\n );\n}\n\nexport function LinkedIn({ iconSize }: { iconSize: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"#fff\"\n height={iconSize}\n width={iconSize}\n viewBox=\"0 0 310 310\"\n >\n <g id=\"XMLID_801_\">\n <path id=\"XMLID_802_\"\n d=\"M72.16,99.73H9.927c-2.762,0-5,2.239-5,5v199.928c0,2.762,2.238,5,5,5H72.16c2.762,0,5-2.238,5-5V104.73 C77.16,101.969,74.922,99.73,72.16,99.73z\"/>\n <path id=\"XMLID_803_\"\n d=\"M41.066,0.341C18.422,0.341,0,18.743,0,41.362C0,63.991,18.422,82.4,41.066,82.4 c22.626,0,41.033-18.41,41.033-41.038C82.1,18.743,63.692,0.341,41.066,0.341z\"/>\n <path id=\"XMLID_804_\"\n d=\"M230.454,94.761c-24.995,0-43.472,10.745-54.679,22.954V104.73c0-2.761-2.238-5-5-5h-59.599 c-2.762,0-5,2.239-5,5v199.928c0,2.762,2.238,5,5,5h62.097c2.762,0,5-2.238,5-5v-98.918c0-33.333,9.054-46.319,32.29-46.319 c25.306,0,27.317,20.818,27.317,48.034v97.204c0,2.762,2.238,5,5,5H305c2.762,0,5-2.238,5-5V194.995 C310,145.43,300.549,94.761,230.454,94.761z\"/>\n </g>\n </svg>\n );\n}\n\nexport function Apple({ iconSize }: { iconSize: number }) {\n return (\n <svg fill=\"#fff\" height={iconSize} width={iconSize} version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22.773 22.773\">\n <path\n d=\"M15.769,0c0.053,0,0.106,0,0.162,0c0.13,1.606-0.483,2.806-1.228,3.675c-0.731,0.863-1.732,1.7-3.351,1.573c-0.108-1.583,0.506-2.694,1.25-3.561C13.292,0.879,14.557,0.16,15.769,0z\"/>\n <path\n d=\"M20.67,16.716c0,0.016,0,0.03,0,0.045c-0.455,1.378-1.104,2.559-1.896,3.655c-0.723,0.995-1.609,2.334-3.191,2.334c-1.367,0-2.275-0.879-3.676-0.903c-1.482-0.024-2.297,0.735-3.652,0.926c-0.155,0-0.31,0-0.462,0c-0.995-0.144-1.798-0.932-2.383-1.642c-1.725-2.098-3.058-4.808-3.306-8.276c0-0.34,0-0.679,0-1.019c0.105-2.482,1.311-4.5,2.914-5.478c0.846-0.52,2.009-0.963,3.304-0.765c0.555,0.086,1.122,0.276,1.619,0.464c0.471,0.181,1.06,0.502,1.618,0.485c0.378-0.011,0.754-0.208,1.135-0.347c1.116-0.403,2.21-0.865,3.652-0.648c1.733,0.262,2.963,1.032,3.723,2.22c-1.466,0.933-2.625,2.339-2.427,4.74C17.818,14.688,19.086,15.964,20.67,16.716z\"/>\n </svg>\n );\n}\n\nexport function X({ iconSize }: { iconSize: number }) {\n return (\n <svg aria-label=\"X\" viewBox=\"0 0 1200 1227\" width={iconSize} height={iconSize}\n xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#FFFFFF\"\n d=\"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z\"/>\n </svg>\n );\n}\n\nexport function Twitch({ iconSize }: { iconSize: number }) {\n return (\n <svg aria-label=\"Twitch\" viewBox=\"0 0 2400 2800\" width={iconSize} height={iconSize}\n xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <polygon fill={\"#FFFFFF\"}\n points=\"2200,1300 1800,1700 1400,1700 1050,2050 1050,1700 600,1700 600,200 2200,200\"/>\n <g>\n <g id=\"Layer_1-2\">\n <path fill={\"#9146FF\"} d=\"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z\"/>\n <rect x=\"1700\" y=\"550\" fill={\"#9146FF\"} width=\"200\" height=\"600\"/>\n <rect x=\"1150\" y=\"550\" fill={\"#9146FF\"} width=\"200\" height=\"600\"/>\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport function Mapping({\n provider,\n iconSize,\n}: {\n provider: string,\n iconSize: number,\n}) {\n switch (provider) {\n case \"google\": {\n return <Google iconSize={iconSize}/>;\n }\n case \"github\": {\n return <GitHub iconSize={iconSize}/>;\n }\n case \"facebook\": {\n return <Facebook iconSize={iconSize}/>;\n }\n case \"microsoft\": {\n return <Microsoft iconSize={iconSize}/>;\n }\n case \"spotify\": {\n return <Spotify iconSize={iconSize}/>;\n }\n case \"discord\": {\n return <Discord iconSize={iconSize}/>;\n }\n case \"gitlab\": {\n return <Gitlab iconSize={iconSize}/>;\n }\n case \"bitbucket\": {\n return <Bitbucket iconSize={iconSize}/>;\n }\n case \"linkedin\": {\n return <LinkedIn iconSize={iconSize}/>;\n }\n case \"apple\": {\n return <Apple iconSize={iconSize}/>;\n }\n case \"x\": {\n return <X iconSize={iconSize}/>;\n }\n case \"twitch\": {\n return <Twitch iconSize={iconSize}/>;\n }\n default: {\n throw new HexclaveAssertionError(`Icon not found for provider: ${provider}`);\n }\n }\n}\n\nexport function toTitle(id: string) {\n return {\n github: \"GitHub\",\n google: \"Google\",\n facebook: \"Facebook\",\n microsoft: \"Microsoft\",\n spotify: \"Spotify\",\n discord: \"Discord\",\n gitlab: \"GitLab\",\n apple: \"Apple\",\n bitbucket: \"Bitbucket\",\n linkedin: \"LinkedIn\",\n x: \"X\",\n twitch: \"Twitch\"\n }[id] || throwErr(`Unknown provider: ${id}`);\n}\n\nexport const BRAND_COLORS: Record<string, string> = {\n github: '#24292e',\n google: '#ffffff',\n facebook: '#0866FF',\n microsoft: '#2F2F2F',\n spotify: '#1DD65F',\n discord: '#5661F5',\n linkedin: '#0A66C2',\n x: '#000000',\n apple: '#000000',\n twitch: '#ffffff'\n};\n"],"mappings":";;;;AAEA,SAAgB,OAAO,EAAE,YAAkC;AACzD,QACE,qBA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,IACH,QAAO,oBAAC,KAAY,WAAW;EAEjC,KAAK,SACH,QAAO,oBAAC,UAAiB,WAAW;EAEtC,QACE,OAAM,IAAI,uBAAuB,gCAAgC,WAAW;;;AAKlF,SAAgB,QAAQ,IAAY;AAClC,QAAO;EACL,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,WAAW;EACX,SAAS;EACT,SAAS;EACT,QAAQ;EACR,OAAO;EACP,WAAW;EACX,UAAU;EACV,GAAG;EACH,QAAQ;EACT,CAAC,OAAO,SAAS,qBAAqB,KAAK;;AAG9C,MAAa,eAAuC;CAClD,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,WAAW;CACX,SAAS;CACT,SAAS;CACT,UAAU;CACV,GAAG;CACH,OAAO;CACP,QAAQ;CACT"}
|
|
1
|
+
{"version":3,"file":"brand-icons.js","names":[],"sources":["../../../src/components/brand-icons.tsx"],"sourcesContent":["import { HexclaveAssertionError, throwErr } from \"@hexclave/shared/dist/utils/errors\";\n\nexport function Google({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 24 24\">\n <path fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"/>\n <path fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"/>\n <path fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"/>\n <path fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"/>\n <path fill=\"none\" d=\"M1 1h22v22H1z\"/>\n </svg>\n );\n}\n\nexport function Facebook({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 512 512\">\n <path fill='#FFFFFF'\n d=\"M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256C0 376 82.7 476.8 194.2 504.5V334.2H141.4V256h52.8V222.3c0-87.1 39.4-127.5 125-127.5c16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1c-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287V510.1C413.8 494.8 512 386.9 512 256h0z\"/>\n </svg>\n );\n}\n\nexport function GitHub({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 496 512\">\n <path fill='#FFFFFF'\n d=\"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3 .3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5 .3-6.2 2.3zm44.2-1.7c-2.9 .7-4.9 2.6-4.6 4.9 .3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3 .7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3 .3 2.9 2.3 3.9 1.6 1 3.6 .7 4.3-.7 .7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3 .7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3 .7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z\"/>\n </svg>\n );\n}\n\nexport function Microsoft({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 21 21\">\n <title>{\"MS-SymbolLockup\"}</title>\n <path fill=\"#f25022\" d=\"M1 1h9v9H1z\"/>\n <path fill=\"#00a4ef\" d=\"M1 11h9v9H1z\"/>\n <path fill=\"#7fba00\" d=\"M11 1h9v9h-9z\"/>\n <path fill=\"#ffb900\" d=\"M11 11h9v9h-9z\"/>\n </svg>\n );\n}\n\nexport function Spotify({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 496 512\">\n <path fill='#ffffff'\n d=\"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8zm100.7 364.9c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4zm26.9-65.6c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm31-76.2c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3z\"/>\n </svg>\n );\n}\n\nexport function Discord({ iconSize }: { iconSize: number }) {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" width={iconSize} height={iconSize} viewBox=\"0 0 127.14 96.36\">\n <path fill=\"#fff\"\n d=\"M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,46,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,46,96.12,53,91.08,65.69,84.69,65.69Z\"/>\n </svg>\n );\n}\n\nexport function Gitlab({ iconSize }: { iconSize: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={iconSize}\n height={iconSize}\n viewBox=\"0 -10 256 256\"\n version=\"1.1\"\n preserveAspectRatio=\"xMidYMid\"\n >\n <g>\n <path\n d=\"M128.07485,236.074667 L128.07485,236.074667 L175.17885,91.1043048 L80.9708495,91.1043048 L128.07485,236.074667 L128.07485,236.074667 Z\"\n fill=\"#E24329\"></path>\n <path\n d=\"M128.07485,236.074423 L80.9708495,91.104061 L14.9557638,91.104061 L128.07485,236.074423 L128.07485,236.074423 Z\"\n fill=\"#FC6D26\"></path>\n <path\n d=\"M14.9558857,91.1044267 L14.9558857,91.1044267 L0.641828571,135.159589 C-0.663771429,139.17757 0.766171429,143.57955 4.18438095,146.06275 L128.074971,236.074789 L14.9558857,91.1044267 L14.9558857,91.1044267 Z\"\n fill=\"#FCA326\"></path>\n <path\n d=\"M14.9558857,91.1045486 L80.9709714,91.1045486 L52.6000762,3.79026286 C51.1408762,-0.703146667 44.7847619,-0.701927619 43.3255619,3.79026286 L14.9558857,91.1045486 L14.9558857,91.1045486 Z\"\n fill=\"#E24329\"></path>\n <path\n d=\"M128.07485,236.074423 L175.17885,91.104061 L241.193935,91.104061 L128.07485,236.074423 L128.07485,236.074423 Z\"\n fill=\"#FC6D26\"></path>\n <path\n d=\"M241.193935,91.1044267 L241.193935,91.1044267 L255.507992,135.159589 C256.813592,139.17757 255.38365,143.57955 251.96544,146.06275 L128.07485,236.074789 L241.193935,91.1044267 L241.193935,91.1044267 Z\"\n fill=\"#FCA326\"></path>\n <path\n d=\"M241.193935,91.1045486 L175.17885,91.1045486 L203.549745,3.79026286 C205.008945,-0.703146667 211.365059,-0.701927619 212.824259,3.79026286 L241.193935,91.1045486 L241.193935,91.1045486 Z\"\n fill=\"#E24329\"></path>\n </g>\n </svg>\n );\n}\n\nexport function Bitbucket({ iconSize }: { iconSize: number }) {\n return (\n <svg\n preserveAspectRatio=\"xMidYMid\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"-0.9662264221278978 -0.5824607696358868 257.93281329857973 230.8324730411935\"\n width={iconSize}\n height={iconSize}\n >\n <linearGradient\n id=\"a\"\n x1=\"108.633%\"\n x2=\"46.927%\"\n y1=\"13.818%\"\n y2=\"78.776%\"\n >\n <stop offset=\".18\" stopColor=\"#0052cc\"/>\n <stop offset=\"1\" stopColor=\"#2684ff\"/>\n </linearGradient>\n <g fill=\"none\">\n <path d=\"M101.272 152.561h53.449l12.901-75.32H87.06z\"/>\n <path\n d=\"M8.308 0A8.202 8.202 0 0 0 .106 9.516l34.819 211.373a11.155 11.155 0 0 0 10.909 9.31h167.04a8.202 8.202 0 0 0 8.201-6.89l34.82-213.752a8.202 8.202 0 0 0-8.203-9.514zm146.616 152.768h-53.315l-14.436-75.42h80.67z\"\n fill=\"#2684ff\"/>\n <path\n d=\"M244.61 77.242h-76.916l-12.909 75.36h-53.272l-62.902 74.663a11.105 11.105 0 0 0 7.171 2.704H212.73a8.196 8.196 0 0 0 8.196-6.884z\"\n fill=\"url(#a)\"/>\n </g>\n </svg>\n );\n}\n\nexport function LinkedIn({ iconSize }: { iconSize: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"#fff\"\n height={iconSize}\n width={iconSize}\n viewBox=\"0 0 310 310\"\n >\n <g id=\"XMLID_801_\">\n <path id=\"XMLID_802_\"\n d=\"M72.16,99.73H9.927c-2.762,0-5,2.239-5,5v199.928c0,2.762,2.238,5,5,5H72.16c2.762,0,5-2.238,5-5V104.73 C77.16,101.969,74.922,99.73,72.16,99.73z\"/>\n <path id=\"XMLID_803_\"\n d=\"M41.066,0.341C18.422,0.341,0,18.743,0,41.362C0,63.991,18.422,82.4,41.066,82.4 c22.626,0,41.033-18.41,41.033-41.038C82.1,18.743,63.692,0.341,41.066,0.341z\"/>\n <path id=\"XMLID_804_\"\n d=\"M230.454,94.761c-24.995,0-43.472,10.745-54.679,22.954V104.73c0-2.761-2.238-5-5-5h-59.599 c-2.762,0-5,2.239-5,5v199.928c0,2.762,2.238,5,5,5h62.097c2.762,0,5-2.238,5-5v-98.918c0-33.333,9.054-46.319,32.29-46.319 c25.306,0,27.317,20.818,27.317,48.034v97.204c0,2.762,2.238,5,5,5H305c2.762,0,5-2.238,5-5V194.995 C310,145.43,300.549,94.761,230.454,94.761z\"/>\n </g>\n </svg>\n );\n}\n\nexport function Apple({ iconSize }: { iconSize: number }) {\n return (\n <svg fill=\"#fff\" height={iconSize} width={iconSize} version=\"1.1\" id=\"Capa_1\" xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22.773 22.773\">\n <path\n d=\"M15.769,0c0.053,0,0.106,0,0.162,0c0.13,1.606-0.483,2.806-1.228,3.675c-0.731,0.863-1.732,1.7-3.351,1.573c-0.108-1.583,0.506-2.694,1.25-3.561C13.292,0.879,14.557,0.16,15.769,0z\"/>\n <path\n d=\"M20.67,16.716c0,0.016,0,0.03,0,0.045c-0.455,1.378-1.104,2.559-1.896,3.655c-0.723,0.995-1.609,2.334-3.191,2.334c-1.367,0-2.275-0.879-3.676-0.903c-1.482-0.024-2.297,0.735-3.652,0.926c-0.155,0-0.31,0-0.462,0c-0.995-0.144-1.798-0.932-2.383-1.642c-1.725-2.098-3.058-4.808-3.306-8.276c0-0.34,0-0.679,0-1.019c0.105-2.482,1.311-4.5,2.914-5.478c0.846-0.52,2.009-0.963,3.304-0.765c0.555,0.086,1.122,0.276,1.619,0.464c0.471,0.181,1.06,0.502,1.618,0.485c0.378-0.011,0.754-0.208,1.135-0.347c1.116-0.403,2.21-0.865,3.652-0.648c1.733,0.262,2.963,1.032,3.723,2.22c-1.466,0.933-2.625,2.339-2.427,4.74C17.818,14.688,19.086,15.964,20.67,16.716z\"/>\n </svg>\n );\n}\n\nexport function X({ iconSize }: { iconSize: number }) {\n return (\n <svg aria-label=\"X\" viewBox=\"0 0 1200 1227\" width={iconSize} height={iconSize}\n xmlns=\"http://www.w3.org/2000/svg\">\n <path fill=\"#FFFFFF\"\n d=\"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z\"/>\n </svg>\n );\n}\n\nexport function Twitch({ iconSize }: { iconSize: number }) {\n return (\n <svg aria-label=\"Twitch\" viewBox=\"0 0 2400 2800\" width={iconSize} height={iconSize}\n xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <polygon fill={\"#FFFFFF\"}\n points=\"2200,1300 1800,1700 1400,1700 1050,2050 1050,1700 600,1700 600,200 2200,200\"/>\n <g>\n <g id=\"Layer_1-2\">\n <path fill={\"#9146FF\"} d=\"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z\"/>\n <rect x=\"1700\" y=\"550\" fill={\"#9146FF\"} width=\"200\" height=\"600\"/>\n <rect x=\"1150\" y=\"550\" fill={\"#9146FF\"} width=\"200\" height=\"600\"/>\n </g>\n </g>\n </g>\n </svg>\n );\n}\n\nexport function Mapping({\n provider,\n iconSize,\n}: {\n provider: string,\n iconSize: number,\n}) {\n switch (provider) {\n case \"google\": {\n return <Google iconSize={iconSize}/>;\n }\n case \"github\": {\n return <GitHub iconSize={iconSize}/>;\n }\n case \"facebook\": {\n return <Facebook iconSize={iconSize}/>;\n }\n case \"microsoft\": {\n return <Microsoft iconSize={iconSize}/>;\n }\n case \"spotify\": {\n return <Spotify iconSize={iconSize}/>;\n }\n case \"discord\": {\n return <Discord iconSize={iconSize}/>;\n }\n case \"gitlab\": {\n return <Gitlab iconSize={iconSize}/>;\n }\n case \"bitbucket\": {\n return <Bitbucket iconSize={iconSize}/>;\n }\n case \"linkedin\": {\n return <LinkedIn iconSize={iconSize}/>;\n }\n case \"apple\": {\n return <Apple iconSize={iconSize}/>;\n }\n case \"x\": {\n return <X iconSize={iconSize}/>;\n }\n case \"twitch\": {\n return <Twitch iconSize={iconSize}/>;\n }\n default: {\n throw new HexclaveAssertionError(`Icon not found for provider: ${provider}`);\n }\n }\n}\n\nexport function toTitle(id: string) {\n return {\n github: \"GitHub\",\n google: \"Google\",\n facebook: \"Facebook\",\n microsoft: \"Microsoft\",\n spotify: \"Spotify\",\n discord: \"Discord\",\n gitlab: \"GitLab\",\n apple: \"Apple\",\n bitbucket: \"Bitbucket\",\n linkedin: \"LinkedIn\",\n x: \"X\",\n twitch: \"Twitch\"\n }[id] || throwErr(`Unknown provider: ${id}`);\n}\n\nexport const BRAND_COLORS: Record<string, string> = {\n github: '#24292e',\n google: '#ffffff',\n facebook: '#0866FF',\n microsoft: '#2F2F2F',\n spotify: '#1DD65F',\n discord: '#5661F5',\n linkedin: '#0A66C2',\n x: '#000000',\n apple: '#000000',\n twitch: '#ffffff'\n};\n"],"mappings":";;;;AAEA,SAAgB,OAAO,EAAE,YAAkC;AACzD,QACE,qBAAC;EAAI,OAAM;EAA6B,OAAO;EAAU,QAAQ;EAAU,SAAQ;;GACjF,oBAAC;IAAK,MAAK;IACT,GAAE;KAA2H;GAC/H,oBAAC;IAAK,MAAK;IACT,GAAE;KAAyI;GAC7I,oBAAC;IAAK,MAAK;IACT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;EACR,QAAQ;EACR,UAAU;EACV,WAAW;EACX,SAAS;EACT,SAAS;EACT,QAAQ;EACR,OAAO;EACP,WAAW;EACX,UAAU;EACV,GAAG;EACH,QAAQ;EACT,CAAC,OAAO,SAAS,qBAAqB,KAAK;;AAG9C,MAAa,eAAuC;CAClD,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,WAAW;CACX,SAAS;CACT,SAAS;CACT,UAAU;CACV,GAAG;CACH,OAAO;CACP,QAAQ;CACT"}
|
|
@@ -13,9 +13,9 @@ declare const CopyButton: React.FC<{
|
|
|
13
13
|
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
14
14
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
16
|
-
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
17
|
-
} & {
|
|
18
16
|
content: string;
|
|
17
|
+
} & {
|
|
18
|
+
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
19
19
|
}>;
|
|
20
20
|
//#endregion
|
|
21
21
|
export { CopyButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.js","names":[],"sources":["../../../src/components/copy-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"copy-button.js","names":[],"sources":["../../../src/components/copy-button.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { Copy } from \"lucide-react\";\nimport React from \"react\";\nimport { Button, cn, type ButtonProps, useToast } from \"..\";\n\nconst CopyButton = forwardRefIfNeeded<\n HTMLButtonElement,\n ButtonProps & { content: string }\n>((props, ref) => {\n const { toast } = useToast();\n\n return (\n <Button\n variant=\"secondary\"\n {...props}\n className={cn(\"h-6 w-6 p-1\", props.className)}\n ref={ref}\n onClick={async (...args) => {\n await props.onClick?.(...args);\n try {\n await navigator.clipboard.writeText(props.content);\n toast({ description: 'Copied to clipboard!', variant: 'success' });\n } catch (e) {\n toast({ description: 'Failed to copy to clipboard', variant: 'destructive' });\n }\n }}\n >\n <Copy />\n </Button>\n );\n});\nCopyButton.displayName = \"CopyButton\";\n\nexport { CopyButton };\n"],"mappings":";;;;;;;;;AAOA,MAAM,aAAa,oBAGhB,OAAO,QAAQ;CAChB,MAAM,EAAE,UAAU,UAAU;AAE5B,QACE,oBAAC;EACC,SAAQ;EACR,GAAI;EACJ,WAAW,GAAG,eAAe,MAAM,UAAU;EACxC;EACL,SAAS,OAAO,GAAG,SAAS;AAC1B,SAAM,MAAM,UAAU,GAAG,KAAK;AAC9B,OAAI;AACF,UAAM,UAAU,UAAU,UAAU,MAAM,QAAQ;AAClD,UAAM;KAAE,aAAa;KAAwB,SAAS;KAAW,CAAC;YAC3D,GAAG;AACV,UAAM;KAAE,aAAa;KAA+B,SAAS;KAAe,CAAC;;;YAIjF,oBAAC,SAAO;GACD;EAEX;AACF,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-table.js","names":[],"sources":["../../../../src/components/data-table/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport { runAsynchronouslyWithAlert } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"../ui/table\";\nimport {\n ColumnDef,\n ColumnFiltersState,\n GlobalFiltering,\n OnChangeFn,\n PaginationState,\n SortingState,\n Table as TableType,\n VisibilityState,\n flexRender,\n getCoreRowModel,\n getFacetedRowModel,\n getFacetedUniqueValues,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport React from \"react\";\nimport { DataTablePagination } from \"./pagination\";\nimport { DataTableToolbar } from \"./toolbar\";\n\nexport function TableView<TData, TValue>(props: {\n table: TableType<TData>,\n columns: ColumnDef<TData, TValue>[],\n toolbarRender?: (table: TableType<TData>) => React.ReactNode,\n showDefaultToolbar?: boolean,\n defaultColumnFilters: ColumnFiltersState,\n defaultSorting: SortingState,\n onRowClick?: (row: TData) => void,\n}) {\n return (\n <div className=\"space-y-4\">\n <DataTableToolbar\n table={props.table}\n toolbarRender={props.toolbarRender}\n showDefaultToolbar={props.showDefaultToolbar}\n defaultColumnFilters={props.defaultColumnFilters}\n defaultSorting={props.defaultSorting}\n />\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n {props.table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id} >\n {headerGroup.headers.map((header) => {\n return (\n <TableHead key={header.id} colSpan={header.colSpan}>\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </TableHead>\n );\n })}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {props.table.getRowModel().rows.length ? (\n props.table.getRowModel().rows.map((row) => (\n <TableRow\n key={row.id}\n data-state={row.getIsSelected() && \"selected\"}\n onClick={(ev) => {\n // only trigger onRowClick if the element is a direct descendant; don't trigger for portals\n if (ev.target instanceof Node && ev.currentTarget.contains(ev.target)) {\n props.onRowClick?.(row.original);\n }\n }}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id}>\n {flexRender(\n cell.column.columnDef.cell,\n cell.getContext()\n )}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell\n colSpan={props.columns.length}\n className=\"h-24 text-center\"\n >\n No results.\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n <DataTablePagination table={props.table} />\n </div>\n );\n}\n\ntype DataTableProps<TData, TValue> = {\n columns: ColumnDef<TData, TValue>[],\n data: TData[],\n toolbarRender?: (table: TableType<TData>) => React.ReactNode,\n defaultVisibility?: VisibilityState,\n defaultColumnFilters: ColumnFiltersState,\n defaultSorting: SortingState,\n showDefaultToolbar?: boolean,\n onRowClick?: (row: TData) => void,\n}\n\nexport function DataTable<TData, TValue>({\n columns,\n data,\n toolbarRender,\n defaultVisibility,\n defaultColumnFilters,\n defaultSorting,\n showDefaultToolbar = true,\n onRowClick,\n}: DataTableProps<TData, TValue>) {\n const [sorting, setSorting] = React.useState<SortingState>(defaultSorting);\n const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(defaultColumnFilters);\n const [pagination, setPagination] = React.useState<PaginationState>({\n pageIndex: 0,\n pageSize: 10,\n });\n const [globalFilter, setGlobalFilter] = React.useState<any>();\n\n return <DataTableBase\n columns={columns}\n data={data}\n toolbarRender={toolbarRender}\n defaultVisibility={defaultVisibility}\n sorting={sorting}\n setSorting={setSorting}\n defaultSorting={defaultSorting}\n columnFilters={columnFilters}\n setColumnFilters={setColumnFilters}\n defaultColumnFilters={defaultColumnFilters}\n manualPagination={false}\n manualFiltering={false}\n pagination={pagination}\n setPagination={setPagination}\n globalFilter={globalFilter}\n setGlobalFilter={setGlobalFilter}\n showDefaultToolbar={showDefaultToolbar}\n onRowClick={onRowClick}\n />;\n}\n\ntype DataTableManualPaginationProps<TData, TValue> = DataTableProps<TData, TValue> & {\n onUpdate: (options: {\n cursor: string,\n limit: number,\n sorting: SortingState,\n columnFilters: ColumnFiltersState,\n globalFilters: any,\n }) => Promise<{ nextCursor: string | null }>,\n}\n\nexport function DataTableManualPagination<TData, TValue>({\n columns,\n data,\n toolbarRender,\n defaultVisibility,\n defaultColumnFilters,\n defaultSorting,\n onRowClick,\n onUpdate,\n showDefaultToolbar = true,\n}: DataTableManualPaginationProps<TData, TValue>) {\n const [sorting, setSorting] = React.useState<SortingState>(defaultSorting);\n const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: 10 });\n const [cursors, setCursors] = React.useState<Record<number, string>>({});\n const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(defaultColumnFilters);\n const [globalFilter, setGlobalFilter] = React.useState<any>();\n const [refreshCounter, setRefreshCounter] = React.useState(0);\n\n React.useEffect(() => {\n runAsynchronouslyWithAlert(async () => {\n const { nextCursor } = await onUpdate({\n cursor: cursors[pagination.pageIndex],\n limit: pagination.pageSize,\n sorting,\n columnFilters,\n globalFilters: globalFilter,\n });\n setCursors(c => nextCursor ? { ...c, [pagination.pageIndex + 1]: nextCursor } : c);\n });\n }, [pagination, sorting, columnFilters, refreshCounter]);\n\n // Reset to first page when filters change\n React.useEffect(() => {\n setPagination(pagination => ({ ...pagination, pageIndex: 0 }));\n setCursors({});\n }, [columnFilters, sorting, pagination.pageSize]);\n\n // Refresh the users when the global filter changes. Delay to prevent unnecessary re-renders.\n React.useEffect(() => {\n const timer = setTimeout(() => {\n setRefreshCounter(x => x + 1);\n }, 3_000);\n return () => clearTimeout(timer);\n }, [globalFilter]);\n\n return <DataTableBase\n columns={columns}\n data={data}\n toolbarRender={toolbarRender}\n sorting={sorting}\n setSorting={setSorting}\n pagination={pagination}\n setPagination={setPagination}\n columnFilters={columnFilters}\n setColumnFilters={setColumnFilters}\n rowCount={pagination.pageSize * Object.keys(cursors).length + (cursors[pagination.pageIndex + 1] ? 1 : 0)}\n globalFilter={globalFilter}\n setGlobalFilter={setGlobalFilter}\n defaultColumnFilters={defaultColumnFilters}\n defaultSorting={defaultSorting}\n defaultVisibility={defaultVisibility}\n showDefaultToolbar={showDefaultToolbar}\n onRowClick={onRowClick}\n />;\n}\n\ntype DataTableBaseProps<TData, TValue> = DataTableProps<TData, TValue> & {\n sorting?: SortingState,\n setSorting?: OnChangeFn<SortingState>,\n pagination?: PaginationState,\n setPagination?: OnChangeFn<PaginationState>,\n rowCount?: number,\n columnFilters?: ColumnFiltersState,\n setColumnFilters?: OnChangeFn<ColumnFiltersState>,\n manualPagination?: boolean,\n manualFiltering?: boolean,\n globalFilter?: any,\n setGlobalFilter?: OnChangeFn<any>,\n}\n\nfunction DataTableBase<TData, TValue>({\n columns,\n data,\n toolbarRender,\n defaultVisibility,\n sorting,\n setSorting,\n defaultColumnFilters,\n defaultSorting,\n pagination,\n setPagination,\n rowCount,\n columnFilters,\n setColumnFilters,\n globalFilter,\n setGlobalFilter,\n manualPagination = true,\n manualFiltering = true,\n showDefaultToolbar = true,\n onRowClick,\n}: DataTableBaseProps<TData, TValue>) {\n const [rowSelection, setRowSelection] = React.useState({});\n const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>(defaultVisibility || {});\n\n const table: TableType<TData> = useReactTable({\n data,\n columns,\n state: {\n sorting,\n columnVisibility,\n rowSelection,\n columnFilters,\n pagination,\n globalFilter: globalFilter,\n },\n enableRowSelection: true,\n onGlobalFilterChange: setGlobalFilter,\n onRowSelectionChange: setRowSelection,\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onPaginationChange: setPagination,\n getColumnCanGlobalFilter: (c) => c.columnDef.enableGlobalFilter ?? GlobalFiltering.getDefaultOptions!(table).getColumnCanGlobalFilter!(c),\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getFacetedRowModel: getFacetedRowModel(),\n getFacetedUniqueValues: getFacetedUniqueValues(),\n autoResetAll: false,\n manualPagination,\n manualFiltering,\n rowCount,\n });\n\n return <TableView\n table={table}\n columns={columns}\n toolbarRender={toolbarRender}\n showDefaultToolbar={showDefaultToolbar}\n defaultColumnFilters={defaultColumnFilters}\n defaultSorting={defaultSorting}\n onRowClick={onRowClick}\n />;\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAgB,UAAyB,OAQtC;AACD,QACE,qBAAC;EAAI,WAAU;;GACb,oBAAC;IACC,OAAO,MAAM;IACb,eAAe,MAAM;IACrB,oBAAoB,MAAM;IAC1B,sBAAsB,MAAM;IAC5B,gBAAgB,MAAM;KACtB;GACF,oBAAC;IAAI,WAAU;cACb,qBAAC,oBACC,oBAAC,yBACE,MAAM,MAAM,iBAAiB,CAAC,KAAK,gBAClC,o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iBACA,mBAAmB,MACnB,kBAAkB,MAClB,qBAAqB,MACrB,cACoC;CACpC,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,EAAE,CAAC;CAC1D,MAAM,CAAC,kBAAkB,uBAAuB,MAAM,SAA0B,qBAAqB,EAAE,CAAC;CAExG,MAAM,QAA0B,cAAc;EAC5C;EACA;EACA,OAAO;GACL;GACA;GACA;GACA;GACA;GACc;GACf;EACD,oBAAoB;EACpB,sBAAsB;EACtB,sBAAsB;EACtB,iBAAiB;EACjB,uBAAuB;EACvB,0BAA0B;EAC1B,oBAAoB;EACpB,2BAA2B,MAAM,EAAE,UAAU,sBAAsB,gBAAgB,kBAAmB,MAAM,CAAC,yBAA0B,EAAE;EACzI,iBAAiB,iBAAiB;EAClC,qBAAqB,qBAAqB;EAC1C,uBAAuB,uBAAuB;EAC9C,mBAAmB,mBAAmB;EACtC,oBAAoB,oBAAoB;EACxC,wBAAwB,wBAAwB;EAChD,cAAc;EACd;EACA;EACA;EACD,CAAC;AAEF,QAAO,oBAAC;EACC;EACE;EACM;EACK;EACE;EACN;EACJ;GACZ"}
|
|
1
|
+
{"version":3,"file":"data-table.js","names":[],"sources":["../../../../src/components/data-table/data-table.tsx"],"sourcesContent":["\"use client\";\n\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport {\n Table,\n TableBody,\n TableCell,\n TableHead,\n TableHeader,\n TableRow,\n} from \"../ui/table\";\nimport {\n ColumnDef,\n ColumnFiltersState,\n GlobalFiltering,\n OnChangeFn,\n PaginationState,\n SortingState,\n Table as TableType,\n VisibilityState,\n flexRender,\n getCoreRowModel,\n getFacetedRowModel,\n getFacetedUniqueValues,\n getFilteredRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport React from \"react\";\nimport { DataTablePagination } from \"./pagination\";\nimport { DataTableToolbar } from \"./toolbar\";\n\nexport function TableView<TData, TValue>(props: {\n table: TableType<TData>,\n columns: ColumnDef<TData, TValue>[],\n toolbarRender?: (table: TableType<TData>) => React.ReactNode,\n showDefaultToolbar?: boolean,\n defaultColumnFilters: ColumnFiltersState,\n defaultSorting: SortingState,\n onRowClick?: (row: TData) => void,\n}) {\n return (\n <div className=\"space-y-4\">\n <DataTableToolbar\n table={props.table}\n toolbarRender={props.toolbarRender}\n showDefaultToolbar={props.showDefaultToolbar}\n defaultColumnFilters={props.defaultColumnFilters}\n defaultSorting={props.defaultSorting}\n />\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n {props.table.getHeaderGroups().map((headerGroup) => (\n <TableRow key={headerGroup.id} >\n {headerGroup.headers.map((header) => {\n return (\n <TableHead key={header.id} colSpan={header.colSpan}>\n {header.isPlaceholder\n ? null\n : flexRender(\n header.column.columnDef.header,\n header.getContext()\n )}\n </TableHead>\n );\n })}\n </TableRow>\n ))}\n </TableHeader>\n <TableBody>\n {props.table.getRowModel().rows.length ? (\n props.table.getRowModel().rows.map((row) => (\n <TableRow\n key={row.id}\n data-state={row.getIsSelected() && \"selected\"}\n onClick={(ev) => {\n // only trigger onRowClick if the element is a direct descendant; don't trigger for portals\n if (ev.target instanceof Node && ev.currentTarget.contains(ev.target)) {\n props.onRowClick?.(row.original);\n }\n }}\n >\n {row.getVisibleCells().map((cell) => (\n <TableCell key={cell.id}>\n {flexRender(\n cell.column.columnDef.cell,\n cell.getContext()\n )}\n </TableCell>\n ))}\n </TableRow>\n ))\n ) : (\n <TableRow>\n <TableCell\n colSpan={props.columns.length}\n className=\"h-24 text-center\"\n >\n No results.\n </TableCell>\n </TableRow>\n )}\n </TableBody>\n </Table>\n </div>\n <DataTablePagination table={props.table} />\n </div>\n );\n}\n\ntype DataTableProps<TData, TValue> = {\n columns: ColumnDef<TData, TValue>[],\n data: TData[],\n toolbarRender?: (table: TableType<TData>) => React.ReactNode,\n defaultVisibility?: VisibilityState,\n defaultColumnFilters: ColumnFiltersState,\n defaultSorting: SortingState,\n showDefaultToolbar?: boolean,\n onRowClick?: (row: TData) => void,\n}\n\nexport function DataTable<TData, TValue>({\n columns,\n data,\n toolbarRender,\n defaultVisibility,\n defaultColumnFilters,\n defaultSorting,\n showDefaultToolbar = true,\n onRowClick,\n}: DataTableProps<TData, TValue>) {\n const [sorting, setSorting] = React.useState<SortingState>(defaultSorting);\n const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(defaultColumnFilters);\n const [pagination, setPagination] = React.useState<PaginationState>({\n pageIndex: 0,\n pageSize: 10,\n });\n const [globalFilter, setGlobalFilter] = React.useState<any>();\n\n return <DataTableBase\n columns={columns}\n data={data}\n toolbarRender={toolbarRender}\n defaultVisibility={defaultVisibility}\n sorting={sorting}\n setSorting={setSorting}\n defaultSorting={defaultSorting}\n columnFilters={columnFilters}\n setColumnFilters={setColumnFilters}\n defaultColumnFilters={defaultColumnFilters}\n manualPagination={false}\n manualFiltering={false}\n pagination={pagination}\n setPagination={setPagination}\n globalFilter={globalFilter}\n setGlobalFilter={setGlobalFilter}\n showDefaultToolbar={showDefaultToolbar}\n onRowClick={onRowClick}\n />;\n}\n\ntype DataTableManualPaginationProps<TData, TValue> = DataTableProps<TData, TValue> & {\n onUpdate: (options: {\n cursor: string,\n limit: number,\n sorting: SortingState,\n columnFilters: ColumnFiltersState,\n globalFilters: any,\n }) => Promise<{ nextCursor: string | null }>,\n}\n\nexport function DataTableManualPagination<TData, TValue>({\n columns,\n data,\n toolbarRender,\n defaultVisibility,\n defaultColumnFilters,\n defaultSorting,\n onRowClick,\n onUpdate,\n showDefaultToolbar = true,\n}: DataTableManualPaginationProps<TData, TValue>) {\n const [sorting, setSorting] = React.useState<SortingState>(defaultSorting);\n const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: 10 });\n const [cursors, setCursors] = React.useState<Record<number, string>>({});\n const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(defaultColumnFilters);\n const [globalFilter, setGlobalFilter] = React.useState<any>();\n const [refreshCounter, setRefreshCounter] = React.useState(0);\n\n React.useEffect(() => {\n runAsynchronouslyWithAlert(async () => {\n const { nextCursor } = await onUpdate({\n cursor: cursors[pagination.pageIndex],\n limit: pagination.pageSize,\n sorting,\n columnFilters,\n globalFilters: globalFilter,\n });\n setCursors(c => nextCursor ? { ...c, [pagination.pageIndex + 1]: nextCursor } : c);\n });\n }, [pagination, sorting, columnFilters, refreshCounter]);\n\n // Reset to first page when filters change\n React.useEffect(() => {\n setPagination(pagination => ({ ...pagination, pageIndex: 0 }));\n setCursors({});\n }, [columnFilters, sorting, pagination.pageSize]);\n\n // Refresh the users when the global filter changes. Delay to prevent unnecessary re-renders.\n React.useEffect(() => {\n const timer = setTimeout(() => {\n setRefreshCounter(x => x + 1);\n }, 3_000);\n return () => clearTimeout(timer);\n }, [globalFilter]);\n\n return <DataTableBase\n columns={columns}\n data={data}\n toolbarRender={toolbarRender}\n sorting={sorting}\n setSorting={setSorting}\n pagination={pagination}\n setPagination={setPagination}\n columnFilters={columnFilters}\n setColumnFilters={setColumnFilters}\n rowCount={pagination.pageSize * Object.keys(cursors).length + (cursors[pagination.pageIndex + 1] ? 1 : 0)}\n globalFilter={globalFilter}\n setGlobalFilter={setGlobalFilter}\n defaultColumnFilters={defaultColumnFilters}\n defaultSorting={defaultSorting}\n defaultVisibility={defaultVisibility}\n showDefaultToolbar={showDefaultToolbar}\n onRowClick={onRowClick}\n />;\n}\n\ntype DataTableBaseProps<TData, TValue> = DataTableProps<TData, TValue> & {\n sorting?: SortingState,\n setSorting?: OnChangeFn<SortingState>,\n pagination?: PaginationState,\n setPagination?: OnChangeFn<PaginationState>,\n rowCount?: number,\n columnFilters?: ColumnFiltersState,\n setColumnFilters?: OnChangeFn<ColumnFiltersState>,\n manualPagination?: boolean,\n manualFiltering?: boolean,\n globalFilter?: any,\n setGlobalFilter?: OnChangeFn<any>,\n}\n\nfunction DataTableBase<TData, TValue>({\n columns,\n data,\n toolbarRender,\n defaultVisibility,\n sorting,\n setSorting,\n defaultColumnFilters,\n defaultSorting,\n pagination,\n setPagination,\n rowCount,\n columnFilters,\n setColumnFilters,\n globalFilter,\n setGlobalFilter,\n manualPagination = true,\n manualFiltering = true,\n showDefaultToolbar = true,\n onRowClick,\n}: DataTableBaseProps<TData, TValue>) {\n const [rowSelection, setRowSelection] = React.useState({});\n const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>(defaultVisibility || {});\n\n const table: TableType<TData> = useReactTable({\n data,\n columns,\n state: {\n sorting,\n columnVisibility,\n rowSelection,\n columnFilters,\n pagination,\n globalFilter: globalFilter,\n },\n enableRowSelection: true,\n onGlobalFilterChange: setGlobalFilter,\n onRowSelectionChange: setRowSelection,\n onSortingChange: setSorting,\n onColumnFiltersChange: setColumnFilters,\n onColumnVisibilityChange: setColumnVisibility,\n onPaginationChange: setPagination,\n getColumnCanGlobalFilter: (c) => c.columnDef.enableGlobalFilter ?? GlobalFiltering.getDefaultOptions!(table).getColumnCanGlobalFilter!(c),\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n getFacetedRowModel: getFacetedRowModel(),\n getFacetedUniqueValues: getFacetedUniqueValues(),\n autoResetAll: false,\n manualPagination,\n manualFiltering,\n rowCount,\n });\n\n return <TableView\n table={table}\n columns={columns}\n toolbarRender={toolbarRender}\n showDefaultToolbar={showDefaultToolbar}\n defaultColumnFilters={defaultColumnFilters}\n defaultSorting={defaultSorting}\n onRowClick={onRowClick}\n />;\n}\n"],"mappings":";;;;;;;;;;;AAiCA,SAAgB,UAAyB,OAQtC;AACD,QACE,qBAAC;EAAI,WAAU;;GACb,oBAAC;IACC,OAAO,MAAM;IACb,eAAe,MAAM;IACrB,oBAAoB,MAAM;IAC1B,sBAAsB,MAAM;IAC5B,gBAAgB,MAAM;KACtB;GACF,oBAAC;IAAI,WAAU;cACb,qBAAC,oBACC,oBAAC,yBACE,MAAM,MAAM,iBAAiB,CAAC,KAAK,gBAClC,oB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BACA,mBAAmB,MACnB,kBAAkB,MAClB,qBAAqB,MACrB,cACoC;CACpC,MAAM,CAAC,cAAc,mBAAmB,MAAM,SAAS,EAAE,CAAC;CAC1D,MAAM,CAAC,kBAAkB,uBAAuB,MAAM,SAA0B,qBAAqB,EAAE,CAAC;CAExG,MAAM,QAA0B,cAAc;EAC5C;EACA;EACA,OAAO;GACL;GACA;GACA;GACA;GACA;GACc;GACf;EACD,oBAAoB;EACpB,sBAAsB;EACtB,sBAAsB;EACtB,iBAAiB;EACjB,uBAAuB;EACvB,0BAA0B;EAC1B,oBAAoB;EACpB,2BAA2B,MAAM,EAAE,UAAU,sBAAsB,gBAAgB,kBAAmB,MAAM,CAAC,yBAA0B,EAAE;EACzI,iBAAiB,iBAAiB;EAClC,qBAAqB,qBAAqB;EAC1C,uBAAuB,uBAAuB;EAC9C,mBAAmB,mBAAmB;EACtC,oBAAoB,oBAAoB;EACxC,wBAAwB,wBAAwB;EAChD,cAAc;EACd;EACA;EACA;EACD,CAAC;AAEF,QAAO,oBAAC;EACC;EACE;EACM;EACK;EACE;EACN;EACJ;GACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.js","names":[],"sources":["../../../../src/components/data-table/toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Cross2Icon } from \"@radix-ui/react-icons\";\nimport { deepPlainEquals } from \"@
|
|
1
|
+
{"version":3,"file":"toolbar.js","names":[],"sources":["../../../../src/components/data-table/toolbar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Cross2Icon } from \"@radix-ui/react-icons\";\nimport { deepPlainEquals } from \"@hexclave/shared/dist/utils/objects\";\nimport { Button } from \"../ui/button\";\nimport { Cell, ColumnFiltersState, SortingState, Table } from \"@tanstack/react-table\";\nimport { download, generateCsv, mkConfig } from 'export-to-csv';\nimport { DownloadIcon } from \"lucide-react\";\nimport { DataTableViewOptions } from \"./view-options\";\n\ntype DataTableToolbarProps<TData> = {\n table: Table<TData>,\n toolbarRender?: (table: Table<TData>) => React.ReactNode,\n showDefaultToolbar?: boolean,\n defaultColumnFilters: ColumnFiltersState,\n defaultSorting: SortingState,\n showResetFilters?: boolean,\n}\n\nexport function DataTableToolbar<TData>({\n table,\n toolbarRender,\n showDefaultToolbar,\n defaultColumnFilters,\n defaultSorting,\n showResetFilters = true,\n}: DataTableToolbarProps<TData>) {\n const isFiltered = !deepPlainEquals(table.getState().columnFilters, defaultColumnFilters);\n const isSorted = !deepPlainEquals(table.getState().sorting, defaultSorting);\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-2 flex-wrap flex-1 stack-scope\">\n {toolbarRender?.(table)}\n {showResetFilters && (isFiltered || isSorted) && (\n <Button\n variant=\"ghost\"\n onClick={() => {\n table.setColumnFilters(defaultColumnFilters);\n table.setSorting(defaultSorting);\n }}\n className=\"h-8 px-2 lg:px-3\"\n >\n Reset filters\n <Cross2Icon className=\"ml-2 h-4 w-4\" />\n </Button>\n )}\n </div>\n {showDefaultToolbar && (\n <>\n <div className=\"flex items-center gap-2 flex-wrap\">\n <DataTableViewOptions table={table} />\n <Button\n variant=\"outline\"\n size=\"sm\"\n className=\"ml-auto hidden h-8 lg:flex\"\n onClick={() => {\n const csvConfig = mkConfig({\n fieldSeparator: ',',\n filename: 'data',\n decimalSeparator: '.',\n useKeysAsHeaders: true,\n });\n\n const renderCellValue = (cell: Cell<TData, unknown>) => {\n const rendered = cell.renderValue();\n if (rendered === null) {\n return undefined;\n }\n if (['string', 'number', 'boolean', 'undefined'].includes(typeof rendered)) {\n return rendered;\n }\n if (rendered instanceof Date) {\n return rendered.toISOString();\n }\n if (typeof rendered === 'object') {\n return JSON.stringify(rendered);\n }\n };\n\n\n const rowModel = table.getCoreRowModel();\n const rows = rowModel.rows.map(row => Object.fromEntries(row.getAllCells().map(c => [c.column.id, renderCellValue(c)]).filter(([_, v]) => v !== undefined)));\n if (rows.length === 0) {\n alert(\"No data to export\");\n return;\n }\n const csv = generateCsv(csvConfig)(rows as any);\n download(csvConfig)(csv);\n }}\n >\n <DownloadIcon className=\"mr-2 h-4 w-4\" />\n Export CSV\n </Button>\n </div>\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAmBA,SAAgB,iBAAwB,EACtC,OACA,eACA,oBACA,sBACA,gBACA,mBAAmB,QACY;CAC/B,MAAM,aAAa,CAAC,gBAAgB,MAAM,UAAU,CAAC,eAAe,qBAAqB;CACzF,MAAM,WAAW,CAAC,gBAAgB,MAAM,UAAU,CAAC,SAAS,eAAe;AAE3E,QACE,qBAAC;EAAI,WAAU;aACb,qBAAC;GAAI,WAAU;cACZ,gBAAgB,MAAM,EACtB,qBAAqB,cAAc,aAClC,qBAAC;IACC,SAAQ;IACR,eAAe;AACb,WAAM,iBAAiB,qBAAqB;AAC5C,WAAM,WAAW,eAAe;;IAElC,WAAU;eACX,iBAEC,oBAAC,cAAW,WAAU,iBAAiB;KAChC;IAEP,EACL,sBACC,0CACE,qBAAC;GAAI,WAAU;cACb,oBAAC,wBAA4B,QAAS,EACtC,qBAAC;IACC,SAAQ;IACR,MAAK;IACL,WAAU;IACV,eAAe;KACb,MAAM,YAAY,SAAS;MACzB,gBAAgB;MAChB,UAAU;MACV,kBAAkB;MAClB,kBAAkB;MACnB,CAAC;KAEF,MAAM,mBAAmB,SAA+B;MACtD,MAAM,WAAW,KAAK,aAAa;AACnC,UAAI,aAAa,KACf;AAEF,UAAI;OAAC;OAAU;OAAU;OAAW;OAAY,CAAC,SAAS,OAAO,SAAS,CACxE,QAAO;AAET,UAAI,oBAAoB,KACtB,QAAO,SAAS,aAAa;AAE/B,UAAI,OAAO,aAAa,SACtB,QAAO,KAAK,UAAU,SAAS;;KAMnC,MAAM,OADW,MAAM,iBAAiB,CAClB,KAAK,KAAI,QAAO,OAAO,YAAY,IAAI,aAAa,CAAC,KAAI,MAAK,CAAC,EAAE,OAAO,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,OAAO,MAAM,OAAU,CAAC,CAAC;AAC5J,SAAI,KAAK,WAAW,GAAG;AACrB,YAAM,oBAAoB;AAC1B;;KAEF,MAAM,MAAM,YAAY,UAAU,CAAC,KAAY;AAC/C,cAAS,UAAU,CAAC,IAAI;;eAG1B,oBAAC,gBAAa,WAAU,iBAAiB;KAElC;IACL,GACL;GAED"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":[],"sources":["../../../../src/components/ui/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"accordion.js","names":[],"sources":["../../../../src/components/ui/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDownIcon } from \"@radix-ui/react-icons\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = forwardRefIfNeeded<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\"border-b\", className)}\n {...props}\n />\n));\nAccordionItem.displayName = \"AccordionItem\";\n\nconst AccordionTrigger = forwardRefIfNeeded<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, disabled, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"stack-scope flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180\",\n className\n )}\n {...props}\n >\n {children}\n {!disabled && <ChevronDownIcon className=\"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200\" />}\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName;\n\nconst AccordionContent = forwardRefIfNeeded<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"stack-scope text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down\"\n {...props}\n >\n <div className={cn(\"pb-4 pt-0\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nexport { Accordion, AccordionItem, AccordionTrigger, AccordionContent };\n"],"mappings":";;;;;;;;;;AASA,MAAM,YAAY,mBAAmB;AAErC,MAAM,gBAAgB,oBAGnB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,mBAAmB;CACb;CACL,WAAW,GAAG,YAAY,UAAU;CACpC,GAAI;EACJ,CACF;AACF,cAAc,cAAc;AAE5B,MAAM,mBAAmB,oBAGtB,EAAE,WAAW,UAAU,UAAU,GAAG,SAAS,QAC9C,oBAAC,mBAAmB;CAAO,WAAU;WACnC,qBAAC,mBAAmB;EACb;EACL,WAAW,GACT,wIACA,UACD;EACD,GAAI;aAEH,UACA,CAAC,YAAY,oBAAC,mBAAgB,WAAU,6EAA6E;GAC3F;EACH,CAC5B;AACF,iBAAiB,cAAc,mBAAmB,QAAQ;AAE1D,MAAM,mBAAmB,oBAGtB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,oBAAC,mBAAmB;CACb;CACL,WAAU;CACV,GAAI;WAEJ,oBAAC;EAAI,WAAW,GAAG,aAAa,UAAU;EAAG;GAAe;EACjC,CAC7B;AACF,iBAAiB,cAAc,mBAAmB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","names":[],"sources":["../../../../src/components/ui/alert.tsx"],"sourcesContent":["import React from \"react\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../../src/components/ui/alert.tsx"],"sourcesContent":["import React from \"react\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst alertVariants = cva(\n \"stack-scope relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n destructive: \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive bg-destructive/5\",\n success: \"border-success/50 text-success dark:border-success [&>svg]:text-success bg-success/5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nconst Alert = forwardRefIfNeeded<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = forwardRefIfNeeded<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-medium leading-none tracking-tight\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = forwardRefIfNeeded<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n"],"mappings":";;;;;;;AAMA,MAAM,gBAAgB,IACpB,uLACA;CACE,UAAU,EACR,SAAS;EACP,SAAS;EACT,aAAa;EACb,SAAS;EACV,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF;AAED,MAAM,QAAQ,oBAGX,EAAE,WAAW,SAAS,GAAG,SAAS,QACnC,oBAAC;CACM;CACL,MAAK;CACL,WAAW,GAAG,cAAc,EAAE,SAAS,CAAC,EAAE,UAAU;CACpD,GAAI;EACJ,CACF;AACF,MAAM,cAAc;AAEpB,MAAM,aAAa,oBAGhB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,gDAAgD,UAAU;CACxE,GAAI;EACJ,CACF;AACF,WAAW,cAAc;AAEzB,MAAM,mBAAmB,oBAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,iCAAiC,UAAU;CACzD,GAAI;EACJ,CACF;AACF,iBAAiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","names":[],"sources":["../../../../src/components/ui/avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"avatar.js","names":[],"sources":["../../../../src/components/ui/avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Avatar = forwardRefIfNeeded<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n \"stack-scope relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full\",\n className\n )}\n {...props}\n />\n));\nAvatar.displayName = AvatarPrimitive.Root.displayName;\n\nconst AvatarImage = forwardRefIfNeeded<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n));\nAvatarImage.displayName = AvatarPrimitive.Image.displayName;\n\nconst AvatarFallback = forwardRefIfNeeded<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted\",\n className\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;\n\nexport { Avatar, AvatarImage, AvatarFallback };\n"],"mappings":";;;;;;;;;AAQA,MAAM,SAAS,oBAGZ,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,6EACA,UACD;CACD,GAAI;EACJ,CACF;AACF,OAAO,cAAc,gBAAgB,KAAK;AAE1C,MAAM,cAAc,oBAGjB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GAAG,+BAA+B,UAAU;CACvD,GAAI;EACJ,CACF;AACF,YAAY,cAAc,gBAAgB,MAAM;AAEhD,MAAM,iBAAiB,oBAGpB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,wEACA,UACD;CACD,GAAI;EACJ,CACF;AACF,eAAe,cAAc,gBAAgB,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":[],"sources":["../../../../src/components/ui/badge.tsx"],"sourcesContent":["import { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"badge.js","names":[],"sources":["../../../../src/components/ui/badge.tsx"],"sourcesContent":["import { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst badgeVariants = cva(\n \"stack-scope inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground shadow\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground\",\n destructive:\n \"border-transparent bg-destructive text-destructive-foreground shadow\",\n outline: \"text-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nexport type BadgeProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;\n\nconst Badge = forwardRefIfNeeded<HTMLDivElement, BadgeProps>(({ className, variant, ...props }, ref) => {\n return (\n <div ref={ref} className={cn(badgeVariants({ variant }), className)} {...props} />\n );\n});\nBadge.displayName = \"Badge\";\n\nexport { Badge, badgeVariants };\n"],"mappings":";;;;;;;AAMA,MAAM,gBAAgB,IACpB,kKACA;CACE,UAAU,EACR,SAAS;EACP,SACE;EACF,WACE;EACF,aACE;EACF,SAAS;EACV,EACF;CACD,iBAAiB,EACf,SAAS,WACV;CACF,CACF;AAID,MAAM,QAAQ,oBAAgD,EAAE,WAAW,SAAS,GAAG,SAAS,QAAQ;AACtG,QACE,oBAAC;EAAS;EAAK,WAAW,GAAG,cAAc,EAAE,SAAS,CAAC,EAAE,UAAU;EAAE,GAAI;GAAS;EAEpF;AACF,MAAM,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../../../src/components/ui/breadcrumb.tsx"],"sourcesContent":["import React from \"react\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","names":[],"sources":["../../../../src/components/ui/breadcrumb.tsx"],"sourcesContent":["import React from \"react\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { ChevronRightIcon, DotsHorizontalIcon } from \"@radix-ui/react-icons\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Breadcrumb = forwardRefIfNeeded<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode,\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />);\nBreadcrumb.displayName = \"Breadcrumb\";\n\nconst BreadcrumbList = forwardRefIfNeeded<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"stack-scope flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5\",\n className\n )}\n {...props}\n />\n));\nBreadcrumbList.displayName = \"BreadcrumbList\";\n\nconst BreadcrumbItem = forwardRefIfNeeded<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n));\nBreadcrumbItem.displayName = \"BreadcrumbItem\";\n\nconst BreadcrumbLink = forwardRefIfNeeded<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean,\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\";\n\n return (\n <Comp\n ref={ref}\n className={cn(\"hover:text-foreground\", className)}\n {...props}\n />\n );\n});\nBreadcrumbLink.displayName = \"BreadcrumbLink\";\n\nconst BreadcrumbPage = forwardRefIfNeeded<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-foreground\", className)}\n {...props}\n />\n));\nBreadcrumbPage.displayName = \"BreadcrumbPage\";\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRightIcon />}\n </li>\n);\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\";\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <DotsHorizontalIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n);\nBreadcrumbEllipsis.displayName = \"BreadcrumbElipssis\";\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n};\n"],"mappings":";;;;;;;;AAOA,MAAM,aAAa,oBAKhB,EAAE,GAAG,SAAS,QAAQ,oBAAC;CAAS;CAAK,cAAW;CAAa,GAAI;EAAS,CAAC;AAC9E,WAAW,cAAc;AAEzB,MAAM,iBAAiB,oBAGpB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GACT,wGACA,UACD;CACD,GAAI;EACJ,CACF;AACF,eAAe,cAAc;AAE7B,MAAM,iBAAiB,oBAGpB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,oCAAoC,UAAU;CAC5D,GAAI;EACJ,CACF;AACF,eAAe,cAAc;AAE7B,MAAM,iBAAiB,oBAKpB,EAAE,SAAS,WAAW,GAAG,SAAS,QAAQ;AAG3C,QACE,oBAHW,UAAU,OAAO;EAIrB;EACL,WAAW,GAAG,yBAAyB,UAAU;EACjD,GAAI;GACJ;EAEJ;AACF,eAAe,cAAc;AAE7B,MAAM,iBAAiB,oBAGpB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,MAAK;CACL,iBAAc;CACd,gBAAa;CACb,WAAW,GAAG,+BAA+B,UAAU;CACvD,GAAI;EACJ,CACF;AACF,eAAe,cAAc;AAE7B,MAAM,uBAAuB,EAC3B,UACA,WACA,GAAG,YAEH,oBAAC;CACC,MAAK;CACL,eAAY;CACZ,WAAW,GAAG,oBAAoB,UAAU;CAC5C,GAAI;WAEH,YAAY,oBAAC,qBAAmB;EAC9B;AAEP,oBAAoB,cAAc;AAElC,MAAM,sBAAsB,EAC1B,WACA,GAAG,YAEH,qBAAC;CACC,MAAK;CACL,eAAY;CACZ,WAAW,GAAG,4CAA4C,UAAU;CACpE,GAAI;YAEJ,oBAAC,sBAAmB,WAAU,YAAY,EAC1C,oBAAC;EAAK,WAAU;YAAU;GAAW;EAChC;AAET,mBAAmB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../../../src/components/ui/button.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../../src/components/ui/button.tsx"],"sourcesContent":["import { Slot, Slottable } from \"@radix-ui/react-slot\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport React from \"react\";\n\nimport { useAsyncCallback } from \"@hexclave/shared/dist/hooks/use-async-callback\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { cn } from \"../../lib/utils\";\nimport { Spinner } from \"./spinner\";\n\nconst buttonVariants = cva(\n \"stack-scope inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\",\n plain: \"\",\n },\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\",\n plain: \"\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n);\n\nexport type OriginalButtonProps = {\n asChild?: boolean,\n} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>\n\nconst OriginalButton = forwardRefIfNeeded<HTMLButtonElement, OriginalButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n }\n);\nOriginalButton.displayName = \"Button\";\n\ntype ButtonProps = {\n onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void | Promise<void>,\n loading?: boolean,\n loadingStyle?: \"spinner\" | \"disabled\",\n} & OriginalButtonProps\n\nconst Button = forwardRefIfNeeded<HTMLButtonElement, ButtonProps>(\n ({ onClick, loading: loadingProp, loadingStyle = \"spinner\", children, size, ...props }, ref) => {\n const [handleClick, isLoading] = useAsyncCallback(async (e: React.MouseEvent<HTMLButtonElement>) => {\n await onClick?.(e);\n }, [onClick]);\n\n const loading = loadingProp || isLoading;\n\n return (\n <OriginalButton\n {...props}\n ref={ref}\n disabled={props.disabled || loading}\n onClick={(e) => runAsynchronouslyWithAlert(handleClick(e))}\n size={size}\n className={cn(\"relative\", loading && \"[&>:not(.stack-button-do-not-hide-when-siblings-are)]:invisible\", props.className)}\n >\n {loadingStyle === \"spinner\" && <Spinner className={cn(\"absolute inset-0 flex items-center justify-center stack-button-do-not-hide-when-siblings-are\", !loading && \"invisible\")} />}\n <Slottable>\n {typeof children === \"string\" ? <span>{children}</span> : children}\n </Slottable>\n </OriginalButton>\n );\n }\n);\nButton.displayName = \"Button\";\n\nexport { Button, ButtonProps, buttonVariants };\n\n"],"mappings":";;;;;;;;;;;AAUA,MAAM,iBAAiB,IACrB,iOACA;CACE,UAAU;EACR,SAAS;GACP,SACE;GACF,aACE;GACF,SACE;GACF,WACE;GACF,OAAO;GACP,MAAM;GACN,OAAO;GACR;EACD,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,MAAM;GACN,OAAO;GACR;EACF;CACD,iBAAiB;EACf,SAAS;EACT,MAAM;EACP;CACF,CACF;AAMD,MAAM,iBAAiB,oBACpB,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,SAAS,QAAQ;AAEhE,QACE,oBAFW,UAAU,OAAO;EAG1B,WAAW,GAAG,eAAe;GAAE;GAAS;GAAM;GAAW,CAAC,CAAC;EACtD;EACL,GAAI;GACJ;EAGP;AACD,eAAe,cAAc;AAQ7B,MAAM,SAAS,oBACZ,EAAE,SAAS,SAAS,aAAa,eAAe,WAAW,UAAU,MAAM,GAAG,SAAS,QAAQ;CAC9F,MAAM,CAAC,aAAa,aAAa,iBAAiB,OAAO,MAA2C;AAClG,QAAM,UAAU,EAAE;IACjB,CAAC,QAAQ,CAAC;CAEb,MAAM,UAAU,eAAe;AAE/B,QACE,qBAAC;EACC,GAAI;EACC;EACL,UAAU,MAAM,YAAY;EAC5B,UAAU,MAAM,2BAA2B,YAAY,EAAE,CAAC;EACpD;EACN,WAAW,GAAG,YAAY,WAAW,mEAAmE,MAAM,UAAU;aAEvH,iBAAiB,aAAa,oBAAC,WAAQ,WAAW,GAAG,gGAAgG,CAAC,WAAW,YAAY,GAAI,EAClL,oBAAC,uBACE,OAAO,aAAa,WAAW,oBAAC,UAAM,WAAgB,GAAG,WAChD;GACG;EAGtB;AACD,OAAO,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.js","names":[],"sources":["../../../../src/components/ui/card.tsx"],"sourcesContent":["import { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"card.js","names":[],"sources":["../../../../src/components/ui/card.tsx"],"sourcesContent":["import { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Card = forwardRefIfNeeded<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n \"rounded-xl border bg-card text-card-foreground shadow-sm\",\n className\n )}\n {...props}\n />\n));\nCard.displayName = \"Card\";\n\nconst CardHeader = forwardRefIfNeeded<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex flex-col space-y-1.5 p-6 pb-0\", className)}\n {...props}\n />\n));\nCardHeader.displayName = \"CardHeader\";\n\nconst CardTitle = forwardRefIfNeeded<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h3\n ref={ref}\n className={cn(\"font-semibold leading-none tracking-tight capitalize\", className)}\n {...props}\n />\n));\nCardTitle.displayName = \"CardTitle\";\n\nconst CardDescription = forwardRefIfNeeded<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nCardDescription.displayName = \"CardDescription\";\n\nconst CardContent = forwardRefIfNeeded<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn(\"p-6\", className)} {...props} />\n));\nCardContent.displayName = \"CardContent\";\n\nconst CardSubtitle = forwardRefIfNeeded<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <h4\n ref={ref}\n className={cn(\"text-sm text-muted-foreground font-bold\", className)}\n {...props}\n />\n));\n\nconst CardFooter = forwardRefIfNeeded<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"flex items-center p-6 pt-0\", className)}\n {...props}\n />\n));\nCardFooter.displayName = \"CardFooter\";\n\nexport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardSubtitle, CardTitle };\n\n"],"mappings":";;;;;AAIA,MAAM,OAAO,oBAGV,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GACT,4DACA,UACD;CACD,GAAI;EACJ,CACF;AACF,KAAK,cAAc;AAEnB,MAAM,aAAa,oBAGhB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,sCAAsC,UAAU;CAC9D,GAAI;EACJ,CACF;AACF,WAAW,cAAc;AAEzB,MAAM,YAAY,oBAGf,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,wDAAwD,UAAU;CAChF,GAAI;EACJ,CACF;AACF,UAAU,cAAc;AAExB,MAAM,kBAAkB,oBAGrB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,iCAAiC,UAAU;CACzD,GAAI;EACJ,CACF;AACF,gBAAgB,cAAc;AAE9B,MAAM,cAAc,oBAGjB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CAAS;CAAK,WAAW,GAAG,OAAO,UAAU;CAAE,GAAI;EAAS,CAC7D;AACF,YAAY,cAAc;AAE1B,MAAM,eAAe,oBAGlB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,2CAA2C,UAAU;CACnE,GAAI;EACJ,CACF;AAEF,MAAM,aAAa,oBAGhB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC;CACM;CACL,WAAW,GAAG,8BAA8B,UAAU;CACtD,GAAI;EACJ,CACF;AACF,WAAW,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../src/components/ui/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":[],"sources":["../../../../src/components/ui/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { CheckIcon } from \"@radix-ui/react-icons\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Checkbox = forwardRefIfNeeded<\n React.ElementRef<typeof CheckboxPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n \"stack-scope peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n className={cn(\"flex items-center justify-center text-current\")}\n >\n <CheckIcon className=\"h-4 w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n));\nCheckbox.displayName = CheckboxPrimitive.Root.displayName;\n\nexport { Checkbox };\n"],"mappings":";;;;;;;;;;AASA,MAAM,WAAW,oBAGd,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,kBAAkB;CACZ;CACL,WAAW,GACT,kRACA,UACD;CACD,GAAI;WAEJ,oBAAC,kBAAkB;EACjB,WAAW,GAAG,gDAAgD;YAE9D,oBAAC,aAAU,WAAU,YAAY;GACL;EACP,CACzB;AACF,SAAS,cAAc,kBAAkB,KAAK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","names":["CommandPrimitive"],"sources":["../../../../src/components/ui/command.tsx"],"sourcesContent":["\"use client\";\n\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"command.js","names":["CommandPrimitive"],"sources":["../../../../src/components/ui/command.tsx"],"sourcesContent":["\"use client\";\n\nimport { type DialogProps } from \"@radix-ui/react-dialog\";\nimport { MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\nimport { Dialog, DialogBody, DialogContent } from \"./dialog\";\n\nconst Command: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"stack-scope flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n));\nCommand.displayName = CommandPrimitive.displayName;\n\ntype CommandDialogProps = {} & DialogProps\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <DialogBody>\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogBody>\n </DialogContent>\n </Dialog>\n );\n};\n\nconst CommandInput: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <MagnifyingGlassIcon className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n));\n\nCommandInput.displayName = CommandPrimitive.Input.displayName;\n\nconst CommandList: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n));\n\nCommandList.displayName = CommandPrimitive.List.displayName;\n\nconst CommandEmpty: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => (\n <CommandPrimitive.Empty\n ref={ref}\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n));\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName;\n\nconst CommandGroup: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName;\n\nconst CommandSeparator: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n));\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName;\n\nconst CommandItem: React.FC<React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>> = forwardRefIfNeeded<\n React.ElementRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50\",\n className\n )}\n {...props}\n />\n));\n\nCommandItem.displayName = CommandPrimitive.Item.displayName;\n\nconst CommandShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n );\n};\nCommandShortcut.displayName = \"CommandShortcut\";\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n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E1D,MAAM,cAAsF,oBAGzF,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAACA,UAAiB;CACX;CACL,WAAW,GACT,2OACA,UACD;CACD,GAAI;EACJ,CACF;AAEF,YAAY,cAAcA,UAAiB,KAAK;AAEhD,MAAM,mBAAmB,EACvB,WACA,GAAG,YACwC;AAC3C,QACE,oBAAC;EACC,WAAW,GACT,yDACA,UACD;EACD,GAAI;GACJ;;AAGN,gBAAgB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","names":[],"sources":["../../../../src/components/ui/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"context-menu.js","names":[],"sources":["../../../../src/components/ui/context-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport React from \"react\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport * as ContextMenuPrimitive from \"@radix-ui/react-context-menu\";\nimport {\n CheckIcon,\n ChevronRightIcon,\n DotFilledIcon,\n} from \"@radix-ui/react-icons\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst ContextMenu = ContextMenuPrimitive.Root;\n\nconst ContextMenuTrigger = ContextMenuPrimitive.Trigger;\n\nconst ContextMenuGroup = ContextMenuPrimitive.Group;\n\nconst ContextMenuPortal = ContextMenuPrimitive.Portal;\n\nconst ContextMenuSub = ContextMenuPrimitive.Sub;\n\nconst ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;\n\nconst ContextMenuSubTrigger = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & {\n inset?: boolean,\n }\n>(({ className, inset, children, ...props }, ref) => (\n <ContextMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"stack-scope flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </ContextMenuPrimitive.SubTrigger>\n));\nContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;\n\nconst ContextMenuSubContent = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n));\nContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;\n\nconst ContextMenuContent = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Portal>\n <ContextMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </ContextMenuPrimitive.Portal>\n));\nContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;\n\nconst ContextMenuItem = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & {\n inset?: boolean,\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;\n\nconst ContextMenuCheckboxItem = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <ContextMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.CheckboxItem>\n));\nContextMenuCheckboxItem.displayName =\n ContextMenuPrimitive.CheckboxItem.displayName;\n\nconst ContextMenuRadioItem = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <ContextMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <ContextMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </ContextMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </ContextMenuPrimitive.RadioItem>\n));\nContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;\n\nconst ContextMenuLabel = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & {\n inset?: boolean,\n }\n>(({ className, inset, ...props }, ref) => (\n <ContextMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold text-foreground\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;\n\nconst ContextMenuSeparator = forwardRefIfNeeded<\n React.ElementRef<typeof ContextMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <ContextMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n));\nContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;\n\nconst ContextMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n );\n};\nContextMenuShortcut.displayName = \"ContextMenuShortcut\";\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuCheckboxItem,\n ContextMenuRadioItem,\n ContextMenuLabel,\n ContextMenuSeparator,\n ContextMenuShortcut,\n ContextMenuGroup,\n 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BACpB,oBAAC,aAAU,WAAU,YAAY,GACE;GAChC,EACN;EACiC,CACpC;AACF,wBAAwB,cACtB,qBAAqB,aAAa;AAEpC,MAAM,uBAAuB,oBAG1B,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,qBAAqB;CACf;CACL,WAAW,GACT,sNACA,UACD;CACD,GAAI;YAEJ,oBAAC;EAAK,WAAU;YACd,oBAAC,qBAAqB,2BACpB,oBAAC,iBAAc,WAAU,yBAAyB,GACf;GAChC,EACN;EAC8B,CACjC;AACF,qBAAqB,cAAc,qBAAqB,UAAU;AAElE,MAAM,mBAAmB,oBAKtB,EAAE,WAAW,OAAO,GAAG,SAAS,QACjC,oBAAC,qBAAqB;CACf;CACL,WAAW,GACT,qDACA,SAAS,QACT,UACD;CACD,GAAI;EACJ,CACF;AACF,iBAAiB,cAAc,qBAAqB,MAAM;AAE1D,MAAM,uBAAuB,oBAG1B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,qBAAqB;CACf;CACL,WAAW,GAAG,6BAA6B,UAAU;CACrD,GAAI;EACJ,CACF;AACF,qBAAqB,cAAc,qBAAqB,UAAU;AAElE,MAAM,uBAAuB,EAC3B,WACA,GAAG,YACwC;AAC3C,QACE,oBAAC;EACC,WAAW,GACT,yDACA,UACD;EACD,GAAI;GACJ;;AAGN,oBAAoB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../../../src/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross2Icon } from \"@radix-ui/react-icons\";\nimport { forwardRefIfNeeded } from \"@
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../../../src/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { Cross2Icon } from \"@radix-ui/react-icons\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = forwardRefIfNeeded<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n \"stack-scope fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=open]:fade-in\",\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = forwardRefIfNeeded<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n overlayProps?: React.ComponentPropsWithoutRef<typeof DialogOverlay>,\n noCloseButton?: boolean,\n }\n>(({ className, children, overlayProps, noCloseButton, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay {...overlayProps} />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n \"stack-scope fixed left-[50%] top-[50%] max-h-screen z-50 flex flex-col w-full max-w-lg translate-x-[-50%] translate-y-[-50%] border bg-background p-6 shadow-lg duration-100 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className\n )}\n {...props}\n >\n {children}\n {!noCloseButton && <DialogPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground\">\n <Cross2Icon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>}\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogBody = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn(\"stack-scope overflow-y-auto flex flex-col gap-4 w-[calc(100%+3rem)] -mx-6 px-6 my-2 py-2\", className)} {...props} />\n);\n\nconst DialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"stack-scope flex flex-col space-y-1.5 text-center sm:text-left\",\n className\n )}\n {...props}\n />\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"stack-scope flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className\n )}\n {...props}\n />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = forwardRefIfNeeded<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n \"stack-scope text-lg font-semibold leading-none tracking-tight\",\n className\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = forwardRefIfNeeded<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn(\"stack-scope text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogBody,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger\n};\n\n"],"mappings":";;;;;;;;;;AASA,MAAM,SAAS,gBAAgB;AAE/B,MAAM,gBAAgB,gBAAgB;AAEtC,MAAM,eAAe,gBAAgB;AAErC,MAAM,cAAc,gBAAgB;AAEpC,MAAM,gBAAgB,oBAGnB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,kKACA,UACD;CACD,GAAI;EACJ,CACF;AACF,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,MAAM,gBAAgB,oBAMnB,EAAE,WAAW,UAAU,cAAc,eAAe,GAAG,SAAS,QACjE,qBAAC,2BACC,oBAAC,iBAAc,GAAI,eAAgB,EACnC,qBAAC,gBAAgB;CACV;CACL,WAAW,GACT,2hBACA,UACD;CACD,GAAI;YAEH,UACA,CAAC,iBAAiB,qBAAC,gBAAgB;EAAM,WAAU;aAClD,oBAAC,cAAW,WAAU,YAAY,EAClC,oBAAC;GAAK,WAAU;aAAU;IAAY;GAChB;EACA,IACb,CACf;AACF,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,MAAM,cAAc,EAClB,WACA,GAAG,YAEH,oBAAC;CAAI,WAAW,GAAG,4FAA4F,UAAU;CAAE,GAAI;EAAS;AAG1I,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,oBAAC;CACC,WAAW,GACT,kEACA,UACD;CACD,GAAI;EACJ;AAEJ,aAAa,cAAc;AAE3B,MAAM,gBAAgB,EACpB,WACA,GAAG,YAEH,oBAAC;CACC,WAAW,GACT,6EACA,UACD;CACD,GAAI;EACJ;AAEJ,aAAa,cAAc;AAE3B,MAAM,cAAc,oBAGjB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GACT,iEACA,UACD;CACD,GAAI;EACJ,CACF;AACF,YAAY,cAAc,gBAAgB,MAAM;AAEhD,MAAM,oBAAoB,oBAGvB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB;CACV;CACL,WAAW,GAAG,6CAA6C,UAAU;CACrE,GAAI;EACJ,CACF;AACF,kBAAkB,cAAc,gBAAgB,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from \"@radix-ui/react-icons\";\nimport { forwardRefIfNeeded } from \"@stackframe/stack-shared/dist/utils/react\";\nimport React from \"react\";\n\nimport { useAsyncCallback } from \"@stackframe/stack-shared/dist/hooks/use-async-callback\";\nimport { throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { runAsynchronouslyWithAlert } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { cn } from \"../../lib/utils\";\nimport { Spinner } from \"./spinner\";\n\nconst DropdownMenuContext = React.createContext<{\n open: boolean,\n setOpen: (open: boolean) => void,\n} | undefined>(undefined);\n\nconst DropdownMenu = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root>\n>(({ ...props }, ref) => {\n const [open, setOpen] = React.useState(!!props.open);\n\n return (\n <DropdownMenuContext.Provider value={{\n open,\n setOpen: (o) => {\n props.onOpenChange?.(o);\n setOpen(o);\n }\n }}>\n <DropdownMenuPrimitive.Root\n {...props}\n open={props.open ?? open}\n onOpenChange={o => {\n props.onOpenChange?.(o);\n setOpen(o);\n }}\n />\n </DropdownMenuContext.Provider>\n );\n});\nDropdownMenu.displayName = DropdownMenuPrimitive.Root.displayName;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean,\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"stack-scope flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"stack-scope z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"stack-scope z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>, \"onClick\"> & {\n inset?: boolean,\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void | Promise<void>,\n }\n>(({ className, inset, ...props }, ref) => {\n const { setOpen } = React.useContext(DropdownMenuContext) ?? throwErr(\"No DropdownMenuContext found\");\n const [handleClick, isLoading] = useAsyncCallback(async (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n await props.onClick?.(e);\n setOpen(false);\n }, [props.onClick]);\n\n return <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"stack-scope relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n disabled={isLoading || props.disabled}\n onClick={props.onClick ? (e) => {\n e.preventDefault();\n e.stopPropagation();\n runAsynchronouslyWithAlert(handleClick(e));\n } : undefined}\n >\n <div style={{ visibility: isLoading ? \"visible\" : \"hidden\", position: \"absolute\", inset: 0, display: \"flex\", justifyContent: \"center\", alignItems: \"center\" }}>\n <Spinner />\n </div>\n <div style={{ visibility: isLoading ? \"hidden\" : \"visible\" }}>\n {props.children}\n </div>\n </DropdownMenuPrimitive.Item>;\n});\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean,\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"stack-scope ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator,\n DropdownMenuShortcut, DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger, DropdownMenuTrigger\n};\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAM,sBAAsB,MAAM,cAGnB,OAAU;AAEzB,MAAM,eAAe,oBAGlB,EAAE,GAAG,SAAS,QAAQ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AG,SAAS,QACjC,oBAAC,sBAAsB;CAChB;CACL,WAAW,GACT,qCACA,SAAS,QACT,UACD;CACD,GAAI;EACJ,CACF;AACF,kBAAkB,cAAc,sBAAsB,MAAM;AAE5D,MAAM,wBAAwB,oBAG3B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,sBAAsB;CAChB;CACL,WAAW,GAAG,4BAA4B,UAAU;CACpD,GAAI;EACJ,CACF;AACF,sBAAsB,cAAc,sBAAsB,UAAU;AAEpE,MAAM,wBAAwB,EAC5B,WACA,GAAG,YACwC;AAC3C,QACE,oBAAC;EACC,WAAW,GAAG,0DAA0D,UAAU;EAClF,GAAI;GACJ;;AAGN,qBAAqB,cAAc"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":[],"sources":["../../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["\"use client\";\n\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { CheckIcon, ChevronRightIcon, DotFilledIcon } from \"@radix-ui/react-icons\";\nimport { forwardRefIfNeeded } from \"@hexclave/shared/dist/utils/react\";\nimport React from \"react\";\n\nimport { useAsyncCallback } from \"@hexclave/shared/dist/hooks/use-async-callback\";\nimport { throwErr } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { cn } from \"../../lib/utils\";\nimport { Spinner } from \"./spinner\";\n\nconst DropdownMenuContext = React.createContext<{\n open: boolean,\n setOpen: (open: boolean) => void,\n} | undefined>(undefined);\n\nconst DropdownMenu = forwardRefIfNeeded<\n never,\n DropdownMenuPrimitive.DropdownMenuProps\n>(({ ...props }, ref) => {\n const [open, setOpen] = React.useState(!!props.open);\n\n return (\n <DropdownMenuContext.Provider value={{\n open,\n setOpen: (o) => {\n props.onOpenChange?.(o);\n setOpen(o);\n }\n }}>\n <DropdownMenuPrimitive.Root\n {...props}\n open={props.open ?? open}\n onOpenChange={o => {\n props.onOpenChange?.(o);\n setOpen(o);\n }}\n />\n </DropdownMenuContext.Provider>\n );\n});\nDropdownMenu.displayName = DropdownMenuPrimitive.Root.displayName;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean,\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n \"stack-scope flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto h-4 w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n \"stack-scope z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n \"stack-scope z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md\",\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n Omit<React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item>, \"onClick\"> & {\n inset?: boolean,\n onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void | Promise<void>,\n }\n>(({ className, inset, ...props }, ref) => {\n const { setOpen } = React.useContext(DropdownMenuContext) ?? throwErr(\"No DropdownMenuContext found\");\n const [handleClick, isLoading] = useAsyncCallback(async (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n await props.onClick?.(e);\n setOpen(false);\n }, [props.onClick]);\n\n return <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n \"stack-scope relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n disabled={isLoading || props.disabled}\n onClick={props.onClick ? (e) => {\n e.preventDefault();\n e.stopPropagation();\n runAsynchronouslyWithAlert(handleClick(e));\n } : undefined}\n >\n <div style={{ visibility: isLoading ? \"visible\" : \"hidden\", position: \"absolute\", inset: 0, display: \"flex\", justifyContent: \"center\", alignItems: \"center\" }}>\n <Spinner />\n </div>\n <div style={{ visibility: isLoading ? \"hidden\" : \"visible\" }}>\n {props.children}\n </div>\n </DropdownMenuPrimitive.Item>;\n});\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n \"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50\",\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotFilledIcon className=\"h-4 w-4 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean,\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"px-2 py-1.5 text-sm font-semibold\",\n inset && \"pl-8\",\n className\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = forwardRefIfNeeded<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 my-1 h-px bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n className={cn(\"stack-scope ml-auto text-xs tracking-widest opacity-60\", className)}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator,\n DropdownMenuShortcut, DropdownMenuSub,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