stargazer-ui 1.2.1 → 1.3.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.
Files changed (353) hide show
  1. package/Bar/Bar.type.d.ts +6 -0
  2. package/Bar/index.js +2 -0
  3. package/Bar/index.js.map +1 -0
  4. package/Bar/package.json +1 -0
  5. package/Button/Button.js +12 -0
  6. package/Button/Button.js.map +1 -0
  7. package/{types/components/Button → Button}/Button.types.d.ts +1 -2
  8. package/Button/index.d.ts +3 -0
  9. package/Button/index.js +7 -0
  10. package/Button/index.js.map +1 -0
  11. package/Button/package.json +1 -0
  12. package/ButtonGroup/ButtonGroup.d.ts +4 -0
  13. package/ButtonGroup/ButtonGroup.js +10 -0
  14. package/ButtonGroup/ButtonGroup.js.map +1 -0
  15. package/ButtonGroup/ButtonGroup.types.d.ts +7 -0
  16. package/ButtonGroup/index.d.ts +3 -0
  17. package/ButtonGroup/index.js +7 -0
  18. package/ButtonGroup/index.js.map +1 -0
  19. package/ButtonGroup/package.json +1 -0
  20. package/Card/Card.js +41 -0
  21. package/Card/Card.js.map +1 -0
  22. package/{types/components/Card → Card}/Card.types.d.ts +3 -1
  23. package/Card/index.d.ts +3 -0
  24. package/Card/index.js +7 -0
  25. package/Card/index.js.map +1 -0
  26. package/Card/package.json +1 -0
  27. package/CloseButton/CloseButton.js +11 -0
  28. package/CloseButton/CloseButton.js.map +1 -0
  29. package/{types/components/CloseButton → CloseButton}/CloseButton.types.d.ts +1 -1
  30. package/CloseButton/index.d.ts +3 -0
  31. package/CloseButton/index.js +7 -0
  32. package/CloseButton/index.js.map +1 -0
  33. package/CloseButton/package.json +1 -0
  34. package/Dropdown/Dropdown.js +309 -0
  35. package/Dropdown/Dropdown.js.map +1 -0
  36. package/{types/components/Dropdown → Dropdown}/Dropdown.types.d.ts +3 -10
  37. package/Dropdown/index.d.ts +4 -0
  38. package/Dropdown/index.js +8 -0
  39. package/Dropdown/index.js.map +1 -0
  40. package/Dropdown/package.json +1 -0
  41. package/FileUploadButton/FileUploadButton.d.ts +4 -0
  42. package/FileUploadButton/FileUploadButton.js +21 -0
  43. package/FileUploadButton/FileUploadButton.js.map +1 -0
  44. package/FileUploadButton/FileUploadButton.types.d.ts +7 -0
  45. package/FileUploadButton/index.d.ts +3 -0
  46. package/FileUploadButton/index.js +7 -0
  47. package/FileUploadButton/index.js.map +1 -0
  48. package/FileUploadButton/package.json +1 -0
  49. package/FloatingLabel/FloatingLabel.js +17 -0
  50. package/FloatingLabel/FloatingLabel.js.map +1 -0
  51. package/{types/components/FloatingLabel → FloatingLabel}/FloatingLabel.types.d.ts +1 -1
  52. package/FloatingLabel/index.d.ts +3 -0
  53. package/FloatingLabel/index.js +7 -0
  54. package/FloatingLabel/index.js.map +1 -0
  55. package/FloatingLabel/package.json +1 -0
  56. package/Form/Form.d.ts +42 -0
  57. package/Form/Form.js +370 -0
  58. package/Form/Form.js.map +1 -0
  59. package/Form/Form.types.d.ts +135 -0
  60. package/Form/index.d.ts +4 -0
  61. package/Form/index.js +8 -0
  62. package/Form/index.js.map +1 -0
  63. package/Form/package.json +1 -0
  64. package/InputGroup/InputGroup.d.ts +7 -0
  65. package/InputGroup/InputGroup.js +31 -0
  66. package/InputGroup/InputGroup.js.map +1 -0
  67. package/InputGroup/InputGroup.types.d.ts +16 -0
  68. package/InputGroup/index.d.ts +4 -0
  69. package/InputGroup/index.js +7 -0
  70. package/InputGroup/index.js.map +1 -0
  71. package/InputGroup/package.json +1 -0
  72. package/List/List.d.ts +14 -0
  73. package/List/List.js +76 -0
  74. package/List/List.js.map +1 -0
  75. package/List/List.types.d.ts +28 -0
  76. package/List/index.d.ts +3 -0
  77. package/List/index.js +7 -0
  78. package/List/index.js.map +1 -0
  79. package/List/package.json +1 -0
  80. package/{types/components/Modal → Modal}/Modal.d.ts +1 -1
  81. package/Modal/Modal.js +160 -0
  82. package/Modal/Modal.js.map +1 -0
  83. package/{types/components/Modal → Modal}/Modal.types.d.ts +3 -2
  84. package/Modal/index.d.ts +3 -0
  85. package/Modal/index.js +7 -0
  86. package/Modal/index.js.map +1 -0
  87. package/Modal/package.json +1 -0
  88. package/Nav/Nav.js +28 -0
  89. package/Nav/Nav.js.map +1 -0
  90. package/{types/components/Nav → Nav}/Nav.types.d.ts +1 -1
  91. package/Nav/index.d.ts +4 -0
  92. package/Nav/index.js +7 -0
  93. package/Nav/index.js.map +1 -0
  94. package/Nav/package.json +1 -0
  95. package/{types/components/NavBar → NavBar}/Navbar.d.ts +1 -2
  96. package/NavBar/Navbar.js +36 -0
  97. package/NavBar/Navbar.js.map +1 -0
  98. package/{types/components/NavBar → NavBar}/Navbar.types.d.ts +2 -1
  99. package/NavBar/index.d.ts +4 -0
  100. package/NavBar/index.js +8 -0
  101. package/NavBar/index.js.map +1 -0
  102. package/NavBar/package.json +1 -0
  103. package/{types/components/NavDropdown → NavDropdown}/NavDropdown.d.ts +2 -2
  104. package/NavDropdown/NavDropdown.js +77 -0
  105. package/NavDropdown/NavDropdown.js.map +1 -0
  106. package/NavDropdown/index.d.ts +3 -0
  107. package/NavDropdown/index.js +7 -0
  108. package/NavDropdown/index.js.map +1 -0
  109. package/NavDropdown/package.json +1 -0
  110. package/Overlay/Overlay.d.ts +4 -0
  111. package/Overlay/Overlay.js +236 -0
  112. package/Overlay/Overlay.js.map +1 -0
  113. package/Overlay/Overlay.types.d.ts +22 -0
  114. package/{src/Overlay/index.ts → Overlay/index.d.ts} +3 -3
  115. package/Overlay/index.js +7 -0
  116. package/Overlay/index.js.map +1 -0
  117. package/Overlay/package.json +1 -0
  118. package/Popout/Popout.js +110 -0
  119. package/Popout/Popout.js.map +1 -0
  120. package/{types/components/Popout → Popout}/Popout.types.d.ts +1 -1
  121. package/Popout/index.d.ts +3 -0
  122. package/Popout/index.js +7 -0
  123. package/Popout/index.js.map +1 -0
  124. package/Popout/package.json +1 -0
  125. package/Spinner/Spinner.js +12 -0
  126. package/Spinner/Spinner.js.map +1 -0
  127. package/Spinner/index.d.ts +3 -0
  128. package/Spinner/index.js +7 -0
  129. package/Spinner/index.js.map +1 -0
  130. package/Spinner/package.json +1 -0
  131. package/Table/Table.js +11 -0
  132. package/Table/Table.js.map +1 -0
  133. package/{types/components/Table → Table}/Table.types.d.ts +1 -1
  134. package/Table/index.d.ts +3 -0
  135. package/Table/index.js +7 -0
  136. package/Table/index.js.map +1 -0
  137. package/Table/package.json +1 -0
  138. package/Tabs/Tabs.js +168 -0
  139. package/Tabs/Tabs.js.map +1 -0
  140. package/{types/components/Tabs → Tabs}/Tabs.types.d.ts +12 -1
  141. package/Tabs/index.d.ts +3 -0
  142. package/Tabs/index.js +7 -0
  143. package/Tabs/index.js.map +1 -0
  144. package/Tabs/package.json +1 -0
  145. package/ToggleButton/ToggleButton.d.ts +4 -0
  146. package/ToggleButton/ToggleButton.js +17 -0
  147. package/ToggleButton/ToggleButton.js.map +1 -0
  148. package/ToggleButton/ToggleButton.types.d.ts +7 -0
  149. package/ToggleButton/index.d.ts +3 -0
  150. package/ToggleButton/index.js +7 -0
  151. package/ToggleButton/index.js.map +1 -0
  152. package/ToggleButton/package.json +1 -0
  153. package/{src/hooks/index.ts → hooks/index.d.ts} +6 -6
  154. package/hooks/index.js +7 -0
  155. package/hooks/index.js.map +1 -0
  156. package/hooks/package.json +1 -0
  157. package/hooks/useClassname.d.ts +2 -0
  158. package/hooks/useClassname.js +7 -0
  159. package/hooks/useClassname.js.map +1 -0
  160. package/hooks/useDraggable.d.ts +23 -0
  161. package/hooks/useDraggable.js +147 -0
  162. package/hooks/useDraggable.js.map +1 -0
  163. package/hooks/useKeepElementFocused.d.ts +2 -0
  164. package/hooks/useKeepElementFocused.js +37 -0
  165. package/hooks/useKeepElementFocused.js.map +1 -0
  166. package/hooks/useQueryParams.d.ts +2 -0
  167. package/hooks/useQueryParams.js +13 -0
  168. package/hooks/useQueryParams.js.map +1 -0
  169. package/hooks/useScreenSize.d.ts +5 -0
  170. package/hooks/useScreenSize.js +21 -0
  171. package/hooks/useScreenSize.js.map +1 -0
  172. package/index.d.ts +18 -0
  173. package/index.js +19 -0
  174. package/index.js.map +1 -0
  175. package/package.json +1 -79
  176. package/styles/stargazerui.css +6513 -0
  177. package/styles/stargazerui.css.map +1 -0
  178. package/{src/utils/BaseTypes.ts → utils/BaseTypes.d.ts} +24 -30
  179. package/utils/ContrastingColor.d.ts +1 -0
  180. package/utils/MergeClassnames.d.ts +2 -0
  181. package/utils/MergeClassnames.js +7 -0
  182. package/utils/MergeClassnames.js.map +1 -0
  183. package/utils/MergeRefs.d.ts +2 -0
  184. package/utils/MergeRefs.js +16 -0
  185. package/utils/MergeRefs.js.map +1 -0
  186. package/.babelrc.json +0 -10
  187. package/.eslintrc.cjs +0 -18
  188. package/.gitattributes +0 -2
  189. package/LICENSE +0 -21
  190. package/dev/index.html +0 -12
  191. package/dev/index.jsx +0 -49
  192. package/dev/index.scss +0 -59
  193. package/dev/pages/ButtonPage.jsx +0 -44
  194. package/dev/pages/CardPage.jsx +0 -81
  195. package/dev/pages/DropdownPage.jsx +0 -31
  196. package/dev/pages/FormPage.jsx +0 -130
  197. package/dev/pages/ListPage.jsx +0 -52
  198. package/dev/pages/ModalPage.jsx +0 -37
  199. package/dev/pages/OverlayPage.jsx +0 -35
  200. package/dev/pages/components.jsx +0 -19
  201. package/dev/stargazerui.css +0 -3762
  202. package/dev/stargazerui.css.map +0 -1
  203. package/dev/test.jsx +0 -88
  204. package/rollup.config.js +0 -140
  205. package/scripts/writePackageJsons.js +0 -42
  206. package/src/Bar/Bar.tsx +0 -0
  207. package/src/Bar/Bar.type.ts +0 -9
  208. package/src/Bar/index.ts +0 -0
  209. package/src/Button/Button.tsx +0 -17
  210. package/src/Button/Button.types.ts +0 -8
  211. package/src/Button/index.ts +0 -3
  212. package/src/ButtonGroup/ButtonGroup.tsx +0 -14
  213. package/src/ButtonGroup/ButtonGroup.types.ts +0 -8
  214. package/src/ButtonGroup/index.ts +0 -3
  215. package/src/Card/Card.tsx +0 -70
  216. package/src/Card/Card.types.ts +0 -33
  217. package/src/Card/index.ts +0 -3
  218. package/src/CloseButton/CloseButton.tsx +0 -14
  219. package/src/CloseButton/CloseButton.types.ts +0 -6
  220. package/src/CloseButton/index.ts +0 -3
  221. package/src/Dropdown/Dropdown.tsx +0 -358
  222. package/src/Dropdown/Dropdown.types.ts +0 -52
  223. package/src/Dropdown/index.ts +0 -4
  224. package/src/FileUploadButton/FileUploadButton.tsx +0 -27
  225. package/src/FileUploadButton/FileUploadButton.types.ts +0 -9
  226. package/src/FileUploadButton/index.ts +0 -3
  227. package/src/FloatingLabel/FloatingLabel.tsx +0 -22
  228. package/src/FloatingLabel/FloatingLabel.types.ts +0 -11
  229. package/src/FloatingLabel/index.ts +0 -3
  230. package/src/Form/Form.tsx +0 -445
  231. package/src/Form/Form.types.ts +0 -117
  232. package/src/Form/index.ts +0 -4
  233. package/src/InputGroup/InputGroup.tsx +0 -46
  234. package/src/InputGroup/InputGroup.types.ts +0 -21
  235. package/src/InputGroup/index.ts +0 -4
  236. package/src/List/List.tsx +0 -112
  237. package/src/List/List.types.ts +0 -34
  238. package/src/List/index.ts +0 -4
  239. package/src/Modal/Modal.tsx +0 -220
  240. package/src/Modal/Modal.types.ts +0 -49
  241. package/src/Modal/index.ts +0 -4
  242. package/src/Nav/Nav.tsx +0 -43
  243. package/src/Nav/Nav.types.ts +0 -21
  244. package/src/Nav/index.ts +0 -4
  245. package/src/NavBar/Navbar.tsx +0 -57
  246. package/src/NavBar/Navbar.types.ts +0 -24
  247. package/src/NavBar/index.ts +0 -4
  248. package/src/NavDropdown/NavDropdown.tsx +0 -93
  249. package/src/NavDropdown/NavDropdown.types.ts +0 -6
  250. package/src/NavDropdown/index.ts +0 -3
  251. package/src/Overlay/Overlay.tsx +0 -277
  252. package/src/Overlay/Overlay.types.ts +0 -20
  253. package/src/Popout/Popout.tsx +0 -155
  254. package/src/Popout/Popout.types.ts +0 -42
  255. package/src/Popout/index.ts +0 -3
  256. package/src/Spinner/Spinner.tsx +0 -15
  257. package/src/Spinner/Spinner.types.ts +0 -7
  258. package/src/Spinner/index.ts +0 -3
  259. package/src/Table/Table.tsx +0 -16
  260. package/src/Table/Table.types.ts +0 -9
  261. package/src/Table/index.ts +0 -3
  262. package/src/Tabs/Tabs.tsx +0 -215
  263. package/src/Tabs/Tabs.types.ts +0 -49
  264. package/src/Tabs/index.ts +0 -3
  265. package/src/ToggleButton/ToggleButton.tsx +0 -21
  266. package/src/ToggleButton/ToggleButton.types.ts +0 -8
  267. package/src/ToggleButton/index.ts +0 -3
  268. package/src/hooks/useClassname.ts +0 -5
  269. package/src/hooks/useDraggable.ts +0 -186
  270. package/src/hooks/useKeepElementFocused.ts +0 -37
  271. package/src/hooks/useScreenSize.ts +0 -24
  272. package/src/index.ts +0 -21
  273. package/src/styles/_Card.scss +0 -166
  274. package/src/styles/_CloseButton.scss +0 -51
  275. package/src/styles/_CustomButton.scss +0 -132
  276. package/src/styles/_Dropdown.scss +0 -120
  277. package/src/styles/_FloatingLabel.scss +0 -56
  278. package/src/styles/_Forms.scss +0 -7
  279. package/src/styles/_Grid.scss +0 -178
  280. package/src/styles/_InputGroup.scss +0 -71
  281. package/src/styles/_List.scss +0 -62
  282. package/src/styles/_Modal.scss +0 -234
  283. package/src/styles/_ModalOld.scss +0 -242
  284. package/src/styles/_Nav.scss +0 -36
  285. package/src/styles/_NavBar.scss +0 -116
  286. package/src/styles/_NavDropdown.scss +0 -34
  287. package/src/styles/_OffCanvas.scss +0 -260
  288. package/src/styles/_OverLay.scss +0 -56
  289. package/src/styles/_Popout.scss +0 -75
  290. package/src/styles/_Spinner.scss +0 -19
  291. package/src/styles/_Table.scss +0 -34
  292. package/src/styles/_Tabs.scss +0 -129
  293. package/src/styles/_colors.scss +0 -510
  294. package/src/styles/_components.scss +0 -40
  295. package/src/styles/_functions.scss +0 -134
  296. package/src/styles/_mixins.scss +0 -26
  297. package/src/styles/_reset.scss +0 -231
  298. package/src/styles/_utilities.scss +0 -2480
  299. package/src/styles/_variables.scss +0 -146
  300. package/src/styles/forms/_FormCheck.scss +0 -269
  301. package/src/styles/forms/_FormControl.scss +0 -102
  302. package/src/styles/forms/_FormGroup.scss +0 -21
  303. package/src/styles/forms/_FormLabel.scss +0 -3
  304. package/src/styles/forms/_FormSelect.scss +0 -164
  305. package/src/styles/forms/_FormSlider.scss +0 -116
  306. package/src/styles/forms/_FormText.scss +0 -6
  307. package/src/utils/ContrastingColor.ts +0 -25
  308. package/src/utils/FileImportExport.js +0 -50
  309. package/src/utils/MergeClassnames.ts +0 -5
  310. package/src/utils/MergeRefs.ts +0 -12
  311. package/src/vite-env.d.ts +0 -1
  312. package/tsconfig-build.json +0 -4
  313. package/tsconfig.json +0 -79
  314. package/tsconfig.node.json +0 -10
  315. package/types/BaseTypes.d.ts +0 -19
  316. package/types/components/Button/index.d.ts +0 -1
  317. package/types/components/Card/index.d.ts +0 -1
  318. package/types/components/CloseButton/index.d.ts +0 -1
  319. package/types/components/Dropdown/index.d.ts +0 -1
  320. package/types/components/FloatingLabel/index.d.ts +0 -1
  321. package/types/components/Form/Form.d.ts +0 -17
  322. package/types/components/Form/Form.types.d.ts +0 -50
  323. package/types/components/Form/index.d.ts +0 -1
  324. package/types/components/InputGroup/InputGroup.d.ts +0 -6
  325. package/types/components/InputGroup/InputGroup.types.d.ts +0 -10
  326. package/types/components/InputGroup/index.d.ts +0 -1
  327. package/types/components/Modal/index.d.ts +0 -1
  328. package/types/components/Nav/index.d.ts +0 -1
  329. package/types/components/NavBar/index.d.ts +0 -1
  330. package/types/components/NavDropdown/index.d.ts +0 -1
  331. package/types/components/Popout/index.d.ts +0 -1
  332. package/types/components/Spinner/index.d.ts +0 -1
  333. package/types/components/Table/index.d.ts +0 -1
  334. package/types/components/Tabs/index.d.ts +0 -1
  335. package/types/components/ToggleButton/ToggleButton.d.ts +0 -9
  336. package/types/components/ToggleButton/ToggleButton.types.d.ts +0 -0
  337. package/types/components/ToggleButton/index.d.ts +0 -1
  338. package/types/components/index.d.ts +0 -16
  339. package/types/index.d.ts +0 -1
  340. package/vite.config.js +0 -57
  341. package/vite.config.js.timestamp-1708777378490-e94428ceb2bf9.mjs +0 -42
  342. /package/{types/components/Button → Button}/Button.d.ts +0 -0
  343. /package/{types/components/Card → Card}/Card.d.ts +0 -0
  344. /package/{types/components/CloseButton → CloseButton}/CloseButton.d.ts +0 -0
  345. /package/{types/components/Dropdown → Dropdown}/Dropdown.d.ts +0 -0
  346. /package/{types/components/FloatingLabel → FloatingLabel}/FloatingLabel.d.ts +0 -0
  347. /package/{types/components/Nav → Nav}/Nav.d.ts +0 -0
  348. /package/{types/components/NavDropdown → NavDropdown}/NavDropdown.types.d.ts +0 -0
  349. /package/{types/components/Popout → Popout}/Popout.d.ts +0 -0
  350. /package/{types/components/Spinner → Spinner}/Spinner.d.ts +0 -0
  351. /package/{types/components/Spinner → Spinner}/Spinner.types.d.ts +0 -0
  352. /package/{types/components/Table → Table}/Table.d.ts +0 -0
  353. /package/{types/components/Tabs → Tabs}/Tabs.d.ts +0 -0
package/Nav/Nav.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Nav.js","sources":["../../src/Nav/Nav.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;AAMA,MAAM,GAAG,GAAG,UAAU,CAAuB,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,GAAC,IAAI,EAAE,GAAG,SAAS,EAAC,EAAE,GAAG,KAAI;IAC/F,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,IAAA,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IACxC,MAAM,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,YAAY,CAAA;IAEjE,QACI,oBAAC,SAAS,EAAA,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,SAAS,CAAA,CAAA,EAAI,YAAY,CAAK,GAAA,CAAA,EAAA,GAAM,SAAS,EAC3E,EAAA,QAAQ,CACD,EACf;AACL,CAAC,CAAC,CAAA;AACF,GAAG,CAAC,WAAW,GAAG,KAAK,CAAA;AAEvB,MAAM,IAAI,GAAG,UAAU,CAA4B,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,GAAC,IAAI,EAAE,GAAG,SAAS,EAAC,EAAE,GAAG,KAAI;IACrG,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,IAAI,EAAC,MAAM,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAc,WAAA,EAAA,SAAS,GAAG,GAAG,GAAC,SAAS,GAAC,EAAE,CAAA,CAAE,KAAM,SAAS,EAAA,EAClG,QAAQ,CACD,EACf;AACL,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;AAE5B,MAAM,IAAI,GAAG,UAAU,CAA4B,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,GAAC,GAAG,EAAE,GAAG,SAAS,EAAC,EAAE,GAAG,KAAI;IACpG,MAAM,SAAS,GAAG,EAAE,CAAA;AACpB,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EAAC,IAAI,EAAC,UAAU,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAc,WAAA,EAAA,SAAS,GAAG,GAAG,GAAC,SAAS,GAAC,EAAE,CAAA,CAAE,KAAM,SAAS,EAAA,EACtG,QAAQ,CACD,EACf;AACL,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,SAAS,CAAA;AAE5B,YAAgB,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;AAC/B,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,IAAI;AACb,CAAA,CAAC;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from "react";
2
- import { BaseAnchorType, BaseElementType, BaseLItemType, BaseUListType } from "../../BaseTypes";
2
+ import { BaseAnchorType, BaseElementType, BaseLItemType, BaseUListType } from "../utils/BaseTypes";
3
3
  export type NavType = {
4
4
  children: ReactNode;
5
5
  className?: string;
package/Nav/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import Nav from "./Nav";
2
+ export default Nav;
3
+ export * from "./Nav";
4
+ export type { NavItemType, NavLinkType, NavType } from "./Nav.types";
package/Nav/index.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import Nav from './Nav.js';
3
+
4
+
5
+
6
+ export { Nav as default };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1 @@
1
+ {"name":"stargazer-ui/Nav","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}
@@ -1,6 +1,5 @@
1
1
  import React from "react";
2
- import { NavbarTextType, NavbarType } from "./Navbar.types";
3
- export type NavbarContextType = string | null;
2
+ import { NavbarTextType, NavbarType, NavbarContextType } from "./Navbar.types";
4
3
  export declare const NavbarContext: React.Context<NavbarContextType>;
5
4
  export declare const useNavbarContext: () => NavbarContextType;
6
5
  declare const _default: React.ForwardRefExoticComponent<Omit<NavbarType, "ref"> & React.RefAttributes<HTMLElement>> & {
@@ -0,0 +1,36 @@
1
+ 'use client';
2
+ import React, { createContext, forwardRef, useMemo, useContext } from 'react';
3
+
4
+ const NavbarContext = createContext(null);
5
+ const NavbarContextProvider = ({ children, value }) => {
6
+ return (React.createElement(NavbarContext.Provider, { value: value }, children));
7
+ };
8
+ const useNavbarContext = () => {
9
+ const context = useContext(NavbarContext);
10
+ return context;
11
+ };
12
+ const Navbar = forwardRef(({ children, className, navbarPrefix = "sg-navbar-", ...restProps }, ref) => {
13
+ const navbarContext = useMemo(() => {
14
+ return navbarPrefix;
15
+ }, [navbarPrefix]);
16
+ return (React.createElement("nav", { ref: ref, className: `sg-navbar${className ? " " + className : ""}`, ...restProps },
17
+ React.createElement(NavbarContextProvider, { value: navbarContext }, children)));
18
+ });
19
+ Navbar.displayName = "Navbar";
20
+ const Brand = forwardRef(({ children, className, href = "#", as = "a", ...restProps }, ref) => {
21
+ const Component = as || (href && as != "Link" ? 'a' : 'span');
22
+ return (React.createElement(Component, { ref: ref, href: href, className: `sg-navbar-brand${className ? " " + className : ""}`, ...restProps }, children));
23
+ });
24
+ Brand.displayName = "NavbarBrand";
25
+ const Text = forwardRef(({ children, className, as = "span", ...restProps }, ref) => {
26
+ const Component = as;
27
+ return (React.createElement(Component, { ref: ref, className: `sg-navbar-text${className ? " " + className : ""}`, ...restProps }, children));
28
+ });
29
+ Text.displayName = "NavbarText";
30
+ var Navbar$1 = Object.assign(Navbar, {
31
+ Brand: Brand,
32
+ Text: Text
33
+ });
34
+
35
+ export { NavbarContext, Navbar$1 as default, useNavbarContext };
36
+ //# sourceMappingURL=Navbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Navbar.js","sources":["../../src/NavBar/Navbar.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;MAIa,aAAa,GAAG,aAAa,CAAoB,IAAI,EAAC;AAEnE,MAAM,qBAAqB,GAAG,CAAC,EAAC,QAAQ,EAAE,KAAK,EAAqD,KAAI;AACpG,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,KAAK,EAAA,EAC/B,QAAQ,CACY,EAC5B;AACL,CAAC,CAAA;AACM,MAAM,gBAAgB,GAAG,MAAK;AACjC,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;AACzC,IAAA,OAAO,OAAO,CAAA;AAClB,EAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAA0B,CAAC,EAAC,QAAQ,EAAE,SAAS,EAAE,YAAY,GAAE,YAAY,EAAE,GAAG,SAAS,EAAC,EAAE,GAAG,KAAI;AACxH,IAAA,MAAM,aA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GAAG,EAAE,SAAS,EAAE,CAAiB,cAAA,EAAA,SAAS,GAAG,GAAG,GAAC,SAAS,GAAC,EAAE,CAAE,CAAA,EAAA,GAAM,SAAS,EAAA,EACzF,QAAQ,CACD,EACf;AACL,CAAC,CAAC,CAAA;AACF,IAAI,CAAC,WAAW,GAAG,YAAY,CAAA;AAE/B,eAAgB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AAClC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,IAAI,EAAE,IAAI;AACb,CAAA,CAAC;;;;"}
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from "react";
2
- import { BaseAnchorType, BaseElementType, BaseNavType } from "../../BaseTypes";
2
+ import { BaseAnchorType, BaseElementType, BaseNavType } from "../utils/BaseTypes";
3
+ export type NavbarContextType = string | null;
3
4
  export type NavbarType = {
4
5
  children: ReactNode;
5
6
  className?: string;
@@ -0,0 +1,4 @@
1
+ import Navbar from "./Navbar";
2
+ export default Navbar;
3
+ export { useNavbarContext } from "./Navbar";
4
+ export type { NavbarBrandType, NavbarContextType, NavbarTextType, NavbarType } from "./Navbar.types";
@@ -0,0 +1,8 @@
1
+ 'use client';
2
+ import Navbar from './Navbar.js';
3
+ export { useNavbarContext } from './Navbar.js';
4
+
5
+
6
+
7
+ export { Navbar as default };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -0,0 +1 @@
1
+ {"name":"stargazer-ui/NavBar","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}
@@ -20,7 +20,7 @@ declare const _default: React.ForwardRefExoticComponent<Omit<NavDropdownType, "r
20
20
  as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
21
21
  variant?: string | undefined;
22
22
  } & React.ClassAttributes<HTMLElement> & React.HTMLAttributes<HTMLElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
23
- Menu: React.ForwardRefExoticComponent<Omit<import("../Dropdown/Dropdown.types").DropdownMenuType, "ref"> & React.RefAttributes<HTMLUListElement>>;
23
+ Menu: React.ForwardRefExoticComponent<Omit<import("..").DropdownMenuType, "ref"> & React.RefAttributes<HTMLUListElement>>;
24
24
  Item: React.ForwardRefExoticComponent<(Omit<{
25
25
  children: React.ReactNode;
26
26
  as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
@@ -30,6 +30,6 @@ declare const _default: React.ForwardRefExoticComponent<Omit<NavDropdownType, "r
30
30
  as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
31
31
  className?: string | undefined;
32
32
  } & React.ClassAttributes<HTMLButtonElement> & React.ButtonHTMLAttributes<HTMLButtonElement>, "ref">) & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
33
- Divider: React.ForwardRefExoticComponent<Omit<import("../Dropdown/Dropdown.types").DropdownDividerType, "ref"> & React.RefAttributes<HTMLHRElement>>;
33
+ Divider: React.ForwardRefExoticComponent<Omit<import("..").DropdownDividerType, "ref"> & React.RefAttributes<HTMLHRElement>>;
34
34
  };
35
35
  export default _default;
@@ -0,0 +1,77 @@
1
+ 'use client';
2
+ import React, { forwardRef, useState, useCallback, useMemo } from 'react';
3
+ import Dropdown, { DropdownContextProvider } from '../Dropdown/Dropdown.js';
4
+
5
+ const getDropdownMenuPlacement = (alignEnd, dropDirection, isRTL = false) => {
6
+ const topStart = isRTL ? 'top-end' : 'top-start';
7
+ const topEnd = isRTL ? 'top-start' : 'top-end';
8
+ const bottomStart = isRTL ? 'bottom-end' : 'bottom-start';
9
+ const bottomEnd = isRTL ? 'bottom-start' : 'bottom-end';
10
+ const leftStart = isRTL ? 'right-start' : 'left-start';
11
+ const leftEnd = isRTL ? 'right-end' : 'left-end';
12
+ const rightStart = isRTL ? 'left-start' : 'right-start';
13
+ const rightEnd = isRTL ? 'left-end' : 'right-end';
14
+ let placement = alignEnd ? bottomEnd : bottomStart;
15
+ if (dropDirection === 'up') {
16
+ placement = alignEnd ? topEnd : topStart;
17
+ }
18
+ else if (dropDirection === 'end') {
19
+ placement = alignEnd ? rightEnd : rightStart;
20
+ }
21
+ else if (dropDirection === 'start') {
22
+ placement = alignEnd ? leftEnd : leftStart;
23
+ }
24
+ else if (dropDirection === 'down-centered') {
25
+ placement = 'bottom';
26
+ }
27
+ else if (dropDirection === 'up-centered') {
28
+ placement = 'top';
29
+ }
30
+ return placement;
31
+ };
32
+ const NavDropdown = forwardRef(({ children, className, onSelect, onToggle, controlId, toggleProps, title, menuProps, drop = "down", align = "start", autoClose = true, show = "default", ...restProps }, ref) => {
33
+ const [showInternal, setShowInternal] = useState(show === "default" ? false : show);
34
+ // this is an object like {index: string} because we need it to rerender even if the case is the same
35
+ // aka we use a "next/previous" case to navigate through the dropdown menu so need to rerender consecutive "next" cases
36
+ const [activeDescendant, setActiveDescendant] = useState({ case: "" });
37
+ const internalOnToggle = useCallback((event) => {
38
+ event.stopPropagation();
39
+ setShowInternal(prev => !prev);
40
+ }, []);
41
+ const alignEnd = align === "end";
42
+ const placement = getDropdownMenuPlacement(alignEnd, drop);
43
+ const controlIdcomputed = controlId;
44
+ const contextValue = useMemo(() => ({
45
+ align,
46
+ drop,
47
+ showInternal: show != "default" && onToggle ? show : showInternal,
48
+ handleToggle: show != "default" && onToggle ? onToggle : internalOnToggle,
49
+ placement,
50
+ directionClasses: {
51
+ down: "dropdown",
52
+ 'down-centered': `dropdown-center`,
53
+ up: 'dropup',
54
+ 'up-centered': 'dropup-center dropup',
55
+ end: 'dropend',
56
+ start: 'dropstart'
57
+ },
58
+ controlId: controlIdcomputed,
59
+ activeDescendant,
60
+ setActiveDescendant,
61
+ navDropdown: false
62
+ }), [align, drop, show, showInternal, onToggle, internalOnToggle, placement, controlId, activeDescendant, setActiveDescendant]);
63
+ return (React.createElement("div", { ref: ref, id: controlId + "-wrapper", className: `sg-dropdown${className ? " " + className : ""} sg-nav-item`, ...restProps },
64
+ React.createElement(DropdownContextProvider, { value: contextValue },
65
+ React.createElement(Dropdown.Toggle, { navDropdown: true, ...toggleProps }, title),
66
+ React.createElement(Dropdown.Menu, { ...menuProps }, children))));
67
+ });
68
+ NavDropdown.displayName = "NavDropdown";
69
+ var NavDropdown$1 = Object.assign(NavDropdown, {
70
+ Toggle: Dropdown.Toggle,
71
+ Menu: Dropdown.Menu,
72
+ Item: Dropdown.Item,
73
+ Divider: Dropdown.Divider
74
+ });
75
+
76
+ export { NavDropdown$1 as default };
77
+ //# sourceMappingURL=NavDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavDropdown.js","sources":["../../src/NavDropdown/NavDropdown.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;AAMA,MAAM,wBAAwB,GAAG,CAAC,QAAiB,EAAE,aAAqB,EAAE,KAAA,GAAgB,KAAK,KAAI;IACjG,MAAM,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,WAAW,CAAC;IACjD,MAAM,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,CAAC;IAC/C,MAAM,WAAW,GAAG,KAAK,GAAG,YAAY,GAAG,cAAc,CAAC;IAC1D,MAAM,SAAS,GAAG,KAAK,GAAG,cAAc,GAAG,YAAY,CAAC;IACxD,MAAM,SAAS,GAAG,KAAK,GAAG,aAAa,GAAG,YAAY,CAAC;IACvD,MAAM,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,UAAU,CAAC;IACjD,MAAM,UAAU,GAAG,KAAK,GAAG,YAAY,GAAG,aAAa,CAAC;IACxD,MAAM,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,WAAW,CAAC;IAClD,IAAI,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AACnD,IAAA,IAAI,aAAa,KAAK,IAAI,EACtB;QACI,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAA;KAC3C;A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AAA,aAAA,CAAA,QAAQ,CAAC,IAAI,EAAK,EAAA,GAAA,SAAS,EACvB,EAAA,QAAQ,CACG,CACM,CACxB,EACT;AACL,CAAC,CAAC,CAAA;AACF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAA;AAEvC,oBAAgB,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACvC,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;IACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;AAC5B,CAAA,CAAC;;;;"}
@@ -0,0 +1,3 @@
1
+ import NavDropdown from "./NavDropdown";
2
+ export default NavDropdown;
3
+ export type { NavDropdownType } from "./NavDropdown.types";
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import NavDropdown from './NavDropdown.js';
3
+
4
+
5
+
6
+ export { NavDropdown as default };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1 @@
1
+ {"name":"stargazer-ui/NavDropdown","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { OverlayType } from "./Overlay.types";
3
+ declare const Overlay: React.ForwardRefExoticComponent<Omit<OverlayType, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export default Overlay;
@@ -0,0 +1,236 @@
1
+ 'use client';
2
+ import React, { forwardRef, useRef, useState, useLayoutEffect, useEffect, cloneElement } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import mergeRefs from '../utils/MergeRefs.js';
5
+ import mergeClassnames from '../utils/MergeClassnames.js';
6
+
7
+ const setPosition = (referenceElement, overlayElement, position, arrowElement, isArrow = false, boundaryCorrection = { top: 0, left: 0, bottom: 0, right: 0 }) => {
8
+ const refCurrent = referenceElement.current;
9
+ const overlayCurrent = overlayElement.current;
10
+ const arrowCurrent = arrowElement.current;
11
+ const refTop = refCurrent.getBoundingClientRect().top;
12
+ const refHeight = refCurrent.offsetHeight;
13
+ const refLeft = refCurrent.getBoundingClientRect().left;
14
+ const refWidth = refCurrent.offsetWidth;
15
+ const overlayHeight = overlayCurrent.getBoundingClientRect().height;
16
+ const overlayWidth = overlayCurrent.getBoundingClientRect().width;
17
+ const arrowHeight = arrowCurrent.getBoundingClientRect().height;
18
+ const arrowWidth = arrowCurrent.getBoundingClientRect().width;
19
+ //console.log(refTop, arrowHeight, arrowWidth)
20
+ const overlayBorderWidth = parseFloat(getComputedStyle(overlayCurrent).borderWidth.split("px")[0]);
21
+ const arrowOffsetHeight = isArrow ? arrowHeight / 2 : arrowHeight - overlayBorderWidth;
22
+ const arrowOffsetWidth = isArrow ? arrowWidth / 2 : arrowWidth - overlayBorderWidth;
23
+ let tempPos;
24
+ switch (position) {
25
+ case "top":
26
+ tempPos = {
27
+ top: refTop - overlayHeight - arrowOffsetHeight,
28
+ left: refLeft + refWidth / 2 - (isArrow ? arrowOffsetWidth / 2 : overlayWidth / 2)
29
+ };
30
+ console.log(isArrow, refLeft, refWidth / 2, overlayWidth / 2);
31
+ //tempPos.right = correctPosition("right", 12, 0)
32
+ //tempPos.left = correctPosition("left", 0, 0)
33
+ return tempPos;
34
+ case "right":
35
+ tempPos = {
36
+ top: refTop + refHeight / 2 - overlayHeight / 2,
37
+ left: refLeft + refWidth + arrowOffsetWidth
38
+ };
39
+ //tempPos.bottom = correctPosition("bottom", window.scrollY + window.innerHeight, 0)
40
+ //tempPos.top = correctPosition("top", window.scrollY, 48)
41
+ return tempPos;
42
+ case "bottom":
43
+ tempPos = {
44
+ top: refTop + refHeight + arrowOffsetHeight,
45
+ left: refLeft + refWidth / 2 - overlayWidth / 2
46
+ };
47
+ //tempPos.right = correctPosition("right", 12, 0)
48
+ //tempPos.left = correctPosition("left", 0, 0)
49
+ return tempPos;
50
+ case "left":
51
+ tempPos = {
52
+ top: refTop + refHeight / 2 - overlayHeight / 2,
53
+ left: refLeft - overlayWidth - arrowOffsetWidth
54
+ };
55
+ //tempPos.bottom = correctPosition("bottom", window.scrollY + window.innerHeight, 0)
56
+ //tempPos.top = correctPosition("top", window.scrollY, 48)
57
+ return tempPos;
58
+ default:
59
+ //this is just top
60
+ return { top: refTop - overlayHeight - arrowHeight, left: refLeft + refWidth / 2 - overlayWidth / 2 };
61
+ }
62
+ };
63
+ const updateAutoPosition = (autoPositionRef, positionRef, overlayRef, arrowRef) => {
64
+ let topDistance = positionRef.current.getBoundingClientRect().top;
65
+ let bottomDistance = window.innerHeight - positionRef.current.getBoundingClientRect().bottom;
66
+ positionRef.current.getBoundingClientRect().left;
67
+ let rightDistance = window.innerWidth - positionRef.current.getBoundingClientRect().right;
68
+ let totalOverlayWidth = overlayRef.current.clientWidth + arrowRef.current.clientWidth + 48;
69
+ let totalOverlayHeight = overlayRef.current.clientHeight + arrowRef.current.clientHeight + 48;
70
+ //console.log(autoPositionRef.current, positionRef.current, overlayRef.current, arrowRef.current)
71
+ if (topDistance >= totalOverlayHeight) {
72
+ return "top";
73
+ }
74
+ else if (topDistance >= totalOverlayHeight / 2) {
75
+ return rightDistance >= totalOverlayWidth ? "right" : "left";
76
+ }
77
+ else if (bottomDistance >= totalOverlayHeight) {
78
+ return "bottom";
79
+ }
80
+ else {
81
+ return autoPositionRef.current;
82
+ }
83
+ };
84
+ const Overlay = forwardRef(({ children, overlay, tooltip, show = false, onToggle, position = "auto", trigger = "click", defaultShow = false, tooltipClassname, tooltipStyle, arrowClassname, arrowStyle }, ref) => {
85
+ if (Array.isArray(children)) {
86
+ throw new Error("Overlay can only wrap a single element, either introduce a wrapper or remove all but one trigger element!");
87
+ }
88
+ const positionRef = useRef(null);
89
+ const overlayRef = useRef(null);
90
+ const arrowRef = useRef(null);
91
+ const [arrowPosition, setArrowPosition] = useState({ top: 0, left: 0 });
92
+ const [overlayPosition, setOverlayPosition] = useState({ top: 0, left: 0 });
93
+ const [internalShow, setInternalShow] = useState(defaultShow);
94
+ const internalShowRef = useRef(internalShow);
95
+ const setInternalShowRef = (updatedValue) => {
96
+ internalShowRef.current = updatedValue;
97
+ setInternalShow(updatedValue);
98
+ };
99
+ if (show && show != internalShow) {
100
+ console.log("show");
101
+ setInternalShowRef(show);
102
+ }
103
+ //const positionsList = ["top", "right", "bottom", "left"]
104
+ const [autoPosition, setAutoPosition] = useState(position === "auto" ? "top" : position);
105
+ const autoPositionRef = useRef(autoPosition);
106
+ const setAutoPositionRef = (updatedValue) => {
107
+ autoPositionRef.current = updatedValue;
108
+ setAutoPosition(updatedValue);
109
+ };
110
+ const [isHovering, setIsHovering] = useState(false);
111
+ const [isFocused, setIsFocused] = useState(false);
112
+ const [firstClick, setFirstClick] = useState(true);
113
+ const triggerArray = Array.isArray(trigger) ? trigger : [trigger];
114
+ const positionSetter = (positionRef, overlayRef, arrowRef) => {
115
+ setOverlayPosition(setPosition(positionRef, overlayRef, autoPositionRef.current, arrowRef));
116
+ setArrowPosition(setPosition(positionRef, arrowRef, autoPositionRef.current, arrowRef, true));
117
+ };
118
+ const handleScroll = () => {
119
+ if (internalShowRef.current) {
120
+ positionSetter(positionRef, overlayRef, arrowRef);
121
+ }
122
+ if (internalShowRef.current && position === "auto") {
123
+ let updatedPosition = updateAutoPosition(autoPositionRef, positionRef, overlayRef, arrowRef);
124
+ setAutoPositionRef(updatedPosition);
125
+ }
126
+ };
127
+ const resizeHandler = () => {
128
+ if (internalShowRef.current) {
129
+ positionSetter(positionRef, overlayRef, arrowRef);
130
+ }
131
+ if (!internalShowRef.current && position === "auto") ;
132
+ };
133
+ /* Event handler funtions */
134
+ const onClick = (event) => {
135
+ //console.log("click")
136
+ if (isFocused && firstClick) {
137
+ //this is needed in case both "focus" and "click" are triggers, otherwise there's weird behaviour
138
+ setFirstClick(false);
139
+ return;
140
+ }
141
+ setInternalShowRef(!internalShow);
142
+ if (onToggle) {
143
+ onToggle(!internalShow);
144
+ }
145
+ };
146
+ const onHover = (event) => {
147
+ setInternalShowRef(true);
148
+ if (!isHovering) {
149
+ setIsHovering(true);
150
+ if (onToggle) {
151
+ onToggle(true);
152
+ }
153
+ }
154
+ };
155
+ const onFocus = (event) => {
156
+ //console.log("focus")
157
+ setInternalShowRef(true);
158
+ setIsFocused(true);
159
+ if (onToggle) {
160
+ onToggle(true);
161
+ }
162
+ };
163
+ const onBlur = (event) => {
164
+ //console.log("blur")
165
+ if (isHovering) {
166
+ setIsHovering(false);
167
+ }
168
+ else if (isFocused) {
169
+ setIsFocused(false);
170
+ setFirstClick(true);
171
+ }
172
+ setInternalShowRef(false);
173
+ if (onToggle) {
174
+ onToggle(false);
175
+ }
176
+ };
177
+ useLayoutEffect(() => {
178
+ if (overlayRef.current && arrowRef.current) {
179
+ positionSetter(positionRef, overlayRef, arrowRef);
180
+ }
181
+ }, []);
182
+ useEffect(() => {
183
+ if (overlayRef.current && arrowRef.current) {
184
+ positionSetter(positionRef, overlayRef, arrowRef);
185
+ }
186
+ //setInternalShowRef(show)
187
+ }, [internalShow, overlayRef, positionRef, autoPosition]);
188
+ useEffect(() => {
189
+ window.addEventListener("scroll", handleScroll, true);
190
+ window.addEventListener("resize", resizeHandler, true);
191
+ return function cleanup() {
192
+ window.removeEventListener("scroll", handleScroll, true);
193
+ window.removeEventListener("resize", resizeHandler, true);
194
+ };
195
+ }, []);
196
+ const checkRefPositionStyle = (positionRef) => {
197
+ let elementComputedPositionStyle = getComputedStyle(positionRef.current)["position"];
198
+ if (elementComputedPositionStyle === "fixed") {
199
+ return "fixed";
200
+ }
201
+ else if (elementComputedPositionStyle === "sticky") {
202
+ return "sticky";
203
+ }
204
+ else {
205
+ return "absolute";
206
+ }
207
+ };
208
+ const tooltipClassnames = mergeClassnames("sg-overlay-wrapper", "sg-tooltip-wrapper", tooltipClassname);
209
+ const arrowClassnames = mergeClassnames("sg-overlay-arrow", autoPosition ? " overlay-position-" + autoPosition : "", tooltip ? "sg-tooltip-arrow" : "", arrowClassname);
210
+ //console.log((positionRef.current! as any).parentElement!)
211
+ return (React.createElement(React.Fragment, null,
212
+ cloneElement(children, {
213
+ ref: positionRef,
214
+ onClick: triggerArray.find(trigger => trigger === "click") ? onClick : null,
215
+ onMouseOver: triggerArray.find(trigger => trigger === "hover") ? onHover : null,
216
+ onMouseLeave: triggerArray.find(trigger => trigger === "hover") ? onBlur : null,
217
+ onFocus: triggerArray.find(trigger => trigger === "focus") ? onFocus : null,
218
+ onBlur: triggerArray.find(trigger => trigger === "focus") ? onBlur : null,
219
+ }),
220
+ internalShow ? createPortal(React.createElement(React.Fragment, null,
221
+ overlay ?
222
+ React.createElement(React.Fragment, null,
223
+ React.createElement("div", { className: "sg-overlay-wrapper", ref: mergeRefs([ref, overlayRef]), style: { position: checkRefPositionStyle(positionRef), top: overlayPosition.top, left: overlayPosition.left } }, overlay),
224
+ React.createElement("div", { ref: arrowRef, "aria-hidden": true, className: arrowClassnames, style: { ...arrowStyle, position: checkRefPositionStyle(positionRef), top: arrowPosition.top, left: arrowPosition.left, } }))
225
+ : null,
226
+ tooltip ?
227
+ React.createElement(React.Fragment, null,
228
+ React.createElement("div", { className: tooltipClassnames, ref: mergeRefs([ref, overlayRef]), style: { ...tooltipStyle, position: checkRefPositionStyle(positionRef), top: overlayPosition.top, left: overlayPosition.left } }, tooltip),
229
+ React.createElement("div", { ref: arrowRef, "aria-hidden": true, className: arrowClassnames, style: { ...arrowStyle, position: checkRefPositionStyle(positionRef), top: arrowPosition.top, left: arrowPosition.left, } }))
230
+ :
231
+ null), document.body) : null));
232
+ });
233
+ Overlay.displayName = "Overlay";
234
+
235
+ export { Overlay as default };
236
+ //# sourceMappingURL=Overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Overlay.js","sources":["../../src/Overlay/Overlay.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAQA,MAAM,WAAW,GAAG,CAAC,gBAAoB,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C,aAAc,CAAC,GAAG,EAAE,IAAI,EAAC,aAAc,CAAC,IAAI,GAAE,GACpH,CACP;;AAEP,oBAAA,IAAI,CACL,EACL,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CACxB,EACN;AACL,CAAC,EAAC;AACF,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
@@ -0,0 +1,22 @@
1
+ import { ReactNode, CSSProperties } from "react";
2
+ import { BaseDivType } from "../utils/BaseTypes";
3
+ export type OverlayType = {
4
+ children: ReactNode;
5
+ overlay?: React.JSX.Element;
6
+ tooltip?: React.JSX.Element | string;
7
+ show?: boolean;
8
+ onToggle?: Function;
9
+ position?: string;
10
+ trigger?: string | string[];
11
+ defaultShow?: boolean;
12
+ tooltipClassname?: string;
13
+ tooltipStyle?: CSSProperties;
14
+ arrowClassname?: string;
15
+ arrowStyle?: CSSProperties;
16
+ } & BaseDivType;
17
+ export type PositionObject = {
18
+ top?: number;
19
+ bottom?: number;
20
+ left?: number;
21
+ right?: number;
22
+ };
@@ -1,3 +1,3 @@
1
- import Overlay from "./Overlay";
2
- export default Overlay
3
- export type { OverlayType, PositionObject } from "./Overlay.types"
1
+ import Overlay from "./Overlay";
2
+ export default Overlay;
3
+ export type { OverlayType, PositionObject } from "./Overlay.types";
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import Overlay from './Overlay.js';
3
+
4
+
5
+
6
+ export { Overlay as default };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -0,0 +1 @@
1
+ {"name":"stargazer-ui/Overlay","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}