stargazer-ui 1.5.11 → 1.5.13
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/.babelrc.json +10 -0
- package/.eslintrc.cjs +18 -0
- package/.gitattributes +2 -0
- package/LICENSE +21 -0
- package/dev/index.html +12 -0
- package/dev/index.jsx +46 -0
- package/dev/index.scss +74 -0
- package/dev/pages/ButtonPage.jsx +44 -0
- package/dev/pages/CardPage.jsx +81 -0
- package/dev/pages/DropdownPage.jsx +32 -0
- package/dev/pages/FormPage.jsx +155 -0
- package/dev/pages/ListPage.jsx +52 -0
- package/dev/pages/ModalPage.jsx +38 -0
- package/dev/pages/OverlayPage.jsx +39 -0
- package/dev/pages/components.jsx +19 -0
- package/dev/stargazerui.css +3762 -0
- package/dev/stargazerui.css.map +1 -0
- package/dev/test.jsx +87 -0
- package/package.json +79 -1
- package/rollup.config.js +140 -0
- package/scripts/writePackageJsons.js +42 -0
- package/src/Bar/Bar.tsx +0 -0
- package/src/Bar/Bar.type.ts +9 -0
- package/src/Bar/index.ts +0 -0
- package/src/Button/Button.tsx +20 -0
- package/src/Button/Button.types.ts +8 -0
- package/src/Button/index.ts +3 -0
- package/src/ButtonGroup/ButtonGroup.tsx +14 -0
- package/src/ButtonGroup/ButtonGroup.types.ts +8 -0
- package/src/ButtonGroup/index.ts +3 -0
- package/src/Card/Card.tsx +70 -0
- package/src/Card/Card.types.ts +33 -0
- package/src/Card/index.ts +3 -0
- package/src/CloseButton/CloseButton.tsx +14 -0
- package/src/CloseButton/CloseButton.types.ts +6 -0
- package/src/CloseButton/index.ts +3 -0
- package/src/Dropdown/Dropdown.tsx +440 -0
- package/src/Dropdown/Dropdown.types.ts +60 -0
- package/src/Dropdown/DropdownOld.tsx +409 -0
- package/src/Dropdown/index.ts +4 -0
- package/src/FileUploadButton/FileUploadButton.tsx +27 -0
- package/src/FileUploadButton/FileUploadButton.types.ts +9 -0
- package/src/FileUploadButton/index.ts +3 -0
- package/src/FloatingLabel/FloatingLabel.tsx +22 -0
- package/src/FloatingLabel/FloatingLabel.types.ts +11 -0
- package/src/FloatingLabel/index.ts +3 -0
- package/src/Form/Form.tsx +398 -0
- package/src/Form/Form.types.ts +169 -0
- package/src/Form/FormSelect.tsx +527 -0
- package/src/Form/index.ts +4 -0
- package/src/InputGroup/InputGroup.tsx +46 -0
- package/src/InputGroup/InputGroup.types.ts +22 -0
- package/src/InputGroup/index.ts +4 -0
- package/src/List/List.tsx +112 -0
- package/src/List/List.types.ts +34 -0
- package/src/List/index.ts +4 -0
- package/src/Modal/Modal.tsx +229 -0
- package/src/Modal/Modal.types.ts +49 -0
- package/src/Modal/index.ts +4 -0
- package/src/Nav/Nav.tsx +43 -0
- package/src/Nav/Nav.types.ts +21 -0
- package/src/Nav/index.ts +4 -0
- package/src/NavBar/Navbar.tsx +57 -0
- package/src/NavBar/Navbar.types.ts +24 -0
- package/src/NavBar/index.ts +4 -0
- package/src/NavDropdown/NavDropdown.tsx +93 -0
- package/src/NavDropdown/NavDropdown.types.ts +6 -0
- package/src/NavDropdown/index.ts +3 -0
- package/src/Overlay/Overlay.tsx +309 -0
- package/src/Overlay/Overlay.types.ts +24 -0
- package/{Overlay/index.d.ts → src/Overlay/index.ts} +3 -3
- package/src/Popout/Popout.tsx +155 -0
- package/src/Popout/Popout.types.ts +42 -0
- package/src/Popout/index.ts +3 -0
- package/src/Spinner/Spinner.tsx +15 -0
- package/src/Spinner/Spinner.types.ts +7 -0
- package/src/Spinner/index.ts +3 -0
- package/src/Table/Table.tsx +16 -0
- package/src/Table/Table.types.ts +9 -0
- package/src/Table/index.ts +3 -0
- package/src/Tabs/Tabs.tsx +233 -0
- package/src/Tabs/Tabs.types.ts +52 -0
- package/src/Tabs/index.ts +3 -0
- package/src/ToggleButton/ToggleButton.tsx +21 -0
- package/src/ToggleButton/ToggleButton.types.ts +8 -0
- package/src/ToggleButton/index.ts +3 -0
- package/src/assets/tooltip-pointer.svg +3 -0
- package/src/assets/warning.svg +39 -0
- package/{hooks/index.d.ts → src/hooks/index.ts} +7 -6
- package/src/hooks/useClassname.ts +5 -0
- package/src/hooks/useDraggable.ts +186 -0
- package/src/hooks/useKeepElementFocused.ts +37 -0
- package/src/hooks/useQueryParams.ts +12 -0
- package/src/hooks/useScreenSize.ts +24 -0
- package/src/index.ts +21 -0
- package/src/styles/_Card.scss +166 -0
- package/src/styles/_CloseButton.scss +51 -0
- package/src/styles/_CustomButton.scss +134 -0
- package/src/styles/_Dropdown.scss +127 -0
- package/src/styles/_FloatingLabel.scss +56 -0
- package/src/styles/_Forms.scss +7 -0
- package/src/styles/_Grid.scss +178 -0
- package/src/styles/_InputGroup.scss +71 -0
- package/src/styles/_List.scss +62 -0
- package/src/styles/_Modal.scss +234 -0
- package/src/styles/_ModalOld.scss +242 -0
- package/src/styles/_Nav.scss +36 -0
- package/src/styles/_NavBar.scss +116 -0
- package/src/styles/_NavDropdown.scss +33 -0
- package/src/styles/_OffCanvas.scss +260 -0
- package/src/styles/_OverLay.scss +64 -0
- package/src/styles/_Popout.scss +75 -0
- package/src/styles/_Spinner.scss +19 -0
- package/src/styles/_Table.scss +34 -0
- package/src/styles/_Tabs.scss +129 -0
- package/src/styles/_colors.scss +510 -0
- package/src/styles/_components.scss +40 -0
- package/src/styles/_functions.scss +134 -0
- package/src/styles/_mixins.scss +26 -0
- package/src/styles/_reset.scss +237 -0
- package/src/styles/_utilities.scss +2480 -0
- package/src/styles/_variables.scss +164 -0
- package/src/styles/forms/_FormCheck.scss +270 -0
- package/src/styles/forms/_FormControl.scss +135 -0
- package/src/styles/forms/_FormGroup.scss +26 -0
- package/src/styles/forms/_FormLabel.scss +3 -0
- package/src/styles/forms/_FormSelect.scss +196 -0
- package/src/styles/forms/_FormSlider.scss +116 -0
- package/src/styles/forms/_FormText.scss +6 -0
- package/{utils/BaseTypes.d.ts → src/utils/BaseTypes.ts} +32 -25
- package/src/utils/ContrastingColor.ts +25 -0
- package/src/utils/CreateSyntheticEvent.ts +30 -0
- package/src/utils/FileImportExport.js +50 -0
- package/src/utils/IsInputKey.ts +18 -0
- package/src/utils/MergeClassnames.ts +5 -0
- package/src/utils/MergeRefs.ts +12 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig-build.json +4 -0
- package/tsconfig.json +79 -0
- package/tsconfig.node.json +10 -0
- package/types/BaseTypes.d.ts +19 -0
- package/{Button → types/components/Button}/Button.types.d.ts +2 -1
- package/types/components/Button/index.d.ts +1 -0
- package/{Card → types/components/Card}/Card.types.d.ts +1 -3
- package/types/components/Card/index.d.ts +1 -0
- package/{CloseButton → types/components/CloseButton}/CloseButton.types.d.ts +1 -1
- package/types/components/CloseButton/index.d.ts +1 -0
- package/{Dropdown/DropdownOld.d.ts → types/components/Dropdown/Dropdown.d.ts} +3 -61
- package/{Dropdown → types/components/Dropdown}/Dropdown.types.d.ts +11 -10
- package/types/components/Dropdown/index.d.ts +1 -0
- package/{FloatingLabel → types/components/FloatingLabel}/FloatingLabel.types.d.ts +1 -1
- package/types/components/FloatingLabel/index.d.ts +1 -0
- package/types/components/Form/Form.d.ts +17 -0
- package/types/components/Form/Form.types.d.ts +50 -0
- package/types/components/Form/index.d.ts +1 -0
- package/types/components/InputGroup/InputGroup.d.ts +6 -0
- package/types/components/InputGroup/InputGroup.types.d.ts +10 -0
- package/types/components/InputGroup/index.d.ts +1 -0
- package/{Modal → types/components/Modal}/Modal.d.ts +1 -1
- package/{Modal → types/components/Modal}/Modal.types.d.ts +2 -3
- package/types/components/Modal/index.d.ts +1 -0
- package/{Nav → types/components/Nav}/Nav.types.d.ts +1 -1
- package/types/components/Nav/index.d.ts +1 -0
- package/{NavBar → types/components/NavBar}/Navbar.d.ts +2 -1
- package/{NavBar → types/components/NavBar}/Navbar.types.d.ts +1 -2
- package/types/components/NavBar/index.d.ts +1 -0
- package/types/components/NavDropdown/NavDropdown.d.ts +35 -0
- package/types/components/NavDropdown/index.d.ts +1 -0
- package/{Popout → types/components/Popout}/Popout.types.d.ts +1 -1
- package/types/components/Popout/index.d.ts +1 -0
- package/types/components/Spinner/index.d.ts +1 -0
- package/{Table → types/components/Table}/Table.types.d.ts +1 -1
- package/types/components/Table/index.d.ts +1 -0
- package/{Tabs → types/components/Tabs}/Tabs.types.d.ts +1 -12
- package/types/components/Tabs/index.d.ts +1 -0
- package/types/components/ToggleButton/ToggleButton.d.ts +9 -0
- package/types/components/ToggleButton/ToggleButton.types.d.ts +0 -0
- package/types/components/ToggleButton/index.d.ts +1 -0
- package/types/components/index.d.ts +16 -0
- package/types/index.d.ts +1 -0
- package/vite.config.js +57 -0
- package/vite.config.js.timestamp-1708777378490-e94428ceb2bf9.mjs +42 -0
- package/Bar/Bar.type.d.ts +0 -6
- package/Bar/index.js +0 -2
- package/Bar/index.js.map +0 -1
- package/Bar/package.json +0 -1
- package/Button/Button.js +0 -15
- package/Button/Button.js.map +0 -1
- package/Button/index.d.ts +0 -3
- package/Button/index.js +0 -7
- package/Button/index.js.map +0 -1
- package/Button/package.json +0 -1
- package/ButtonGroup/ButtonGroup.d.ts +0 -4
- package/ButtonGroup/ButtonGroup.js +0 -11
- package/ButtonGroup/ButtonGroup.js.map +0 -1
- package/ButtonGroup/ButtonGroup.types.d.ts +0 -7
- package/ButtonGroup/index.d.ts +0 -3
- package/ButtonGroup/index.js +0 -7
- package/ButtonGroup/index.js.map +0 -1
- package/ButtonGroup/package.json +0 -1
- package/Card/Card.js +0 -42
- package/Card/Card.js.map +0 -1
- package/Card/index.d.ts +0 -3
- package/Card/index.js +0 -7
- package/Card/index.js.map +0 -1
- package/Card/package.json +0 -1
- package/CloseButton/CloseButton.js +0 -11
- package/CloseButton/CloseButton.js.map +0 -1
- package/CloseButton/index.d.ts +0 -3
- package/CloseButton/index.js +0 -7
- package/CloseButton/index.js.map +0 -1
- package/CloseButton/package.json +0 -1
- package/Dropdown/Dropdown.d.ts +0 -129
- package/Dropdown/Dropdown.js +0 -378
- package/Dropdown/Dropdown.js.map +0 -1
- package/Dropdown/index.d.ts +0 -4
- package/Dropdown/index.js +0 -8
- package/Dropdown/index.js.map +0 -1
- package/Dropdown/package.json +0 -1
- package/FileUploadButton/FileUploadButton.d.ts +0 -4
- package/FileUploadButton/FileUploadButton.js +0 -20
- package/FileUploadButton/FileUploadButton.js.map +0 -1
- package/FileUploadButton/FileUploadButton.types.d.ts +0 -7
- package/FileUploadButton/index.d.ts +0 -3
- package/FileUploadButton/index.js +0 -7
- package/FileUploadButton/index.js.map +0 -1
- package/FileUploadButton/package.json +0 -1
- package/FloatingLabel/FloatingLabel.js +0 -15
- package/FloatingLabel/FloatingLabel.js.map +0 -1
- package/FloatingLabel/index.d.ts +0 -3
- package/FloatingLabel/index.js +0 -7
- package/FloatingLabel/index.js.map +0 -1
- package/FloatingLabel/package.json +0 -1
- package/Form/Form.d.ts +0 -38
- package/Form/Form.js +0 -227
- package/Form/Form.js.map +0 -1
- package/Form/Form.types.d.ts +0 -159
- package/Form/FormSelect.d.ts +0 -15
- package/Form/FormSelect.js +0 -436
- package/Form/FormSelect.js.map +0 -1
- package/Form/index.d.ts +0 -4
- package/Form/index.js +0 -8
- package/Form/index.js.map +0 -1
- package/Form/package.json +0 -1
- package/InputGroup/InputGroup.d.ts +0 -7
- package/InputGroup/InputGroup.js +0 -31
- package/InputGroup/InputGroup.js.map +0 -1
- package/InputGroup/InputGroup.types.d.ts +0 -17
- package/InputGroup/index.d.ts +0 -4
- package/InputGroup/index.js +0 -7
- package/InputGroup/index.js.map +0 -1
- package/InputGroup/package.json +0 -1
- package/List/List.d.ts +0 -14
- package/List/List.js +0 -77
- package/List/List.js.map +0 -1
- package/List/List.types.d.ts +0 -28
- package/List/index.d.ts +0 -3
- package/List/index.js +0 -7
- package/List/index.js.map +0 -1
- package/List/package.json +0 -1
- package/Modal/Modal.js +0 -157
- package/Modal/Modal.js.map +0 -1
- package/Modal/index.d.ts +0 -3
- package/Modal/index.js +0 -7
- package/Modal/index.js.map +0 -1
- package/Modal/package.json +0 -1
- package/Nav/Nav.js +0 -29
- package/Nav/Nav.js.map +0 -1
- package/Nav/index.d.ts +0 -4
- package/Nav/index.js +0 -7
- package/Nav/index.js.map +0 -1
- package/Nav/package.json +0 -1
- package/NavBar/Navbar.js +0 -36
- package/NavBar/Navbar.js.map +0 -1
- package/NavBar/index.d.ts +0 -4
- package/NavBar/index.js +0 -8
- package/NavBar/index.js.map +0 -1
- package/NavBar/package.json +0 -1
- package/NavDropdown/NavDropdown.d.ts +0 -93
- package/NavDropdown/NavDropdown.js +0 -75
- package/NavDropdown/NavDropdown.js.map +0 -1
- package/NavDropdown/index.d.ts +0 -3
- package/NavDropdown/index.js +0 -7
- package/NavDropdown/index.js.map +0 -1
- package/NavDropdown/package.json +0 -1
- package/Overlay/Overlay.d.ts +0 -4
- package/Overlay/Overlay.js +0 -242
- package/Overlay/Overlay.js.map +0 -1
- package/Overlay/Overlay.types.d.ts +0 -22
- package/Overlay/index.js +0 -7
- package/Overlay/index.js.map +0 -1
- package/Overlay/package.json +0 -1
- package/Popout/Popout.js +0 -111
- package/Popout/Popout.js.map +0 -1
- package/Popout/index.d.ts +0 -3
- package/Popout/index.js +0 -7
- package/Popout/index.js.map +0 -1
- package/Popout/package.json +0 -1
- package/Spinner/Spinner.js +0 -11
- package/Spinner/Spinner.js.map +0 -1
- package/Spinner/index.d.ts +0 -3
- package/Spinner/index.js +0 -7
- package/Spinner/index.js.map +0 -1
- package/Spinner/package.json +0 -1
- package/Table/Table.js +0 -12
- package/Table/Table.js.map +0 -1
- package/Table/index.d.ts +0 -3
- package/Table/index.js +0 -7
- package/Table/index.js.map +0 -1
- package/Table/package.json +0 -1
- package/Tabs/Tabs.js +0 -162
- package/Tabs/Tabs.js.map +0 -1
- package/Tabs/index.d.ts +0 -3
- package/Tabs/index.js +0 -7
- package/Tabs/index.js.map +0 -1
- package/Tabs/package.json +0 -1
- package/ToggleButton/ToggleButton.d.ts +0 -4
- package/ToggleButton/ToggleButton.js +0 -18
- package/ToggleButton/ToggleButton.js.map +0 -1
- package/ToggleButton/ToggleButton.types.d.ts +0 -7
- package/ToggleButton/index.d.ts +0 -3
- package/ToggleButton/index.js +0 -7
- package/ToggleButton/index.js.map +0 -1
- package/ToggleButton/package.json +0 -1
- package/hooks/index.js +0 -7
- package/hooks/index.js.map +0 -1
- package/hooks/package.json +0 -1
- package/hooks/useClassname.d.ts +0 -2
- package/hooks/useClassname.js +0 -7
- package/hooks/useClassname.js.map +0 -1
- package/hooks/useDraggable.d.ts +0 -23
- package/hooks/useDraggable.js +0 -147
- package/hooks/useDraggable.js.map +0 -1
- package/hooks/useKeepElementFocused.d.ts +0 -2
- package/hooks/useKeepElementFocused.js +0 -37
- package/hooks/useKeepElementFocused.js.map +0 -1
- package/hooks/useQueryParams.d.ts +0 -2
- package/hooks/useQueryParams.js +0 -13
- package/hooks/useQueryParams.js.map +0 -1
- package/hooks/useScreenSize.d.ts +0 -5
- package/hooks/useScreenSize.js +0 -21
- package/hooks/useScreenSize.js.map +0 -1
- package/index.d.ts +0 -18
- package/index.js +0 -19
- package/index.js.map +0 -1
- package/styles/stargazerui.css +0 -6552
- package/styles/stargazerui.css.map +0 -1
- package/utils/ContrastingColor.d.ts +0 -1
- package/utils/CreateSyntheticEvent.d.ts +0 -3
- package/utils/CreateSyntheticEvent.js +0 -33
- package/utils/CreateSyntheticEvent.js.map +0 -1
- package/utils/IsInputKey.d.ts +0 -7
- package/utils/IsInputKey.js +0 -20
- package/utils/IsInputKey.js.map +0 -1
- package/utils/MergeClassnames.d.ts +0 -2
- package/utils/MergeClassnames.js +0 -7
- package/utils/MergeClassnames.js.map +0 -1
- package/utils/MergeRefs.d.ts +0 -2
- package/utils/MergeRefs.js +0 -16
- package/utils/MergeRefs.js.map +0 -1
- /package/{Button → types/components/Button}/Button.d.ts +0 -0
- /package/{Card → types/components/Card}/Card.d.ts +0 -0
- /package/{CloseButton → types/components/CloseButton}/CloseButton.d.ts +0 -0
- /package/{FloatingLabel → types/components/FloatingLabel}/FloatingLabel.d.ts +0 -0
- /package/{Nav → types/components/Nav}/Nav.d.ts +0 -0
- /package/{NavDropdown → types/components/NavDropdown}/NavDropdown.types.d.ts +0 -0
- /package/{Popout → types/components/Popout}/Popout.d.ts +0 -0
- /package/{Spinner → types/components/Spinner}/Spinner.d.ts +0 -0
- /package/{Spinner → types/components/Spinner}/Spinner.types.d.ts +0 -0
- /package/{Table → types/components/Table}/Table.d.ts +0 -0
- /package/{Tabs → types/components/Tabs}/Tabs.d.ts +0 -0
package/NavDropdown/index.js
DELETED
package/NavDropdown/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/NavDropdown/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}}
|
package/Overlay/Overlay.d.ts
DELETED
package/Overlay/Overlay.js
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef, useRef, useState, useLayoutEffect, useEffect, cloneElement } from 'react';
|
|
4
|
-
import { createPortal } from 'react-dom';
|
|
5
|
-
import mergeRefs from '../utils/MergeRefs.js';
|
|
6
|
-
import mergeClassnames from '../utils/MergeClassnames.js';
|
|
7
|
-
|
|
8
|
-
const setPosition = (referenceElement, overlayElement, position, arrowElement, isArrow = false, boundaryCorrection = { top: 0, left: 0, bottom: 0, right: 0 }) => {
|
|
9
|
-
if (!overlayElement.current)
|
|
10
|
-
return { top: 0, left: 0 };
|
|
11
|
-
const refCurrent = referenceElement.current;
|
|
12
|
-
const overlayCurrent = overlayElement.current;
|
|
13
|
-
const arrowCurrent = arrowElement.current;
|
|
14
|
-
const refTop = refCurrent.getBoundingClientRect().top;
|
|
15
|
-
const refHeight = refCurrent.offsetHeight;
|
|
16
|
-
const refLeft = refCurrent.getBoundingClientRect().left;
|
|
17
|
-
const refWidth = refCurrent.offsetWidth;
|
|
18
|
-
const overlayHeight = overlayCurrent.getBoundingClientRect().height;
|
|
19
|
-
const overlayWidth = overlayCurrent.getBoundingClientRect().width;
|
|
20
|
-
const arrowHeight = arrowCurrent.getBoundingClientRect().height;
|
|
21
|
-
const arrowWidth = arrowCurrent.getBoundingClientRect().width;
|
|
22
|
-
//console.log(refTop, arrowHeight, arrowWidth)
|
|
23
|
-
const overlayBorderWidth = parseFloat(getComputedStyle(overlayCurrent).borderWidth.split("px")[0]);
|
|
24
|
-
const arrowOffsetHeight = isArrow ? arrowHeight / 2 : arrowHeight - overlayBorderWidth;
|
|
25
|
-
const arrowOffsetWidth = isArrow ? arrowWidth / 2 : arrowWidth - overlayBorderWidth;
|
|
26
|
-
let tempPos;
|
|
27
|
-
switch (position) {
|
|
28
|
-
case "top":
|
|
29
|
-
tempPos = {
|
|
30
|
-
top: refTop - overlayHeight - arrowOffsetHeight,
|
|
31
|
-
left: refLeft + refWidth / 2 - (isArrow ? arrowOffsetWidth / 2 : overlayWidth / 2)
|
|
32
|
-
};
|
|
33
|
-
//tempPos.right = correctPosition("right", 12, 0)
|
|
34
|
-
//tempPos.left = correctPosition("left", 0, 0)
|
|
35
|
-
return tempPos;
|
|
36
|
-
case "right":
|
|
37
|
-
tempPos = {
|
|
38
|
-
top: refTop + refHeight / 2 - overlayHeight / 2,
|
|
39
|
-
left: refLeft + refWidth + arrowOffsetWidth
|
|
40
|
-
};
|
|
41
|
-
//tempPos.bottom = correctPosition("bottom", window.scrollY + window.innerHeight, 0)
|
|
42
|
-
//tempPos.top = correctPosition("top", window.scrollY, 48)
|
|
43
|
-
return tempPos;
|
|
44
|
-
case "bottom":
|
|
45
|
-
tempPos = {
|
|
46
|
-
top: refTop + refHeight + arrowOffsetHeight,
|
|
47
|
-
left: refLeft + refWidth / 2 - overlayWidth / 2
|
|
48
|
-
};
|
|
49
|
-
//tempPos.right = correctPosition("right", 12, 0)
|
|
50
|
-
//tempPos.left = correctPosition("left", 0, 0)
|
|
51
|
-
return tempPos;
|
|
52
|
-
case "left":
|
|
53
|
-
tempPos = {
|
|
54
|
-
top: refTop + refHeight / 2 - overlayHeight / 2,
|
|
55
|
-
left: refLeft - overlayWidth - arrowOffsetWidth
|
|
56
|
-
};
|
|
57
|
-
//tempPos.bottom = correctPosition("bottom", window.scrollY + window.innerHeight, 0)
|
|
58
|
-
//tempPos.top = correctPosition("top", window.scrollY, 48)
|
|
59
|
-
return tempPos;
|
|
60
|
-
default:
|
|
61
|
-
//this is just top
|
|
62
|
-
return { top: refTop - overlayHeight - arrowHeight, left: refLeft + refWidth / 2 - overlayWidth / 2 };
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const updateAutoPosition = (autoPositionRef, positionRef, overlayRef, arrowRef) => {
|
|
66
|
-
let topDistance = positionRef.current.getBoundingClientRect().top;
|
|
67
|
-
let bottomDistance = window.innerHeight - positionRef.current.getBoundingClientRect().bottom;
|
|
68
|
-
positionRef.current.getBoundingClientRect().left;
|
|
69
|
-
let rightDistance = window.innerWidth - positionRef.current.getBoundingClientRect().right;
|
|
70
|
-
let totalOverlayWidth = overlayRef.current.clientWidth + arrowRef.current.clientWidth + 48;
|
|
71
|
-
let totalOverlayHeight = overlayRef.current.clientHeight + arrowRef.current.clientHeight + 48;
|
|
72
|
-
//console.log(autoPositionRef.current, positionRef.current, overlayRef.current, arrowRef.current)
|
|
73
|
-
if (topDistance >= totalOverlayHeight) {
|
|
74
|
-
return "top";
|
|
75
|
-
}
|
|
76
|
-
else if (topDistance >= totalOverlayHeight / 2) {
|
|
77
|
-
return rightDistance >= totalOverlayWidth ? "right" : "left";
|
|
78
|
-
}
|
|
79
|
-
else if (bottomDistance >= totalOverlayHeight) {
|
|
80
|
-
return "bottom";
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
return autoPositionRef.current;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const Overlay = forwardRef(({ children, overlay, tooltip, show = false, onToggle, position = "auto", trigger = "click", defaultShow = false, tooltipClassname, tooltipStyle, arrowClassname, arrowStyle }, ref) => {
|
|
87
|
-
if (Array.isArray(children)) {
|
|
88
|
-
throw new Error("Overlay can only wrap a single element, either introduce a wrapper or remove all but one trigger element!");
|
|
89
|
-
}
|
|
90
|
-
const positionRef = useRef(null);
|
|
91
|
-
const overlayRef = useRef(null);
|
|
92
|
-
const arrowRef = useRef(null);
|
|
93
|
-
const [arrowPosition, setArrowPosition] = useState({ top: 0, left: 0 });
|
|
94
|
-
const [overlayPosition, setOverlayPosition] = useState({ top: 0, left: 0 });
|
|
95
|
-
const [internalShow, setInternalShow] = useState(defaultShow);
|
|
96
|
-
const internalShowRef = useRef(internalShow);
|
|
97
|
-
const setInternalShowRef = (updatedValue) => {
|
|
98
|
-
internalShowRef.current = updatedValue;
|
|
99
|
-
setInternalShow(updatedValue);
|
|
100
|
-
};
|
|
101
|
-
if (show && show != internalShow) {
|
|
102
|
-
console.log("show");
|
|
103
|
-
setInternalShowRef(show);
|
|
104
|
-
}
|
|
105
|
-
//const positionsList = ["top", "right", "bottom", "left"]
|
|
106
|
-
const [autoPosition, setAutoPosition] = useState(position === "auto" ? "top" : position);
|
|
107
|
-
const autoPositionRef = useRef(autoPosition);
|
|
108
|
-
const setAutoPositionRef = (updatedValue) => {
|
|
109
|
-
autoPositionRef.current = updatedValue;
|
|
110
|
-
setAutoPosition(updatedValue);
|
|
111
|
-
};
|
|
112
|
-
const [isHovering, setIsHovering] = useState(false);
|
|
113
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
114
|
-
const [firstClick, setFirstClick] = useState(true);
|
|
115
|
-
const triggerArray = Array.isArray(trigger) ? trigger : [trigger];
|
|
116
|
-
const positionSetter = (positionRef, overlayRef, arrowRef) => {
|
|
117
|
-
setOverlayPosition(setPosition(positionRef, overlayRef, autoPositionRef.current, arrowRef));
|
|
118
|
-
setArrowPosition(setPosition(positionRef, arrowRef, autoPositionRef.current, arrowRef, true));
|
|
119
|
-
};
|
|
120
|
-
const handleScroll = () => {
|
|
121
|
-
if (internalShowRef.current) {
|
|
122
|
-
positionSetter(positionRef, overlayRef, arrowRef);
|
|
123
|
-
}
|
|
124
|
-
if (internalShowRef.current && position === "auto") {
|
|
125
|
-
let updatedPosition = updateAutoPosition(autoPositionRef, positionRef, overlayRef, arrowRef);
|
|
126
|
-
setAutoPositionRef(updatedPosition);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
const resizeHandler = () => {
|
|
130
|
-
if (internalShowRef.current) {
|
|
131
|
-
positionSetter(positionRef, overlayRef, arrowRef);
|
|
132
|
-
}
|
|
133
|
-
if (!internalShowRef.current && position === "auto") ;
|
|
134
|
-
};
|
|
135
|
-
const { onClick, onHover, onFocus, onBlur, onMouseOver, onMouseLeave } = children.props;
|
|
136
|
-
//console.log(children)
|
|
137
|
-
/* Event handler funtions */
|
|
138
|
-
const handleClick = (event) => {
|
|
139
|
-
if (isFocused && firstClick) {
|
|
140
|
-
//this is needed in case both "focus" and "click" are triggers, otherwise there's weird behaviour
|
|
141
|
-
setFirstClick(false);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
setInternalShowRef(!internalShow);
|
|
145
|
-
if (onToggle) {
|
|
146
|
-
onToggle(!internalShow);
|
|
147
|
-
}
|
|
148
|
-
if (onClick) {
|
|
149
|
-
onClick(event);
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
const handleHover = (event) => {
|
|
153
|
-
setInternalShowRef(true);
|
|
154
|
-
if (!isHovering) {
|
|
155
|
-
setIsHovering(true);
|
|
156
|
-
if (onToggle) {
|
|
157
|
-
onToggle(true);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
if (onHover) {
|
|
161
|
-
onHover(event);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
const handleFocus = (event) => {
|
|
165
|
-
//console.log("focus")
|
|
166
|
-
setInternalShowRef(true);
|
|
167
|
-
setIsFocused(true);
|
|
168
|
-
if (onToggle) {
|
|
169
|
-
onToggle(true);
|
|
170
|
-
}
|
|
171
|
-
if (onFocus) {
|
|
172
|
-
onFocus(event);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
const handleBlur = (event) => {
|
|
176
|
-
//console.log("blur")
|
|
177
|
-
if (isHovering) {
|
|
178
|
-
setIsHovering(false);
|
|
179
|
-
}
|
|
180
|
-
else if (isFocused) {
|
|
181
|
-
setIsFocused(false);
|
|
182
|
-
setFirstClick(true);
|
|
183
|
-
}
|
|
184
|
-
setInternalShowRef(false);
|
|
185
|
-
if (onToggle) {
|
|
186
|
-
onToggle(false);
|
|
187
|
-
}
|
|
188
|
-
if (onBlur) {
|
|
189
|
-
onBlur(event);
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
useLayoutEffect(() => {
|
|
193
|
-
if (overlayRef.current && arrowRef.current) {
|
|
194
|
-
positionSetter(positionRef, overlayRef, arrowRef);
|
|
195
|
-
}
|
|
196
|
-
}, []);
|
|
197
|
-
useEffect(() => {
|
|
198
|
-
if (overlayRef.current && arrowRef.current) {
|
|
199
|
-
positionSetter(positionRef, overlayRef, arrowRef);
|
|
200
|
-
}
|
|
201
|
-
//setInternalShowRef(show)
|
|
202
|
-
}, [internalShow, overlayRef, positionRef, autoPosition]);
|
|
203
|
-
useEffect(() => {
|
|
204
|
-
window.addEventListener("scroll", handleScroll, true);
|
|
205
|
-
window.addEventListener("resize", resizeHandler, true);
|
|
206
|
-
return function cleanup() {
|
|
207
|
-
window.removeEventListener("scroll", handleScroll, true);
|
|
208
|
-
window.removeEventListener("resize", resizeHandler, true);
|
|
209
|
-
};
|
|
210
|
-
}, []);
|
|
211
|
-
const checkRefPositionStyle = (positionRef) => {
|
|
212
|
-
let elementComputedPositionStyle = getComputedStyle(positionRef.current)["position"];
|
|
213
|
-
if (elementComputedPositionStyle === "fixed") {
|
|
214
|
-
return "fixed";
|
|
215
|
-
}
|
|
216
|
-
else if (elementComputedPositionStyle === "sticky") {
|
|
217
|
-
return "sticky";
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
return "absolute";
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
const tooltipClassnames = mergeClassnames("sg-overlay-wrapper", "sg-tooltip-wrapper", tooltipClassname);
|
|
224
|
-
const arrowClassnames = mergeClassnames("sg-overlay-arrow", autoPosition ? " overlay-position-" + autoPosition : "", tooltip ? "sg-tooltip-arrow" : "", arrowClassname);
|
|
225
|
-
return (jsxs(Fragment, { children: [cloneElement(children, {
|
|
226
|
-
ref: mergeRefs([positionRef, children.ref]),
|
|
227
|
-
onClick: triggerArray.find(trigger => trigger === "click") ? handleClick : onClick,
|
|
228
|
-
onMouseOver: triggerArray.find(trigger => trigger === "hover") ? handleHover : onMouseOver,
|
|
229
|
-
onMouseLeave: triggerArray.find(trigger => trigger === "hover") ? handleBlur : onMouseLeave,
|
|
230
|
-
onFocus: triggerArray.find(trigger => trigger === "focus") ? handleFocus : onFocus,
|
|
231
|
-
onBlur: triggerArray.find(trigger => trigger === "focus") ? handleBlur : onBlur,
|
|
232
|
-
}), internalShow ? createPortal(jsxs(Fragment, { children: [overlay ?
|
|
233
|
-
jsxs(Fragment, { children: [jsx("div", { className: "sg-overlay-wrapper", ref: mergeRefs([ref, overlayRef]), style: { position: checkRefPositionStyle(positionRef), top: overlayPosition.top, left: overlayPosition.left }, children: overlay }), jsx("div", { ref: arrowRef, "aria-hidden": true, className: arrowClassnames, style: { ...arrowStyle, position: checkRefPositionStyle(positionRef), top: arrowPosition.top, left: arrowPosition.left, } })] })
|
|
234
|
-
: null, tooltip ?
|
|
235
|
-
jsxs(Fragment, { children: [jsx("div", { className: tooltipClassnames, ref: mergeRefs([ref, overlayRef]), style: { ...tooltipStyle, position: checkRefPositionStyle(positionRef), top: overlayPosition.top, left: overlayPosition.left }, children: tooltip }), jsx("div", { ref: arrowRef, "aria-hidden": true, className: arrowClassnames, style: { ...arrowStyle, position: checkRefPositionStyle(positionRef), top: arrowPosition.top, left: arrowPosition.left, } })] })
|
|
236
|
-
:
|
|
237
|
-
null] }), document.body) : null] }));
|
|
238
|
-
});
|
|
239
|
-
Overlay.displayName = "Overlay";
|
|
240
|
-
|
|
241
|
-
export { Overlay as default };
|
|
242
|
-
//# sourceMappingURL=Overlay.js.map
|
package/Overlay/Overlay.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Overlay.js","sources":["../../src/Overlay/Overlay.tsx"],"sourcesContent":[null],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;AAQA,MAAM,WAAW,GAAG,CAAC,gBAAoB,EAAE,cAAkB,EAAE,QAAe,EAAE,YAAiB,EAAE,OAAiB,GAAA,KAAK,EAAE,kBAAqC,GAAA,EAAC,GAAG,EAAC,CAAC,EAAE,IAAI,EAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,KAAI;IACpM,IAAG,CAAC,cAAc,CAAC,OAAO;QAAE,OAAO,EAAC,GAAG,EAAC,CAAC,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;AAClD,IAAA,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAsB,CAAA;AAC1D,IAAA,MAAM,cAAc,GAAG,cAAc,CAAC,OAAsB,CAAA;AAC5D,IAAA,MAAM,YAAY,GAAG,YAAY,CAAC,OAAsB,CAAA;IAExD,MAAM,MAAM,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC,GAAG,CAAA;AACrD,IAAA,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,CAAA;IACzC,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAA;AACvD,IAAA,MAAM,QAAQ,GAAG,UAAU,CAAC,WAAW,CAAA;IAEvC,MAAM,aAAa,GAAG,cAAc,CAAC,qBAAqB,EAAE,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AG,UAAU,EAAE,QAAQ,EAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE,GAAG,EAAC,aAAc,CAAC,GAAG,EAAE,IAAI,EAAC,aAAc,CAAC,IAAI,GAAE,GACpH,CACP,EAAA,CAAA;AACP,0BAAE,IAAI,EACL,OAAO;AACJ,wBAAAF,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,aAAK,SAAS,EAAE,iBAAiB,EAC7B,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,EAAC,UAAU,CAAC,CAAC,EAChC,KAAK,EAAE,EAAC,GAAG,YAAY,EAAE,QAAQ,EAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE,GAAG,EAAC,eAAgB,CAAC,GAAG,EAAE,IAAI,EAAC,eAAgB,CAAC,IAAI,EAAE,EAAA,QAAA,EAC9H,OAAO,EAAO,CAAA,EAChBA,GACI,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,QAAQ,EAAA,aAAA,EAAA,IAAA,EACb,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,EAAC,GAAG,UAAU,EAAE,QAAQ,EAAC,qBAAqB,CAAC,WAAW,CAAC,EAAE,GAAG,EAAC,aAAc,CAAC,GAAG,EAAE,IAAI,EAAC,aAAc,CAAC,IAAI,GAAE,GACpH,CACP,EAAA,CAAA;;AAEP,4BAAA,IAAI,CACL,EAAA,CAAA,EACL,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CACxB,EAAA,CAAA,EACN;AACL,CAAC,EAAC;AACF,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
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?: "auto" | "top" | "bottom" | "right" | "left";
|
|
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
|
-
};
|
package/Overlay/index.js
DELETED
package/Overlay/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/Overlay/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}}
|
package/Popout/Popout.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
|
-
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
5
|
-
import mergeRefs from '../utils/MergeRefs.js';
|
|
6
|
-
|
|
7
|
-
/*
|
|
8
|
-
export const useEventListener = (eventType: keyof HTMLElementEventMap, callback: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions | undefined, customOptions: {element: HTMLElement}) => {
|
|
9
|
-
const element = customOptions ? customOptions.element : document.body
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
if(element) {
|
|
12
|
-
element.addEventListener(eventType, callback, options)
|
|
13
|
-
return function cleanup() {
|
|
14
|
-
element.removeEventListener(eventType, callback, options)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}, [callback, element])
|
|
18
|
-
}
|
|
19
|
-
*/
|
|
20
|
-
const Popout = forwardRef(({ children, initialPosition = { top: 0, left: 0 }, id, resize = false, move = false, className, style, ...restProps }, ref) => {
|
|
21
|
-
const [coordinates, setCoordinates] = useState({ offSetTop: 0, offSetLeft: 0, ...initialPosition });
|
|
22
|
-
const resizeComputed = resize ? "true" : "false";
|
|
23
|
-
const moveComputed = move ? "true" : "false";
|
|
24
|
-
const passedRef = useRef(ref);
|
|
25
|
-
const popupRef = useRef(null);
|
|
26
|
-
const [isMouseDown, setIsMouseDown] = useState(false);
|
|
27
|
-
const isMouseDownRef = useRef(isMouseDown);
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
isMouseDownRef.current = isMouseDown;
|
|
30
|
-
}, [isMouseDown]);
|
|
31
|
-
const onMouseDown = (event) => {
|
|
32
|
-
const eventTarget = event.target;
|
|
33
|
-
if (move && eventTarget.className.includes("sg-popout-title") || eventTarget.className.includes("sg-popout-header")) {
|
|
34
|
-
const { top, left } = popupRef.current.getBoundingClientRect();
|
|
35
|
-
setCoordinates(prev => ({
|
|
36
|
-
...prev,
|
|
37
|
-
offSetTop: event.clientY - top,
|
|
38
|
-
offSetLeft: event.clientX - left
|
|
39
|
-
}));
|
|
40
|
-
popupRef.current.style.setProperty("user-select", "none");
|
|
41
|
-
popupRef.current.setPointerCapture(event.pointerId); //event.pointerId)//"moveable-popup-"+id);
|
|
42
|
-
setIsMouseDown(true);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const onMouseUp = () => {
|
|
46
|
-
if (move) {
|
|
47
|
-
popupRef.current.style.removeProperty("user-select");
|
|
48
|
-
setIsMouseDown(false);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const onMouseMove = (event) => {
|
|
52
|
-
if (move && isMouseDownRef.current && popupRef.current) {
|
|
53
|
-
const isTopOver = event.clientY - coordinates.offSetTop < 0;
|
|
54
|
-
const isBottomOver = window.innerHeight - (event.clientY - coordinates.offSetTop + popupRef.current.offsetHeight) < 0;
|
|
55
|
-
const isLeftOver = event.clientX - coordinates.offSetLeft < 0;
|
|
56
|
-
const isRightOver = window.innerWidth - (event.clientX - coordinates.offSetLeft + popupRef.current.offsetWidth) < 0;
|
|
57
|
-
let topCoordinate = isTopOver ? 0 : event.clientY - coordinates.offSetTop;
|
|
58
|
-
topCoordinate = isBottomOver ? window.innerHeight - popupRef.current.offsetHeight : topCoordinate;
|
|
59
|
-
let leftCoordinate = isLeftOver ? 0 : event.clientX - coordinates.offSetLeft;
|
|
60
|
-
leftCoordinate = isRightOver ? window.innerWidth - popupRef.current.offsetWidth : leftCoordinate;
|
|
61
|
-
//console.log(event.clientX - coordinates.offSetLeft, event.clientY - coordinates.offSetTop)
|
|
62
|
-
setCoordinates(prev => ({
|
|
63
|
-
...prev,
|
|
64
|
-
top: topCoordinate,
|
|
65
|
-
left: leftCoordinate
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
document.body.addEventListener("pointerup", () => onMouseUp(), true);
|
|
71
|
-
return function cleanup() {
|
|
72
|
-
document.body.removeEventListener("pointerup", () => onMouseUp(), true);
|
|
73
|
-
};
|
|
74
|
-
}, []);
|
|
75
|
-
return (createPortal(jsx("dialog", { "data-resize": resizeComputed, "data-move": moveComputed, "data-passedref": passedRef, ref: mergeRefs([ref, popupRef]), id: id, className: `sg-moveable-popout${className ? " " + className : ""}`, style: { ...style, top: coordinates.top, left: coordinates.left, bottom: coordinates.bottom, right: coordinates.right }, onPointerDown: onMouseDown, onPointerMove: (event) => onMouseMove(event), ...restProps, children: children }), document.body));
|
|
76
|
-
});
|
|
77
|
-
Popout.displayName = "Popout";
|
|
78
|
-
const Header = forwardRef(({ children, className, as = "div", ...restProps }, ref) => {
|
|
79
|
-
let validAs = ["div", "span", "h1", "h2", "h3", "h4", "h5", "h6"];
|
|
80
|
-
let Component = validAs.find(valid => valid === as) ? as : "div";
|
|
81
|
-
return (jsx(Component, { ref: ref, className: `sg-popout-header ${className}`, ...restProps, children: children }));
|
|
82
|
-
});
|
|
83
|
-
Header.displayName = "PopoutHeader";
|
|
84
|
-
const Title = forwardRef(({ as = "h4", className, children, ...restProps }, ref) => {
|
|
85
|
-
let validAs = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
86
|
-
let Component = validAs.find(valid => valid === as) ? as : "h5";
|
|
87
|
-
return (jsx(Component, { ref: ref, className: `sg-popout-title ${className}`, ...restProps, children: children }));
|
|
88
|
-
});
|
|
89
|
-
Title.displayName = "PopoutTitle";
|
|
90
|
-
const Body = forwardRef(({ children, className, ...restProps }, ref) => {
|
|
91
|
-
return (jsx("div", { ref: ref, className: `sg-popout-body ${className}`, ...restProps, children: children }));
|
|
92
|
-
});
|
|
93
|
-
Body.displayName = "PopoutBody";
|
|
94
|
-
const Text = forwardRef(({ children, className, ...restProps }, ref) => {
|
|
95
|
-
return (jsx("p", { ref: ref, className: `sg-popout-text ${className}`, ...restProps, children: children }));
|
|
96
|
-
});
|
|
97
|
-
Text.displayName = "PopoutText";
|
|
98
|
-
const Footer = forwardRef(({ children, className, ...restProps }, ref) => {
|
|
99
|
-
return (jsx("div", { ref: ref, className: `sg-popout-footer ${className}`, ...restProps, children: children }));
|
|
100
|
-
});
|
|
101
|
-
Footer.displayName = "PopoutFooter";
|
|
102
|
-
var Popout$1 = Object.assign(Popout, {
|
|
103
|
-
Header: Header,
|
|
104
|
-
Title: Title,
|
|
105
|
-
Body: Body,
|
|
106
|
-
Text: Text,
|
|
107
|
-
Footer: Footer
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
export { Popout$1 as default };
|
|
111
|
-
//# sourceMappingURL=Popout.js.map
|
package/Popout/Popout.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popout.js","sources":["../../src/Popout/Popout.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;AAMA;;;;;;;;;;;;AAYE;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EAAE,CAAoB,iBAAA,EAAA,SAAS,EAAE,EAAM,GAAA,SAAS,YACnE,QAAQ,EAAA,CACP,EACT;AACL,CAAC,CAAC,CAAA;AACF,MAAM,CAAC,WAAW,GAAG,cAAc,CAAA;AAEnC,eAAgB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;AAClC,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,IAAI,EAAE,IAAI;AACV,IAAA,MAAM,EAAE,MAAM;AACjB,CAAA,CAAC;;;;"}
|
package/Popout/index.d.ts
DELETED
package/Popout/index.js
DELETED
package/Popout/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/Popout/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"stargazer-ui/Popout","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}
|
package/Spinner/Spinner.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
|
|
5
|
-
const Spinner = forwardRef(({ size = "1em", color = "white", label, className, controlId, ...restProps }, ref) => {
|
|
6
|
-
return (jsxs(Fragment, { children: [jsx("div", { "aria-labelledby": controlId, role: "status", ref: ref, className: `sg-spinner${className ? " " + className : ""}`, style: { width: size, height: size, borderColor: color }, ...restProps }), jsx("label", { id: controlId, className: "sg-visually-hidden", children: label })] }));
|
|
7
|
-
});
|
|
8
|
-
Spinner.displayName = "Spinner";
|
|
9
|
-
|
|
10
|
-
export { Spinner as default };
|
|
11
|
-
//# sourceMappingURL=Spinner.js.map
|
package/Spinner/Spinner.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Spinner.js","sources":["../../src/Spinner/Spinner.tsx"],"sourcesContent":[null],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;AAIM,MAAA,OAAO,GAAG,UAAU,CAA+B,CAAC,EAAC,IAAI,GAAC,KAAK,EAAE,KAAK,GAAC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS,EAAC,EAAE,GAAG,KAAI;AACrI,IAAA,QACIA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACIC,GAAsB,CAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,SAAS,EAAE,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,CAAA,UAAA,EAAa,SAAS,GAAG,GAAG,GAAC,SAAS,GAAG,EAAE,CAAA,CAAE,EAAE,KAAK,EAAE,EAAC,KAAK,EAAC,IAAI,EAAE,MAAM,EAAC,IAAI,EAAE,WAAW,EAAC,KAAK,EAAC,EAAM,GAAA,SAAS,EAAQ,CAAA,EAC7LA,GAAO,CAAA,OAAA,EAAA,EAAA,EAAE,EAAE,SAAS,EAAE,SAAS,EAAC,oBAAoB,EAAE,QAAA,EAAA,KAAK,EAAS,CAAA,CAAA,EAAA,CACrE,EACN;AACL,CAAC,EAAC;AACF,OAAO,CAAC,WAAW,GAAG,SAAS;;;;"}
|
package/Spinner/index.d.ts
DELETED
package/Spinner/index.js
DELETED
package/Spinner/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/Spinner/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"stargazer-ui/Spinner","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}
|
package/Table/Table.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { forwardRef } from 'react';
|
|
4
|
-
|
|
5
|
-
const Table = forwardRef(({ children, size = "lg", className, ...restProps }, ref) => {
|
|
6
|
-
let classesComputed = `sg-table${className ? " " + className : ""}${size === "sm" ? " " + "sg-table-sm" : ""}`;
|
|
7
|
-
return (jsx("table", { ref: ref, className: classesComputed, ...restProps, children: children }));
|
|
8
|
-
});
|
|
9
|
-
Table.displayName = "Table";
|
|
10
|
-
|
|
11
|
-
export { Table as default };
|
|
12
|
-
//# sourceMappingURL=Table.js.map
|
package/Table/Table.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Table.js","sources":["../../src/Table/Table.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAKM,MAAA,KAAK,GAAG,UAAU,CAA+B,CAAC,EAAC,QAAQ,EAAE,IAAI,GAAC,IAAI,EAAE,SAAS,EAAE,GAAG,SAAS,EAAC,EAAE,GAAG,KAAI;AAC3G,IAAA,IAAI,eAAe,GAAG,CAAW,QAAA,EAAA,SAAS,GAAG,GAAG,GAAC,SAAS,GAAC,EAAE,CAAG,EAAA,IAAI,KAAK,IAAI,GAAG,GAAG,GAAC,aAAa,GAAC,EAAE,EAAE,CAAA;AACtG,IAAA,QACIA,GAAA,CAAA,OAAA,EAAA,EAAO,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,eAAe,KAAM,SAAS,EAAA,QAAA,EACrD,QAAQ,EAAA,CACL,EACX;AACL,CAAC,EAAC;AACF,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
package/Table/index.d.ts
DELETED
package/Table/index.js
DELETED
package/Table/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/Table/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"name":"stargazer-ui/Table","private":false,"module":"./index.js","types":"./index.d.ts","peerDependencies":{"lodash":"^4.17.21","react":">=17.0.0","react-dom":">=17.0.0"}}
|