@orion-ds/react 4.6.6 → 4.7.0
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/blocks/index.d 2.ts +9 -0
- package/dist/blocks/index.d.ts 2.map +1 -0
- package/dist/blocks 2.css +76 -0
- package/dist/components/index.d 4.ts +151 -0
- package/dist/components/index.d.ts 4.map +1 -0
- package/dist/contexts/ThemeContext.d 4.ts +70 -0
- package/dist/contexts/ThemeContext.d.ts 4.map +1 -0
- package/dist/contexts/index.d 4.ts +8 -0
- package/dist/contexts/index.d.ts 4.map +1 -0
- package/dist/dnd.d 2.ts +16 -0
- package/dist/dnd.d.ts 2.map +1 -0
- package/dist/docs/DocComponents.d 3.ts +61 -0
- package/dist/docs/DocComponents.d.ts 3.map +1 -0
- package/dist/editor.d 2.ts +13 -0
- package/dist/editor.d.ts 2.map +1 -0
- package/dist/examples/LandingPage.example.d 4.ts +47 -0
- package/dist/examples/LandingPage.example.d.ts 4.map +1 -0
- package/dist/examples/index.d 4.ts +22 -0
- package/dist/examples/index.d.ts 4.map +1 -0
- package/dist/hooks/index.d 4.ts +20 -0
- package/dist/hooks/index.d.ts 4.map +1 -0
- package/dist/hooks/useClickOutside.d 4.ts +19 -0
- package/dist/hooks/useClickOutside.d.ts 4.map +1 -0
- package/dist/hooks/useCopyToClipboard.d 4.ts +72 -0
- package/dist/hooks/useCopyToClipboard.d.ts 4.map +1 -0
- package/dist/hooks/useDebounce.d 4.ts +58 -0
- package/dist/hooks/useDebounce.d.ts 4.map +1 -0
- package/dist/hooks/useDisclosure.d 4.ts +86 -0
- package/dist/hooks/useDisclosure.d.ts 4.map +1 -0
- package/dist/hooks/useKeyboard.d 4.ts +101 -0
- package/dist/hooks/useKeyboard.d.ts 4.map +1 -0
- package/dist/hooks/useLocalStorage.d 4.ts +48 -0
- package/dist/hooks/useLocalStorage.d.ts 4.map +1 -0
- package/dist/hooks/useMediaQuery.d 4.ts +43 -0
- package/dist/hooks/useMediaQuery.d.ts 4.map +1 -0
- package/dist/hooks/useTheme.d 4.ts +73 -0
- package/dist/hooks/useTheme.d.ts 4.map +1 -0
- package/dist/index 3.mjs +275 -0
- package/dist/index 4.cjs +1 -0
- package/dist/index.d 2.ts +171 -0
- package/dist/index.d.ts 2.map +1 -0
- package/dist/index10 2.mjs +58 -0
- package/dist/index10 3.cjs +1 -0
- package/dist/index100 3.cjs +1 -0
- package/dist/index100 3.mjs +23 -0
- package/dist/index101 2.mjs +29 -0
- package/dist/index101 3.cjs +1 -0
- package/dist/index102 2.mjs +45 -0
- package/dist/index102 3.cjs +1 -0
- package/dist/index103 3.cjs +1 -0
- package/dist/index103 3.mjs +67 -0
- package/dist/index104 2.cjs +1 -0
- package/dist/index104 2.mjs +65 -0
- package/dist/index105 2.cjs +1 -0
- package/dist/index105 3.mjs +27 -0
- package/dist/index106 2.cjs +1 -0
- package/dist/index106 2.mjs +39 -0
- package/dist/index107 2.cjs +1 -0
- package/dist/index107 3.mjs +21 -0
- package/dist/index108 2.mjs +33 -0
- package/dist/index108 4.cjs +1 -0
- package/dist/index109 2.cjs +1 -0
- package/dist/index109 4.mjs +39 -0
- package/dist/index11 2.mjs +20 -0
- package/dist/index11 4.cjs +1 -0
- package/dist/index110 2.cjs +1 -0
- package/dist/index110 2.mjs +31 -0
- package/dist/index111 2.mjs +49 -0
- package/dist/index111 3.cjs +1 -0
- package/dist/index112 2.cjs +1 -0
- package/dist/index112 2.mjs +36 -0
- package/dist/index113 2.cjs +1 -0
- package/dist/index113 2.mjs +43 -0
- package/dist/index114 2.cjs +1 -0
- package/dist/index114 2.mjs +27 -0
- package/dist/index115 3.mjs +237 -0
- package/dist/index115 4.cjs +1 -0
- package/dist/index116 3.cjs +1 -0
- package/dist/index116 3.mjs +36 -0
- package/dist/index117 2.mjs +46 -0
- package/dist/index117 4.cjs +1 -0
- package/dist/index118 2.cjs +1 -0
- package/dist/index118 2.mjs +173 -0
- package/dist/index119 2.cjs +1 -0
- package/dist/index119 2.mjs +188 -0
- package/dist/index120 2.mjs +31 -0
- package/dist/index120 3.cjs +1 -0
- package/dist/index121 2.cjs +1 -0
- package/dist/index121 2.mjs +93 -0
- package/dist/index122 2.mjs +55 -0
- package/dist/index122 4.cjs +1 -0
- package/dist/index123 2.cjs +1 -0
- package/dist/index123 3.mjs +69 -0
- package/dist/index124 2.mjs +127 -0
- package/dist/index124 4.cjs +1 -0
- package/dist/index125 3.mjs +111 -0
- package/dist/index125 4.cjs +1 -0
- package/dist/index126 4.cjs +1 -0
- package/dist/index126 4.mjs +114 -0
- package/dist/index127 2.mjs +125 -0
- package/dist/index127 4.cjs +1 -0
- package/dist/index128 2.cjs +1 -0
- package/dist/index128 2.mjs +217 -0
- package/dist/index129 2.cjs +1 -0
- package/dist/index129 2.mjs +109 -0
- package/dist/index13 2.mjs +84 -0
- package/dist/index13 4.cjs +1 -0
- package/dist/index130 2.cjs +1 -0
- package/dist/index130 2.mjs +68 -0
- package/dist/index131 2.cjs +1 -0
- package/dist/index131 3.mjs +45 -0
- package/dist/index132 3.cjs +1 -0
- package/dist/index132 4.mjs +31 -0
- package/dist/index133 3.mjs +33 -0
- package/dist/index133 4.cjs +1 -0
- package/dist/index134 2.mjs +49 -0
- package/dist/index134 3.cjs +1 -0
- package/dist/index135 3.cjs +1 -0
- package/dist/index135 4.mjs +15 -0
- package/dist/index136 2.mjs +47 -0
- package/dist/index136 3.cjs +1 -0
- package/dist/index137 2.mjs +58 -0
- package/dist/index137 3.cjs +1 -0
- package/dist/index138 2.mjs +23 -0
- package/dist/index138 4.cjs +1 -0
- package/dist/index139 2.mjs +21 -0
- package/dist/index139 3.cjs +1 -0
- package/dist/index14 2.mjs +71 -0
- package/dist/index14 4.cjs +1 -0
- package/dist/index140 2.cjs +1 -0
- package/dist/index140 4.mjs +27 -0
- package/dist/index141 2.cjs +1 -0
- package/dist/index141 2.mjs +27 -0
- package/dist/index142 3.mjs +56 -0
- package/dist/index142 4.cjs +1 -0
- package/dist/index143 2.mjs +47 -0
- package/dist/index143 3.cjs +1 -0
- package/dist/index144 2.mjs +31 -0
- package/dist/index144 4.cjs +1 -0
- package/dist/index145 2.cjs +1 -0
- package/dist/index145 3.mjs +70 -0
- package/dist/index146 2.cjs +1 -0
- package/dist/index146 3.mjs +36 -0
- package/dist/index147 2.mjs +23 -0
- package/dist/index147 4.cjs +1 -0
- package/dist/index148 2.mjs +25 -0
- package/dist/index148 4.cjs +1 -0
- package/dist/index149 2.cjs +1 -0
- package/dist/index149 3.mjs +55 -0
- package/dist/index15 2.cjs +1 -0
- package/dist/index15 3.mjs +135 -0
- package/dist/index150 2.cjs +1 -0
- package/dist/index150 3.mjs +57 -0
- package/dist/index151 3.cjs +1 -0
- package/dist/index151 3.mjs +49 -0
- package/dist/index152 2.cjs +1 -0
- package/dist/index152 2.mjs +79 -0
- package/dist/index153 2.mjs +17 -0
- package/dist/index153 3.cjs +1 -0
- package/dist/index154 2.mjs +45 -0
- package/dist/index154 3.cjs +1 -0
- package/dist/index155 2.cjs +1 -0
- package/dist/index155 3.mjs +43 -0
- package/dist/index156 2.cjs +1 -0
- package/dist/index156 3.mjs +38 -0
- package/dist/index157 2.cjs +1 -0
- package/dist/index157 3.mjs +31 -0
- package/dist/index158 2.cjs +1 -0
- package/dist/index158 2.mjs +43 -0
- package/dist/index159 2.mjs +23 -0
- package/dist/index159 3.cjs +1 -0
- package/dist/index16 3.cjs +1 -0
- package/dist/index16 3.mjs +106 -0
- package/dist/index160 2.cjs +1 -0
- package/dist/index160 3.mjs +15 -0
- package/dist/index161 2.cjs +1 -0
- package/dist/index161 3.mjs +60 -0
- package/dist/index162 2.cjs +1 -0
- package/dist/index162 3.mjs +35 -0
- package/dist/index163 2.cjs +1 -0
- package/dist/index163 2.mjs +19 -0
- package/dist/index164 2.cjs +1 -0
- package/dist/index164 2.mjs +31 -0
- package/dist/index165 2.mjs +21 -0
- package/dist/index165 3.cjs +1 -0
- package/dist/index166 2.cjs +1 -0
- package/dist/index166 2.mjs +48 -0
- package/dist/index167 3.cjs +1 -0
- package/dist/index167 3.mjs +55 -0
- package/dist/index168 3.mjs +65 -0
- package/dist/index168 4.cjs +1 -0
- package/dist/index169 2.cjs +1 -0
- package/dist/index169 2.mjs +39 -0
- package/dist/index17 2.cjs +1 -0
- package/dist/index17 2.mjs +178 -0
- package/dist/index170 2.mjs +33 -0
- package/dist/index170 3.cjs +1 -0
- package/dist/index171 3.cjs +1 -0
- package/dist/index171 3.mjs +31 -0
- package/dist/index172 2.cjs +1 -0
- package/dist/index172 4.mjs +35 -0
- package/dist/index173 2.cjs +1 -0
- package/dist/index173 2.mjs +31 -0
- package/dist/index174 2.cjs +1 -0
- package/dist/index174 2.mjs +33 -0
- package/dist/index175 2.cjs +1 -0
- package/dist/index175 2.mjs +67 -0
- package/dist/index176 2.cjs +1 -0
- package/dist/index176 2.mjs +30 -0
- package/dist/index177 2.mjs +41 -0
- package/dist/index177 4.cjs +1 -0
- package/dist/index178 2.mjs +33 -0
- package/dist/index178 3.cjs +1 -0
- package/dist/index179 2.cjs +1 -0
- package/dist/index179 2.mjs +33 -0
- package/dist/index18 2.mjs +38 -0
- package/dist/index18 3.cjs +1 -0
- package/dist/index180 2.cjs +1 -0
- package/dist/index180 3.mjs +53 -0
- package/dist/index181 2.cjs +1 -0
- package/dist/index181 2.mjs +59 -0
- package/dist/index182 2.mjs +21 -0
- package/dist/index182 3.cjs +1 -0
- package/dist/index183 2.cjs +1 -0
- package/dist/index183 3.mjs +21 -0
- package/dist/index184 2.cjs +1 -0
- package/dist/index184 2.mjs +12 -0
- package/dist/index185 2.cjs +1 -0
- package/dist/index185 2.mjs +57 -0
- package/dist/index19 2.cjs +1 -0
- package/dist/index19 2.mjs +103 -0
- package/dist/index20 2.cjs +1 -0
- package/dist/index20 2.mjs +56 -0
- package/dist/index21 2.cjs +1 -0
- package/dist/index21 3.mjs +84 -0
- package/dist/index22 2.cjs +1 -0
- package/dist/index22 2.mjs +86 -0
- package/dist/index23 2.cjs +6 -0
- package/dist/index23 4.mjs +255 -0
- package/dist/index24 2.mjs +114 -0
- package/dist/index24 3.cjs +1 -0
- package/dist/index25 2.cjs +1 -0
- package/dist/index25 4.mjs +196 -0
- package/dist/index26 3.mjs +271 -0
- package/dist/index26 4.cjs +1 -0
- package/dist/index27 2.cjs +1 -0
- package/dist/index27 2.mjs +248 -0
- package/dist/index28 2.cjs +1 -0
- package/dist/index28 2.mjs +193 -0
- package/dist/index29 2.cjs +1 -0
- package/dist/index29 2.mjs +26 -0
- package/dist/index3 2.cjs +1 -0
- package/dist/index3 2.mjs +600 -0
- package/dist/index30 2.cjs +1 -0
- package/dist/index30 2.mjs +339 -0
- package/dist/index31 2.cjs +1 -0
- package/dist/index31 4.mjs +104 -0
- package/dist/index32 2.mjs +103 -0
- package/dist/index32 3.cjs +1 -0
- package/dist/index33 2.cjs +1 -0
- package/dist/index33 4.mjs +48 -0
- package/dist/index34 2.cjs +1 -0
- package/dist/index34 3.mjs +132 -0
- package/dist/index35 2.cjs +1 -0
- package/dist/index35 2.mjs +176 -0
- package/dist/index36 2.cjs +1 -0
- package/dist/index36 2.mjs +30 -0
- package/dist/index37 2.cjs +1 -0
- package/dist/index37 2.mjs +43 -0
- package/dist/index38 2.cjs +1 -0
- package/dist/index38 2.mjs +107 -0
- package/dist/index39 2.cjs +1 -0
- package/dist/index39 4.mjs +202 -0
- package/dist/index4 2.mjs +59 -0
- package/dist/index4 3.cjs +3 -0
- package/dist/index40 2.mjs +164 -0
- package/dist/index40 3.cjs +1 -0
- package/dist/index41 3.cjs +1 -0
- package/dist/index41 3.mjs +47 -0
- package/dist/index42 2.cjs +1 -0
- package/dist/index42 2.mjs +84 -0
- package/dist/index43 2.cjs +1 -0
- package/dist/index43 3.mjs +54 -0
- package/dist/index44 2.mjs +205 -0
- package/dist/index44 3.cjs +3 -0
- package/dist/index45 3.cjs +1 -0
- package/dist/index45 3.mjs +104 -0
- package/dist/index46 2.cjs +1 -0
- package/dist/index46 4.mjs +143 -0
- package/dist/index47 2.cjs +1 -0
- package/dist/index47 2.mjs +190 -0
- package/dist/index48 2.mjs +106 -0
- package/dist/index48 3.cjs +1 -0
- package/dist/index49 2.cjs +1 -0
- package/dist/index49 2.mjs +82 -0
- package/dist/index5 2.cjs +1 -0
- package/dist/index5 2.mjs +94 -0
- package/dist/index50 2.mjs +95 -0
- package/dist/index50 3.cjs +1 -0
- package/dist/index51 2.cjs +1 -0
- package/dist/index51 2.mjs +125 -0
- package/dist/index52 2.cjs +1 -0
- package/dist/index52 3.mjs +72 -0
- package/dist/index53 2.cjs +1 -0
- package/dist/index53 3.mjs +273 -0
- package/dist/index54 2.cjs +1 -0
- package/dist/index54 3.mjs +129 -0
- package/dist/index55 2.cjs +1 -0
- package/dist/index55 2.mjs +172 -0
- package/dist/index56 2.cjs +1 -0
- package/dist/index56 3.mjs +105 -0
- package/dist/index57 2.cjs +1 -0
- package/dist/index57 3.mjs +136 -0
- package/dist/index58 2.cjs +1 -0
- package/dist/index58 2.mjs +191 -0
- package/dist/index59 2.cjs +1 -0
- package/dist/index59 3.mjs +54 -0
- package/dist/index6 2.cjs +1 -0
- package/dist/index6 2.mjs +128 -0
- package/dist/index60 2.mjs +148 -0
- package/dist/index60 3.cjs +1 -0
- package/dist/index61 2.cjs +1 -0
- package/dist/index61 2.mjs +76 -0
- package/dist/index62 2.cjs +1 -0
- package/dist/index62 2.mjs +87 -0
- package/dist/index63 2.cjs +1 -0
- package/dist/index63 2.mjs +36 -0
- package/dist/index64 2.cjs +1 -0
- package/dist/index64 3.mjs +78 -0
- package/dist/index65 3.mjs +153 -0
- package/dist/index65 4.cjs +1 -0
- package/dist/index66 2.cjs +1 -0
- package/dist/index66 2.mjs +54 -0
- package/dist/index67 2.cjs +1 -0
- package/dist/index67 2.mjs +109 -0
- package/dist/index68 2.cjs +1 -0
- package/dist/index68 3.mjs +28 -0
- package/dist/index69 2.cjs +1 -0
- package/dist/index69 2.mjs +133 -0
- package/dist/index7 2.mjs +120 -0
- package/dist/index7 3.cjs +1 -0
- package/dist/index70 2.cjs +1 -0
- package/dist/index70 2.mjs +80 -0
- package/dist/index71 2.cjs +1 -0
- package/dist/index71 2.mjs +101 -0
- package/dist/index72 2.mjs +97 -0
- package/dist/index72 3.cjs +1 -0
- package/dist/index73 2.cjs +1 -0
- package/dist/index73 2.mjs +118 -0
- package/dist/index74 2.cjs +1 -0
- package/dist/index74 2.mjs +389 -0
- package/dist/index75 2.cjs +38 -0
- package/dist/index75 2.mjs +98 -0
- package/dist/index76 2.mjs +225 -0
- package/dist/index76 3.cjs +1 -0
- package/dist/index77 2.cjs +1 -0
- package/dist/index77 3.mjs +48 -0
- package/dist/index78 2.cjs +1 -0
- package/dist/index78 2.mjs +101 -0
- package/dist/index79 2.cjs +1 -0
- package/dist/index79 3.mjs +39 -0
- package/dist/index8 2.cjs +1 -0
- package/dist/index8 3.mjs +51 -0
- package/dist/index80 2.cjs +1 -0
- package/dist/index80 2.mjs +161 -0
- package/dist/index81 3.cjs +1 -0
- package/dist/index81 3.mjs +119 -0
- package/dist/index82 2.cjs +1 -0
- package/dist/index82 3.mjs +33 -0
- package/dist/index83 2.cjs +1 -0
- package/dist/index83 3.mjs +249 -0
- package/dist/index84 2.mjs +50 -0
- package/dist/index84 4.cjs +1 -0
- package/dist/index85 2.cjs +1 -0
- package/dist/index85 2.mjs +44 -0
- package/dist/index86 2.mjs +33 -0
- package/dist/index86 3.cjs +1 -0
- package/dist/index87 2.cjs +1 -0
- package/dist/index87 3.mjs +41 -0
- package/dist/index88 2.mjs +39 -0
- package/dist/index88 3.cjs +1 -0
- package/dist/index89 3.cjs +1 -0
- package/dist/index89 3.mjs +26 -0
- package/dist/index9 2.cjs +1 -0
- package/dist/index9 2.mjs +91 -0
- package/dist/index90 2.cjs +1 -0
- package/dist/index90 2.mjs +35 -0
- package/dist/index91 2.cjs +1 -0
- package/dist/index91 2.mjs +99 -0
- package/dist/index92 2.mjs +103 -0
- package/dist/index92 3.cjs +1 -0
- package/dist/index93 2.cjs +1 -0
- package/dist/index93 2.mjs +21 -0
- package/dist/index94 2.cjs +1 -0
- package/dist/index94 2.mjs +55 -0
- package/dist/index95 2.cjs +1 -0
- package/dist/index95 2.mjs +74 -0
- package/dist/index96 2.cjs +97 -0
- package/dist/index96 2.mjs +206 -0
- package/dist/index97 2.mjs +157 -0
- package/dist/index97 3.cjs +1 -0
- package/dist/index98 2.cjs +1 -0
- package/dist/index98 3.mjs +221 -0
- package/dist/index99 2.cjs +1 -0
- package/dist/index99 2.mjs +21 -0
- package/dist/main.d 2.ts +2 -0
- package/dist/main.d.ts 3.map +1 -0
- package/dist/rich.d 2.ts +16 -0
- package/dist/rich.d.ts 2.map +1 -0
- package/dist/sections/index.d 2.ts +29 -0
- package/dist/sections/index.d.ts 2.map +1 -0
- package/dist/styles/marker 3.css +1 -0
- package/dist/styles 2.css +9055 -0
- package/dist/templates/index.d 2.ts +1 -0
- package/dist/test/a11y.d 3.ts +8 -0
- package/dist/test/a11y.d.ts 3.map +1 -0
- package/dist/test/performance.bench.d 3.ts +11 -0
- package/dist/test/performance.bench.d.ts 3.map +1 -0
- package/dist/test/setup.d 3.ts +2 -0
- package/dist/test/setup.d.ts 3.map +1 -0
- package/dist/theme 2.css +8871 -0
- package/dist/tokens/brands.d 3.ts +5 -0
- package/dist/tokens/brands.d.ts 3.map +1 -0
- package/dist/tokens/index.d 3.ts +11 -0
- package/dist/tokens/index.d.ts 3.map +1 -0
- package/dist/tokens/primitives.d 3.ts +5 -0
- package/dist/tokens/primitives.d.ts 3.map +1 -0
- package/dist/tokens/themes.d 3.ts +9 -0
- package/dist/tokens/themes.d.ts 3.map +1 -0
- package/dist/tokens/types.d 3.ts +365 -0
- package/dist/tokens/types.d.ts 3.map +1 -0
- package/dist/tokens/utils.d 3.ts +42 -0
- package/dist/tokens/utils.d.ts 3.map +1 -0
- package/dist/utils/fonts.d 3.ts +46 -0
- package/dist/utils/fonts.d.ts 3.map +1 -0
- package/dist/utils/icons.d 3.ts +61 -0
- package/dist/utils/icons.d.ts 3.map +1 -0
- package/dist/utils/index.d 3.ts +9 -0
- package/dist/utils/index.d.ts 3.map +1 -0
- package/dist/utils/validation.d 3.ts +94 -0
- package/dist/utils/validation.d.ts 3.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { X as t, Square as b, Send as C, Mic as j } from "lucide-react";
|
|
3
|
+
import { useVoiceRecorder as S } from "./index95.mjs";
|
|
4
|
+
import { formatTime as k } from "./index184.mjs";
|
|
5
|
+
import e from "./index115.mjs";
|
|
6
|
+
const z = ({
|
|
7
|
+
onRecordingComplete: d,
|
|
8
|
+
onCancel: v,
|
|
9
|
+
maxDuration: m = 300,
|
|
10
|
+
className: a,
|
|
11
|
+
...n
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
isRecording: o,
|
|
15
|
+
duration: R,
|
|
16
|
+
audioBlob: i,
|
|
17
|
+
error: s,
|
|
18
|
+
startRecording: h,
|
|
19
|
+
stopRecording: u,
|
|
20
|
+
cancelRecording: N,
|
|
21
|
+
reset: l,
|
|
22
|
+
isSupported: f
|
|
23
|
+
} = S({
|
|
24
|
+
maxDuration: m,
|
|
25
|
+
onRecordingComplete: d,
|
|
26
|
+
onError: (g) => console.error("Recording error:", g)
|
|
27
|
+
}), p = () => {
|
|
28
|
+
o ? u() : i ? (d?.(i), l()) : h();
|
|
29
|
+
}, B = () => {
|
|
30
|
+
N(), v?.();
|
|
31
|
+
};
|
|
32
|
+
return f ? s ? /* @__PURE__ */ c(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: [e.voiceRecorder, a].filter(Boolean).join(" "),
|
|
36
|
+
...n,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ r("div", { className: e.voiceRecorderInfo, children: /* @__PURE__ */ r(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: [
|
|
42
|
+
e.voiceRecorderLabel,
|
|
43
|
+
e.voiceRecorderError
|
|
44
|
+
].join(" "),
|
|
45
|
+
children: s
|
|
46
|
+
}
|
|
47
|
+
) }),
|
|
48
|
+
/* @__PURE__ */ r(
|
|
49
|
+
"button",
|
|
50
|
+
{
|
|
51
|
+
className: e.inputButton,
|
|
52
|
+
onClick: l,
|
|
53
|
+
"aria-label": "Try again",
|
|
54
|
+
children: /* @__PURE__ */ r(t, { size: 20 })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
) : /* @__PURE__ */ c(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
className: [e.voiceRecorder, a].filter(Boolean).join(" "),
|
|
63
|
+
...n,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ r(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
className: [
|
|
69
|
+
e.voiceRecorderButton,
|
|
70
|
+
!o && !i && e.voiceRecorderButtonIdle
|
|
71
|
+
].filter(Boolean).join(" "),
|
|
72
|
+
onClick: p,
|
|
73
|
+
"aria-label": o ? "Stop recording" : i ? "Send recording" : "Start recording",
|
|
74
|
+
children: o ? /* @__PURE__ */ r(b, { size: 20 }) : i ? /* @__PURE__ */ r(C, { size: 20 }) : /* @__PURE__ */ r(j, { size: 20 })
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ c("div", { className: e.voiceRecorderInfo, children: [
|
|
78
|
+
/* @__PURE__ */ r("span", { className: e.voiceRecorderDuration, children: k(R) }),
|
|
79
|
+
/* @__PURE__ */ r("span", { className: e.voiceRecorderLabel, children: o ? "Recording..." : i ? "Recording ready" : "Click to record" })
|
|
80
|
+
] }),
|
|
81
|
+
o && /* @__PURE__ */ c("div", { className: e.voiceRecorderWaveform, children: [
|
|
82
|
+
/* @__PURE__ */ r("div", { className: e.voiceRecorderBar }),
|
|
83
|
+
/* @__PURE__ */ r("div", { className: e.voiceRecorderBar }),
|
|
84
|
+
/* @__PURE__ */ r("div", { className: e.voiceRecorderBar }),
|
|
85
|
+
/* @__PURE__ */ r("div", { className: e.voiceRecorderBar }),
|
|
86
|
+
/* @__PURE__ */ r("div", { className: e.voiceRecorderBar })
|
|
87
|
+
] }),
|
|
88
|
+
(o || i) && /* @__PURE__ */ r("div", { className: e.voiceRecorderActions, children: /* @__PURE__ */ r(
|
|
89
|
+
"button",
|
|
90
|
+
{
|
|
91
|
+
className: e.inputButton,
|
|
92
|
+
onClick: B,
|
|
93
|
+
"aria-label": "Cancel recording",
|
|
94
|
+
children: /* @__PURE__ */ r(t, { size: 20 })
|
|
95
|
+
}
|
|
96
|
+
) })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
) : /* @__PURE__ */ r(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
className: [e.voiceRecorder, a].filter(Boolean).join(" "),
|
|
103
|
+
...n,
|
|
104
|
+
children: /* @__PURE__ */ r("div", { className: e.voiceRecorderInfo, children: /* @__PURE__ */ r("span", { className: e.voiceRecorderLabel, children: "Voice recording is not supported in this browser" }) })
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
z.displayName = "ChatVoiceRecorder";
|
|
109
|
+
export {
|
|
110
|
+
z as ChatVoiceRecorder
|
|
111
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("lucide-react"),g=require("./index95.cjs"),b=require("./index184.cjs"),r=require("./index115.cjs"),t=({onRecordingComplete:s,onCancel:u,maxDuration:f=300,className:a,...d})=>{const{isRecording:o,duration:v,audioBlob:c,error:l,startRecording:R,stopRecording:j,cancelRecording:x,reset:n,isSupported:m}=g.useVoiceRecorder({maxDuration:f,onRecordingComplete:s,onError:B=>console.error("Recording error:",B)}),h=()=>{o?j():c?(s?.(c),n()):R()},N=()=>{x(),u?.()};return m?l?e.jsxs("div",{className:[r.default.voiceRecorder,a].filter(Boolean).join(" "),...d,children:[e.jsx("div",{className:r.default.voiceRecorderInfo,children:e.jsx("span",{className:[r.default.voiceRecorderLabel,r.default.voiceRecorderError].join(" "),children:l})}),e.jsx("button",{className:r.default.inputButton,onClick:n,"aria-label":"Try again",children:e.jsx(i.X,{size:20})})]}):e.jsxs("div",{className:[r.default.voiceRecorder,a].filter(Boolean).join(" "),...d,children:[e.jsx("button",{className:[r.default.voiceRecorderButton,!o&&!c&&r.default.voiceRecorderButtonIdle].filter(Boolean).join(" "),onClick:h,"aria-label":o?"Stop recording":c?"Send recording":"Start recording",children:o?e.jsx(i.Square,{size:20}):c?e.jsx(i.Send,{size:20}):e.jsx(i.Mic,{size:20})}),e.jsxs("div",{className:r.default.voiceRecorderInfo,children:[e.jsx("span",{className:r.default.voiceRecorderDuration,children:b.formatTime(v)}),e.jsx("span",{className:r.default.voiceRecorderLabel,children:o?"Recording...":c?"Recording ready":"Click to record"})]}),o&&e.jsxs("div",{className:r.default.voiceRecorderWaveform,children:[e.jsx("div",{className:r.default.voiceRecorderBar}),e.jsx("div",{className:r.default.voiceRecorderBar}),e.jsx("div",{className:r.default.voiceRecorderBar}),e.jsx("div",{className:r.default.voiceRecorderBar}),e.jsx("div",{className:r.default.voiceRecorderBar})]}),(o||c)&&e.jsx("div",{className:r.default.voiceRecorderActions,children:e.jsx("button",{className:r.default.inputButton,onClick:N,"aria-label":"Cancel recording",children:e.jsx(i.X,{size:20})})})]}):e.jsx("div",{className:[r.default.voiceRecorder,a].filter(Boolean).join(" "),...d,children:e.jsx("div",{className:r.default.voiceRecorderInfo,children:e.jsx("span",{className:r.default.voiceRecorderLabel,children:"Voice recording is not supported in this browser"})})})};t.displayName="ChatVoiceRecorder";exports.ChatVoiceRecorder=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),R=require("lucide-react"),h=require("./index184.cjs"),o=require("./index115.cjs"),g=({onFilesSelected:f,accept:i=["*/*"],multiple:C=!0,maxSize:s=10*1024*1024,children:v,className:D,...k})=>{const[m,u]=t.useState(!1),c=t.useRef(null),d=t.useCallback(e=>{if(!e||e.length===0)return;const r=[];Array.from(e).forEach(l=>{if(s&&l.size>s){console.warn(`File ${l.name} exceeds max size of ${h.formatFileSize(s)}`);return}const F=i.includes("*/*"),q=i.flatMap(n=>(n.endsWith("/*"),n));if(!(F||q.some(n=>{if(n.endsWith("/*")){const N=n.split("/")[0];return l.type.startsWith(`${N}/`)}return l.type===n||l.name.endsWith(n)}))){console.warn(`File ${l.name} type not accepted`);return}r.push(l)}),r.length>0&&f?.(r)},[i,s,f]),b=t.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u(!0)},[]),j=t.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u(!1)},[]),y=t.useCallback(e=>{e.preventDefault(),e.stopPropagation(),u(!1);const{files:r}=e.dataTransfer;d(r)},[d]),x=t.useCallback(e=>{d(e.target.files),c.current&&(c.current.value="")},[d]),p=t.useCallback(()=>{c.current?.click()},[]),U=t.useCallback(e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),p())},[p]);return a.jsxs("div",{className:[o.default.fileUpload,m&&o.default.fileUploadDragging,D].filter(Boolean).join(" "),onDragOver:b,onDragLeave:j,onDrop:y,onClick:p,onKeyDown:U,role:"button",tabIndex:0,"aria-label":"Upload files",...k,children:[a.jsx("input",{ref:c,type:"file",accept:i.join(","),multiple:C,onChange:x,style:{display:"none"},"aria-hidden":"true"}),v||a.jsxs(a.Fragment,{children:[a.jsx("div",{className:o.default.fileUploadIcon,children:a.jsx(R.Upload,{size:32})}),a.jsxs("div",{className:o.default.fileUploadText,children:[a.jsx("strong",{children:"Click to upload"})," or drag and drop"]}),a.jsxs("div",{className:o.default.fileUploadHint,children:["Max file size: ",h.formatFileSize(s)]})]})]})};g.displayName="ChatFileUpload";exports.ChatFileUpload=g;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsxs as d, jsx as p, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useRef as W, useCallback as a } from "react";
|
|
3
|
+
import { Upload as $ } from "lucide-react";
|
|
4
|
+
import { formatFileSize as g } from "./index184.mjs";
|
|
5
|
+
import l from "./index115.mjs";
|
|
6
|
+
const P = ({
|
|
7
|
+
onFilesSelected: h,
|
|
8
|
+
accept: s = ["*/*"],
|
|
9
|
+
multiple: m = !0,
|
|
10
|
+
maxSize: r = 10 * 1024 * 1024,
|
|
11
|
+
// 10MB default
|
|
12
|
+
children: D,
|
|
13
|
+
className: v,
|
|
14
|
+
...y
|
|
15
|
+
}) => {
|
|
16
|
+
const [U, f] = I(!1), i = W(null), c = a(
|
|
17
|
+
(e) => {
|
|
18
|
+
if (!e || e.length === 0) return;
|
|
19
|
+
const o = [];
|
|
20
|
+
Array.from(e).forEach((t) => {
|
|
21
|
+
if (r && t.size > r) {
|
|
22
|
+
console.warn(
|
|
23
|
+
`File ${t.name} exceeds max size of ${g(r)}`
|
|
24
|
+
);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const j = s.includes("*/*"), w = s.flatMap((n) => (n.endsWith("/*"), n));
|
|
28
|
+
if (!(j || w.some((n) => {
|
|
29
|
+
if (n.endsWith("/*")) {
|
|
30
|
+
const x = n.split("/")[0];
|
|
31
|
+
return t.type.startsWith(`${x}/`);
|
|
32
|
+
}
|
|
33
|
+
return t.type === n || t.name.endsWith(n);
|
|
34
|
+
}))) {
|
|
35
|
+
console.warn(`File ${t.name} type not accepted`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
o.push(t);
|
|
39
|
+
}), o.length > 0 && h?.(o);
|
|
40
|
+
},
|
|
41
|
+
[s, r, h]
|
|
42
|
+
), C = a((e) => {
|
|
43
|
+
e.preventDefault(), e.stopPropagation(), f(!0);
|
|
44
|
+
}, []), k = a((e) => {
|
|
45
|
+
e.preventDefault(), e.stopPropagation(), f(!1);
|
|
46
|
+
}, []), F = a(
|
|
47
|
+
(e) => {
|
|
48
|
+
e.preventDefault(), e.stopPropagation(), f(!1);
|
|
49
|
+
const { files: o } = e.dataTransfer;
|
|
50
|
+
c(o);
|
|
51
|
+
},
|
|
52
|
+
[c]
|
|
53
|
+
), N = a(
|
|
54
|
+
(e) => {
|
|
55
|
+
c(e.target.files), i.current && (i.current.value = "");
|
|
56
|
+
},
|
|
57
|
+
[c]
|
|
58
|
+
), u = a(() => {
|
|
59
|
+
i.current?.click();
|
|
60
|
+
}, []), b = a(
|
|
61
|
+
(e) => {
|
|
62
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), u());
|
|
63
|
+
},
|
|
64
|
+
[u]
|
|
65
|
+
);
|
|
66
|
+
return /* @__PURE__ */ d(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: [
|
|
70
|
+
l.fileUpload,
|
|
71
|
+
U && l.fileUploadDragging,
|
|
72
|
+
v
|
|
73
|
+
].filter(Boolean).join(" "),
|
|
74
|
+
onDragOver: C,
|
|
75
|
+
onDragLeave: k,
|
|
76
|
+
onDrop: F,
|
|
77
|
+
onClick: u,
|
|
78
|
+
onKeyDown: b,
|
|
79
|
+
role: "button",
|
|
80
|
+
tabIndex: 0,
|
|
81
|
+
"aria-label": "Upload files",
|
|
82
|
+
...y,
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ p(
|
|
85
|
+
"input",
|
|
86
|
+
{
|
|
87
|
+
ref: i,
|
|
88
|
+
type: "file",
|
|
89
|
+
accept: s.join(","),
|
|
90
|
+
multiple: m,
|
|
91
|
+
onChange: N,
|
|
92
|
+
style: { display: "none" },
|
|
93
|
+
"aria-hidden": "true"
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
D || /* @__PURE__ */ d(A, { children: [
|
|
97
|
+
/* @__PURE__ */ p("div", { className: l.fileUploadIcon, children: /* @__PURE__ */ p($, { size: 32 }) }),
|
|
98
|
+
/* @__PURE__ */ d("div", { className: l.fileUploadText, children: [
|
|
99
|
+
/* @__PURE__ */ p("strong", { children: "Click to upload" }),
|
|
100
|
+
" or drag and drop"
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ d("div", { className: l.fileUploadHint, children: [
|
|
103
|
+
"Max file size: ",
|
|
104
|
+
g(r)
|
|
105
|
+
] })
|
|
106
|
+
] })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
P.displayName = "ChatFileUpload";
|
|
112
|
+
export {
|
|
113
|
+
P as ChatFileUpload
|
|
114
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { X as u, FileText as P, Code as w, Music as z, Image as y } from "lucide-react";
|
|
3
|
+
import { ChatImagePreview as C } from "./index123.mjs";
|
|
4
|
+
import { ChatAudioPlayer as N } from "./index124.mjs";
|
|
5
|
+
import { ChatCodeBlock as I } from "./index121.mjs";
|
|
6
|
+
import { formatFileSize as k } from "./index184.mjs";
|
|
7
|
+
import t from "./index115.mjs";
|
|
8
|
+
const x = (d) => {
|
|
9
|
+
switch (d) {
|
|
10
|
+
case "image":
|
|
11
|
+
return /* @__PURE__ */ e(y, { size: 18 });
|
|
12
|
+
case "audio":
|
|
13
|
+
return /* @__PURE__ */ e(z, { size: 18 });
|
|
14
|
+
case "code":
|
|
15
|
+
return /* @__PURE__ */ e(w, { size: 18 });
|
|
16
|
+
default:
|
|
17
|
+
return /* @__PURE__ */ e(P, { size: 18 });
|
|
18
|
+
}
|
|
19
|
+
}, $ = ({
|
|
20
|
+
attachment: d,
|
|
21
|
+
removable: h = !1,
|
|
22
|
+
onRemove: a,
|
|
23
|
+
onClick: n,
|
|
24
|
+
className: s,
|
|
25
|
+
...c
|
|
26
|
+
}) => {
|
|
27
|
+
const { type: p, name: i, url: l, content: v, language: b, size: f, duration: m, thumbnail: g } = d;
|
|
28
|
+
switch (p) {
|
|
29
|
+
case "image":
|
|
30
|
+
if (l)
|
|
31
|
+
return /* @__PURE__ */ o("div", { className: s, style: { position: "relative" }, ...c, children: [
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
C,
|
|
34
|
+
{
|
|
35
|
+
src: l,
|
|
36
|
+
alt: i,
|
|
37
|
+
thumbnail: g,
|
|
38
|
+
onClick: n
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
h && a && /* @__PURE__ */ e(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
className: t.attachmentPreviewRemove,
|
|
45
|
+
onClick: (r) => {
|
|
46
|
+
r.stopPropagation(), a();
|
|
47
|
+
},
|
|
48
|
+
"aria-label": `Remove ${i}`,
|
|
49
|
+
style: {
|
|
50
|
+
position: "absolute",
|
|
51
|
+
top: 4,
|
|
52
|
+
right: 4,
|
|
53
|
+
background: "var(--surface-base)"
|
|
54
|
+
},
|
|
55
|
+
children: /* @__PURE__ */ e(u, { size: 14 })
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] });
|
|
59
|
+
break;
|
|
60
|
+
case "audio":
|
|
61
|
+
if (l)
|
|
62
|
+
return /* @__PURE__ */ o("div", { className: s, style: { position: "relative" }, ...c, children: [
|
|
63
|
+
/* @__PURE__ */ e(N, { src: l, duration: m, title: i }),
|
|
64
|
+
h && a && /* @__PURE__ */ e(
|
|
65
|
+
"button",
|
|
66
|
+
{
|
|
67
|
+
className: t.attachmentPreviewRemove,
|
|
68
|
+
onClick: (r) => {
|
|
69
|
+
r.stopPropagation(), a();
|
|
70
|
+
},
|
|
71
|
+
"aria-label": `Remove ${i}`,
|
|
72
|
+
children: /* @__PURE__ */ e(u, { size: 14 })
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] });
|
|
76
|
+
break;
|
|
77
|
+
case "code":
|
|
78
|
+
if (v)
|
|
79
|
+
return /* @__PURE__ */ e(
|
|
80
|
+
I,
|
|
81
|
+
{
|
|
82
|
+
code: v,
|
|
83
|
+
language: b,
|
|
84
|
+
className: s,
|
|
85
|
+
...c
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
return /* @__PURE__ */ o(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: [t.attachmentPreview, s].filter(Boolean).join(" "),
|
|
94
|
+
onClick: n,
|
|
95
|
+
role: n ? "button" : void 0,
|
|
96
|
+
tabIndex: n ? 0 : void 0,
|
|
97
|
+
...c,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ e("div", { className: t.attachmentPreviewIcon, children: x(p) }),
|
|
100
|
+
/* @__PURE__ */ o("div", { className: t.attachmentPreviewInfo, children: [
|
|
101
|
+
/* @__PURE__ */ e("span", { className: t.attachmentPreviewName, children: i }),
|
|
102
|
+
f && /* @__PURE__ */ o("span", { className: t.attachmentPreviewMeta, children: [
|
|
103
|
+
k(f),
|
|
104
|
+
m && ` · ${Math.floor(m / 60)}:${(m % 60).toString().padStart(2, "0")}`
|
|
105
|
+
] })
|
|
106
|
+
] }),
|
|
107
|
+
h && a && /* @__PURE__ */ e(
|
|
108
|
+
"button",
|
|
109
|
+
{
|
|
110
|
+
className: t.attachmentPreviewRemove,
|
|
111
|
+
onClick: (r) => {
|
|
112
|
+
r.stopPropagation(), a();
|
|
113
|
+
},
|
|
114
|
+
"aria-label": `Remove ${i}`,
|
|
115
|
+
children: /* @__PURE__ */ e(u, { size: 14 })
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
122
|
+
$.displayName = "ChatAttachment";
|
|
123
|
+
export {
|
|
124
|
+
$ as ChatAttachment
|
|
125
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("lucide-react"),p=require("./index123.cjs"),P=require("./index124.cjs"),b=require("./index121.cjs"),C=require("./index184.cjs"),t=require("./index115.cjs"),w=d=>{switch(d){case"image":return e.jsx(a.Image,{size:18});case"audio":return e.jsx(a.Music,{size:18});case"code":return e.jsx(a.Code,{size:18});default:return e.jsx(a.FileText,{size:18})}},v=({attachment:d,removable:h=!1,onRemove:i,onClick:n,className:c,...o})=>{const{type:m,name:s,url:l,content:j,language:f,size:x,duration:u,thumbnail:g}=d;switch(m){case"image":if(l)return e.jsxs("div",{className:c,style:{position:"relative"},...o,children:[e.jsx(p.ChatImagePreview,{src:l,alt:s,thumbnail:g,onClick:n}),h&&i&&e.jsx("button",{className:t.default.attachmentPreviewRemove,onClick:r=>{r.stopPropagation(),i()},"aria-label":`Remove ${s}`,style:{position:"absolute",top:4,right:4,background:"var(--surface-base)"},children:e.jsx(a.X,{size:14})})]});break;case"audio":if(l)return e.jsxs("div",{className:c,style:{position:"relative"},...o,children:[e.jsx(P.ChatAudioPlayer,{src:l,duration:u,title:s}),h&&i&&e.jsx("button",{className:t.default.attachmentPreviewRemove,onClick:r=>{r.stopPropagation(),i()},"aria-label":`Remove ${s}`,children:e.jsx(a.X,{size:14})})]});break;case"code":if(j)return e.jsx(b.ChatCodeBlock,{code:j,language:f,className:c,...o});break}return e.jsxs("div",{className:[t.default.attachmentPreview,c].filter(Boolean).join(" "),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,...o,children:[e.jsx("div",{className:t.default.attachmentPreviewIcon,children:w(m)}),e.jsxs("div",{className:t.default.attachmentPreviewInfo,children:[e.jsx("span",{className:t.default.attachmentPreviewName,children:s}),x&&e.jsxs("span",{className:t.default.attachmentPreviewMeta,children:[C.formatFileSize(x),u&&` · ${Math.floor(u/60)}:${(u%60).toString().padStart(2,"0")}`]})]}),h&&i&&e.jsx("button",{className:t.default.attachmentPreviewRemove,onClick:r=>{r.stopPropagation(),i()},"aria-label":`Remove ${s}`,children:e.jsx(a.X,{size:14})})]})};v.displayName="ChatAttachment";exports.ChatAttachment=v;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),c=require("lucide-react"),t=require("./index115.cjs"),O={today:"Today",yesterday:"Yesterday",previous7:"Previous 7 days",previous30:"Previous 30 days",older:"Older"},y=["today","yesterday","previous7","previous30","older"],C=a=>{const r=new Date,u=(new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()-new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime())/(1e3*60*60*24);return u<1?"today":u<2?"yesterday":u<7?"previous7":u<30?"previous30":"older"},P=a=>{const r=C(a);return r==="today"?new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit"}).format(a):r==="yesterday"?"Yesterday":r==="previous7"?new Intl.DateTimeFormat("en-US",{weekday:"short"}).format(a):new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(a)},z=a=>{const r=new Map;return y.forEach(n=>r.set(n,[])),a.forEach(n=>{const b=C(n.updatedAt);r.get(b)?.push(n)}),r},S=({conversations:a=[],activeConversationId:r,onSelectConversation:n,onNewConversation:b,onDeleteConversation:u,onSearch:x,header:w,footer:N,collapsed:m=!1,onCollapsedChange:f,className:I,...D})=>{const[h,T]=d.useState(""),[p,j]=d.useState(null),o=d.useRef(void 0);d.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const g=d.useMemo(()=>{if(!h.trim())return a;const s=h.toLowerCase();return a.filter(l=>l.title.toLowerCase().includes(s)||l.preview?.toLowerCase().includes(s))},[a,h]),v=d.useMemo(()=>z(g),[g]),B=d.useCallback(s=>{const l=s.target.value;T(l),x?.(l)},[x]),k=d.useCallback(s=>{n?.(s),m&&f&&f(!0)},[n,m,f]),F=d.useCallback((s,l)=>{s.stopPropagation(),p===l?(u?.(l),j(null),o.current&&clearTimeout(o.current)):(j(l),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{j(null)},3e3))},[p,u]),M=y.some(s=>(v.get(s)?.length??0)>0);return e.jsxs(e.Fragment,{children:[!m&&e.jsx("div",{className:t.default.sidebarOverlay,onClick:()=>f?.(!0),"aria-hidden":"true"}),e.jsxs("aside",{className:[t.default.sidebar,m&&t.default.sidebarCollapsed,!m&&t.default.sidebarOpen,I].filter(Boolean).join(" "),...D,children:[e.jsx("div",{className:t.default.sidebarHeader,children:w||e.jsxs(e.Fragment,{children:[e.jsx("button",{className:[t.default.inputButton,t.default.inputButtonPrimary,t.default.sidebarNewButton].filter(Boolean).join(" "),onClick:b,"aria-label":"New conversation",children:e.jsxs("span",{className:t.default.sidebarNewButtonInner,children:[e.jsx(c.Plus,{size:18}),e.jsx("span",{children:"New Chat"})]})}),e.jsx("button",{className:[t.default.inputButton,t.default.sidebarCloseButton].join(" "),onClick:()=>f?.(!0),"aria-label":"Close sidebar",children:e.jsx(c.X,{size:20})})]})}),e.jsx("div",{className:t.default.sidebarSearch,children:e.jsxs("div",{className:t.default.sidebarSearchWrapper,children:[e.jsx(c.Search,{size:16,className:t.default.sidebarSearchIcon}),e.jsx("input",{type:"search",className:[t.default.sidebarSearchInput,t.default.sidebarSearchInputWithIcon].join(" "),placeholder:"Search conversations...",value:h,onChange:B,"aria-label":"Search conversations"})]})}),e.jsx("div",{className:t.default.sidebarList,role:"list","aria-label":"Conversations",children:M?y.map(s=>{const l=v.get(s)??[];return l.length===0?null:e.jsxs("div",{children:[e.jsx("div",{className:t.default.sidebarGroupHeader,children:O[s]}),l.map(i=>e.jsxs("button",{className:[t.default.sidebarItem,i.id===r&&t.default.sidebarItemActive].filter(Boolean).join(" "),onClick:()=>k(i.id),role:"listitem","aria-selected":i.id===r,"aria-label":`Conversation: ${i.title}`,children:[e.jsx(c.MessageSquare,{size:18,className:t.default.sidebarItemIcon}),e.jsxs("div",{className:t.default.sidebarItemContent,children:[e.jsx("span",{className:t.default.sidebarItemTitle,children:i.title}),i.preview&&e.jsx("span",{className:t.default.sidebarItemPreview,children:i.preview})]}),e.jsx("span",{className:t.default.sidebarItemDate,children:P(i.updatedAt)}),u&&e.jsx("button",{className:t.default.sidebarItemDelete,onClick:q=>F(q,i.id),"aria-label":p===i.id?`Confirm delete ${i.title}`:`Delete ${i.title}`,children:p===i.id?e.jsx("span",{className:t.default.sidebarItemDeleteConfirm,children:"Delete?"}):e.jsx(c.Trash2,{size:16})})]},i.id))]},s)}):e.jsxs("div",{className:t.default.sidebarEmpty,children:[e.jsx(c.MessageSquare,{size:32,className:t.default.sidebarEmptyIcon}),e.jsx("p",{children:h?"No conversations found":"No conversations yet"})]})}),N&&e.jsx("div",{className:t.default.sidebarFooter,children:N})]})]})};S.displayName="ChatSidebar";exports.ChatSidebar=S;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as C, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as D, useRef as Y, useEffect as x, useMemo as S, useCallback as y } from "react";
|
|
3
|
+
import { Plus as A, X as U, Search as $, MessageSquare as T, Trash2 as q } from "lucide-react";
|
|
4
|
+
import e from "./index115.mjs";
|
|
5
|
+
const G = {
|
|
6
|
+
today: "Today",
|
|
7
|
+
yesterday: "Yesterday",
|
|
8
|
+
previous7: "Previous 7 days",
|
|
9
|
+
previous30: "Previous 30 days",
|
|
10
|
+
older: "Older"
|
|
11
|
+
}, N = [
|
|
12
|
+
"today",
|
|
13
|
+
"yesterday",
|
|
14
|
+
"previous7",
|
|
15
|
+
"previous30",
|
|
16
|
+
"older"
|
|
17
|
+
], B = (t) => {
|
|
18
|
+
const a = /* @__PURE__ */ new Date(), d = (new Date(
|
|
19
|
+
a.getFullYear(),
|
|
20
|
+
a.getMonth(),
|
|
21
|
+
a.getDate()
|
|
22
|
+
).getTime() - new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime()) / (1e3 * 60 * 60 * 24);
|
|
23
|
+
return d < 1 ? "today" : d < 2 ? "yesterday" : d < 7 ? "previous7" : d < 30 ? "previous30" : "older";
|
|
24
|
+
}, H = (t) => {
|
|
25
|
+
const a = B(t);
|
|
26
|
+
return a === "today" ? new Intl.DateTimeFormat("en-US", {
|
|
27
|
+
hour: "numeric",
|
|
28
|
+
minute: "2-digit"
|
|
29
|
+
}).format(t) : a === "yesterday" ? "Yesterday" : a === "previous7" ? new Intl.DateTimeFormat("en-US", {
|
|
30
|
+
weekday: "short"
|
|
31
|
+
}).format(t) : new Intl.DateTimeFormat("en-US", {
|
|
32
|
+
month: "short",
|
|
33
|
+
day: "numeric"
|
|
34
|
+
}).format(t);
|
|
35
|
+
}, Q = (t) => {
|
|
36
|
+
const a = /* @__PURE__ */ new Map();
|
|
37
|
+
return N.forEach((o) => a.set(o, [])), t.forEach((o) => {
|
|
38
|
+
const f = B(o.updatedAt);
|
|
39
|
+
a.get(f)?.push(o);
|
|
40
|
+
}), a;
|
|
41
|
+
}, R = ({
|
|
42
|
+
conversations: t = [],
|
|
43
|
+
activeConversationId: a,
|
|
44
|
+
onSelectConversation: o,
|
|
45
|
+
onNewConversation: f,
|
|
46
|
+
onDeleteConversation: d,
|
|
47
|
+
onSearch: g,
|
|
48
|
+
header: j,
|
|
49
|
+
footer: v,
|
|
50
|
+
collapsed: u = !1,
|
|
51
|
+
onCollapsedChange: m,
|
|
52
|
+
className: k,
|
|
53
|
+
...F
|
|
54
|
+
}) => {
|
|
55
|
+
const [h, z] = D(""), [p, b] = D(null), c = Y(
|
|
56
|
+
void 0
|
|
57
|
+
);
|
|
58
|
+
x(() => () => {
|
|
59
|
+
c.current && clearTimeout(c.current);
|
|
60
|
+
}, []);
|
|
61
|
+
const w = S(() => {
|
|
62
|
+
if (!h.trim()) return t;
|
|
63
|
+
const s = h.toLowerCase();
|
|
64
|
+
return t.filter(
|
|
65
|
+
(n) => n.title.toLowerCase().includes(s) || n.preview?.toLowerCase().includes(s)
|
|
66
|
+
);
|
|
67
|
+
}, [t, h]), I = S(() => Q(w), [w]), O = y(
|
|
68
|
+
(s) => {
|
|
69
|
+
const n = s.target.value;
|
|
70
|
+
z(n), g?.(n);
|
|
71
|
+
},
|
|
72
|
+
[g]
|
|
73
|
+
), P = y(
|
|
74
|
+
(s) => {
|
|
75
|
+
o?.(s), u && m && m(!0);
|
|
76
|
+
},
|
|
77
|
+
[o, u, m]
|
|
78
|
+
), E = y(
|
|
79
|
+
(s, n) => {
|
|
80
|
+
s.stopPropagation(), p === n ? (d?.(n), b(null), c.current && clearTimeout(c.current)) : (b(n), c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
81
|
+
b(null);
|
|
82
|
+
}, 3e3));
|
|
83
|
+
},
|
|
84
|
+
[p, d]
|
|
85
|
+
), L = N.some(
|
|
86
|
+
(s) => (I.get(s)?.length ?? 0) > 0
|
|
87
|
+
);
|
|
88
|
+
return /* @__PURE__ */ l(C, { children: [
|
|
89
|
+
!u && /* @__PURE__ */ r(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: e.sidebarOverlay,
|
|
93
|
+
onClick: () => m?.(!0),
|
|
94
|
+
"aria-hidden": "true"
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ l(
|
|
98
|
+
"aside",
|
|
99
|
+
{
|
|
100
|
+
className: [
|
|
101
|
+
e.sidebar,
|
|
102
|
+
u && e.sidebarCollapsed,
|
|
103
|
+
!u && e.sidebarOpen,
|
|
104
|
+
k
|
|
105
|
+
].filter(Boolean).join(" "),
|
|
106
|
+
...F,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ r("div", { className: e.sidebarHeader, children: j || /* @__PURE__ */ l(C, { children: [
|
|
109
|
+
/* @__PURE__ */ r(
|
|
110
|
+
"button",
|
|
111
|
+
{
|
|
112
|
+
className: [
|
|
113
|
+
e.inputButton,
|
|
114
|
+
e.inputButtonPrimary,
|
|
115
|
+
e.sidebarNewButton
|
|
116
|
+
].filter(Boolean).join(" "),
|
|
117
|
+
onClick: f,
|
|
118
|
+
"aria-label": "New conversation",
|
|
119
|
+
children: /* @__PURE__ */ l("span", { className: e.sidebarNewButtonInner, children: [
|
|
120
|
+
/* @__PURE__ */ r(A, { size: 18 }),
|
|
121
|
+
/* @__PURE__ */ r("span", { children: "New Chat" })
|
|
122
|
+
] })
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ r(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
className: [e.inputButton, e.sidebarCloseButton].join(
|
|
129
|
+
" "
|
|
130
|
+
),
|
|
131
|
+
onClick: () => m?.(!0),
|
|
132
|
+
"aria-label": "Close sidebar",
|
|
133
|
+
children: /* @__PURE__ */ r(U, { size: 20 })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] }) }),
|
|
137
|
+
/* @__PURE__ */ r("div", { className: e.sidebarSearch, children: /* @__PURE__ */ l("div", { className: e.sidebarSearchWrapper, children: [
|
|
138
|
+
/* @__PURE__ */ r($, { size: 16, className: e.sidebarSearchIcon }),
|
|
139
|
+
/* @__PURE__ */ r(
|
|
140
|
+
"input",
|
|
141
|
+
{
|
|
142
|
+
type: "search",
|
|
143
|
+
className: [
|
|
144
|
+
e.sidebarSearchInput,
|
|
145
|
+
e.sidebarSearchInputWithIcon
|
|
146
|
+
].join(" "),
|
|
147
|
+
placeholder: "Search conversations...",
|
|
148
|
+
value: h,
|
|
149
|
+
onChange: O,
|
|
150
|
+
"aria-label": "Search conversations"
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
] }) }),
|
|
154
|
+
/* @__PURE__ */ r(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
className: e.sidebarList,
|
|
158
|
+
role: "list",
|
|
159
|
+
"aria-label": "Conversations",
|
|
160
|
+
children: L ? N.map((s) => {
|
|
161
|
+
const n = I.get(s) ?? [];
|
|
162
|
+
return n.length === 0 ? null : /* @__PURE__ */ l("div", { children: [
|
|
163
|
+
/* @__PURE__ */ r("div", { className: e.sidebarGroupHeader, children: G[s] }),
|
|
164
|
+
n.map((i) => /* @__PURE__ */ l(
|
|
165
|
+
"button",
|
|
166
|
+
{
|
|
167
|
+
className: [
|
|
168
|
+
e.sidebarItem,
|
|
169
|
+
i.id === a && e.sidebarItemActive
|
|
170
|
+
].filter(Boolean).join(" "),
|
|
171
|
+
onClick: () => P(i.id),
|
|
172
|
+
role: "listitem",
|
|
173
|
+
"aria-selected": i.id === a,
|
|
174
|
+
"aria-label": `Conversation: ${i.title}`,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ r(
|
|
177
|
+
T,
|
|
178
|
+
{
|
|
179
|
+
size: 18,
|
|
180
|
+
className: e.sidebarItemIcon
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ l("div", { className: e.sidebarItemContent, children: [
|
|
184
|
+
/* @__PURE__ */ r("span", { className: e.sidebarItemTitle, children: i.title }),
|
|
185
|
+
i.preview && /* @__PURE__ */ r("span", { className: e.sidebarItemPreview, children: i.preview })
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ r("span", { className: e.sidebarItemDate, children: H(i.updatedAt) }),
|
|
188
|
+
d && /* @__PURE__ */ r(
|
|
189
|
+
"button",
|
|
190
|
+
{
|
|
191
|
+
className: e.sidebarItemDelete,
|
|
192
|
+
onClick: (M) => E(M, i.id),
|
|
193
|
+
"aria-label": p === i.id ? `Confirm delete ${i.title}` : `Delete ${i.title}`,
|
|
194
|
+
children: p === i.id ? /* @__PURE__ */ r("span", { className: e.sidebarItemDeleteConfirm, children: "Delete?" }) : /* @__PURE__ */ r(q, { size: 16 })
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
i.id
|
|
200
|
+
))
|
|
201
|
+
] }, s);
|
|
202
|
+
}) : /* @__PURE__ */ l("div", { className: e.sidebarEmpty, children: [
|
|
203
|
+
/* @__PURE__ */ r(T, { size: 32, className: e.sidebarEmptyIcon }),
|
|
204
|
+
/* @__PURE__ */ r("p", { children: h ? "No conversations found" : "No conversations yet" })
|
|
205
|
+
] })
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
v && /* @__PURE__ */ r("div", { className: e.sidebarFooter, children: v })
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] });
|
|
213
|
+
};
|
|
214
|
+
R.displayName = "ChatSidebar";
|
|
215
|
+
export {
|
|
216
|
+
R as ChatSidebar
|
|
217
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n="_dataTable_ncnxg_8",t="_toolbar_ncnxg_21",o="_toolbarLeft_ncnxg_31",e="_toolbarRight_ncnxg_38",c="_searchWrapper_ncnxg_46",a="_searchIcon_ncnxg_52",_="_searchInput_ncnxg_59",i="_bulkActions_ncnxg_84",s="_selectedCount_ncnxg_90",g="_bulkAction_ncnxg_84",r="_bulkActionDanger_ncnxg_123",l="_tableContainer_ncnxg_132",p="_table_ncnxg_132",x="_thead_ncnxg_149",b="_stickyHeader_ncnxg_153",u="_th_ncnxg_149",d="_thContent_ncnxg_172",h="_sortable_ncnxg_178",y="_sortIcon_ncnxg_188",I="_sortIconInactive_ncnxg_192",m="_tbody_ncnxg_197",k="_tr_ncnxg_201",M="_hoverable_ncnxg_210",C="_trSelected_ncnxg_214",S="_striped_ncnxg_222",T="_td_ncnxg_226",A="_checkboxCell_ncnxg_233",D="_checkbox_ncnxg_233",v="_actionsCell_ncnxg_248",f="_actionMenu_ncnxg_273",O="_actionMenuTrigger_ncnxg_277",P="_actionMenuDropdown_ncnxg_298",w="_actionMenuItem_ncnxg_311",z="_actionMenuItemDanger_ncnxg_332",B="_pagination_ncnxg_344",H="_paginationInfo_ncnxg_354",L="_paginationText_ncnxg_360",R="_pageSizeSelect_ncnxg_366",W="_paginationControls_ncnxg_377",j="_paginationButton_ncnxg_383",q="_paginationPages_ncnxg_409",E="_emptyState_ncnxg_421",F="_emptyIcon_ncnxg_430",G="_emptyTitle_ncnxg_435",J="_emptyDescription_ncnxg_443",K="_emptyAction_ncnxg_451",N="_loadingOverlay_ncnxg_459",Q="_spinner_ncnxg_466",U="_spin_ncnxg_466",V="_compact_ncnxg_485",X="_hideOnMobile_ncnxg_503",Y={dataTable:n,toolbar:t,toolbarLeft:o,toolbarRight:e,searchWrapper:c,searchIcon:a,searchInput:_,bulkActions:i,selectedCount:s,bulkAction:g,bulkActionDanger:r,tableContainer:l,table:p,thead:x,stickyHeader:b,th:u,thContent:d,sortable:h,sortIcon:y,sortIconInactive:I,tbody:m,tr:k,hoverable:M,trSelected:C,striped:S,td:T,checkboxCell:A,checkbox:D,actionsCell:v,"sticky-left":"_sticky-left_ncnxg_255","sticky-right":"_sticky-right_ncnxg_262",actionMenu:f,actionMenuTrigger:O,actionMenuDropdown:P,actionMenuItem:w,actionMenuItemDanger:z,pagination:B,paginationInfo:H,paginationText:L,pageSizeSelect:R,paginationControls:W,paginationButton:j,paginationPages:q,emptyState:E,emptyIcon:F,emptyTitle:G,emptyDescription:J,emptyAction:K,loadingOverlay:N,spinner:Q,spin:U,compact:V,hideOnMobile:X};exports.actionMenu=f;exports.actionMenuDropdown=P;exports.actionMenuItem=w;exports.actionMenuItemDanger=z;exports.actionMenuTrigger=O;exports.actionsCell=v;exports.bulkAction=g;exports.bulkActionDanger=r;exports.bulkActions=i;exports.checkbox=D;exports.checkboxCell=A;exports.compact=V;exports.dataTable=n;exports.default=Y;exports.emptyAction=K;exports.emptyDescription=J;exports.emptyIcon=F;exports.emptyState=E;exports.emptyTitle=G;exports.hideOnMobile=X;exports.hoverable=M;exports.loadingOverlay=N;exports.pageSizeSelect=R;exports.pagination=B;exports.paginationButton=j;exports.paginationControls=W;exports.paginationInfo=H;exports.paginationPages=q;exports.paginationText=L;exports.searchIcon=a;exports.searchInput=_;exports.searchWrapper=c;exports.selectedCount=s;exports.sortIcon=y;exports.sortIconInactive=I;exports.sortable=h;exports.spin=U;exports.spinner=Q;exports.stickyHeader=b;exports.striped=S;exports.table=p;exports.tableContainer=l;exports.tbody=m;exports.td=T;exports.th=u;exports.thContent=d;exports.thead=x;exports.toolbar=t;exports.toolbarLeft=o;exports.toolbarRight=e;exports.tr=k;exports.trSelected=C;
|