stargazer-ui 1.5.13 → 1.5.15
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/Bar/Bar.type.d.ts +6 -0
- package/Bar/index.js +2 -0
- package/Bar/index.js.map +1 -0
- package/Bar/package.json +1 -0
- package/Button/Button.js +15 -0
- package/Button/Button.js.map +1 -0
- package/{types/components/Button → Button}/Button.types.d.ts +1 -2
- package/Button/index.d.ts +3 -0
- package/Button/index.js +7 -0
- package/Button/index.js.map +1 -0
- package/Button/package.json +1 -0
- package/ButtonGroup/ButtonGroup.d.ts +4 -0
- package/ButtonGroup/ButtonGroup.js +11 -0
- package/ButtonGroup/ButtonGroup.js.map +1 -0
- package/ButtonGroup/ButtonGroup.types.d.ts +7 -0
- package/ButtonGroup/index.d.ts +3 -0
- package/ButtonGroup/index.js +7 -0
- package/ButtonGroup/index.js.map +1 -0
- package/ButtonGroup/package.json +1 -0
- package/{types/components/Card → Card}/Card.d.ts +12 -12
- package/Card/Card.js +42 -0
- package/Card/Card.js.map +1 -0
- package/{types/components/Card → Card}/Card.types.d.ts +3 -1
- package/Card/index.d.ts +3 -0
- package/Card/index.js +7 -0
- package/Card/index.js.map +1 -0
- package/Card/package.json +1 -0
- package/CloseButton/CloseButton.js +11 -0
- package/CloseButton/CloseButton.js.map +1 -0
- package/{types/components/CloseButton → CloseButton}/CloseButton.types.d.ts +1 -1
- package/CloseButton/index.d.ts +3 -0
- package/CloseButton/index.js +7 -0
- package/CloseButton/index.js.map +1 -0
- package/CloseButton/package.json +1 -0
- package/Dropdown/Dropdown.d.ts +135 -0
- package/Dropdown/Dropdown.js +379 -0
- package/Dropdown/Dropdown.js.map +1 -0
- package/{types/components/Dropdown → Dropdown}/Dropdown.types.d.ts +12 -11
- package/Dropdown/DropdownOld.d.ts +135 -0
- package/Dropdown/index.d.ts +4 -0
- package/Dropdown/index.js +8 -0
- package/Dropdown/index.js.map +1 -0
- package/Dropdown/package.json +1 -0
- package/FileUploadButton/FileUploadButton.d.ts +4 -0
- package/FileUploadButton/FileUploadButton.js +20 -0
- package/FileUploadButton/FileUploadButton.js.map +1 -0
- package/FileUploadButton/FileUploadButton.types.d.ts +7 -0
- package/FileUploadButton/index.d.ts +3 -0
- package/FileUploadButton/index.js +7 -0
- package/FileUploadButton/index.js.map +1 -0
- package/FileUploadButton/package.json +1 -0
- package/FloatingLabel/FloatingLabel.js +15 -0
- package/FloatingLabel/FloatingLabel.js.map +1 -0
- package/{types/components/FloatingLabel → FloatingLabel}/FloatingLabel.types.d.ts +1 -1
- package/FloatingLabel/index.d.ts +3 -0
- package/FloatingLabel/index.js +7 -0
- package/FloatingLabel/index.js.map +1 -0
- package/FloatingLabel/package.json +1 -0
- package/Form/Form.d.ts +38 -0
- package/Form/Form.js +227 -0
- package/Form/Form.js.map +1 -0
- package/Form/Form.types.d.ts +159 -0
- package/Form/FormSelect.d.ts +14 -0
- package/Form/FormSelect.js +436 -0
- package/Form/FormSelect.js.map +1 -0
- package/Form/index.d.ts +4 -0
- package/Form/index.js +8 -0
- package/Form/index.js.map +1 -0
- package/Form/package.json +1 -0
- package/InputGroup/InputGroup.d.ts +7 -0
- package/InputGroup/InputGroup.js +31 -0
- package/InputGroup/InputGroup.js.map +1 -0
- package/InputGroup/InputGroup.types.d.ts +17 -0
- package/InputGroup/index.d.ts +4 -0
- package/InputGroup/index.js +7 -0
- package/InputGroup/index.js.map +1 -0
- package/InputGroup/package.json +1 -0
- package/List/List.d.ts +14 -0
- package/List/List.js +77 -0
- package/List/List.js.map +1 -0
- package/List/List.types.d.ts +28 -0
- package/List/index.d.ts +3 -0
- package/List/index.js +7 -0
- package/List/index.js.map +1 -0
- package/List/package.json +1 -0
- package/{types/components/Modal → Modal}/Modal.d.ts +19 -19
- package/Modal/Modal.js +157 -0
- package/Modal/Modal.js.map +1 -0
- package/{types/components/Modal → Modal}/Modal.types.d.ts +3 -2
- package/Modal/index.d.ts +3 -0
- package/Modal/index.js +7 -0
- package/Modal/index.js.map +1 -0
- package/Modal/package.json +1 -0
- package/{types/components/Nav → Nav}/Nav.d.ts +12 -12
- package/Nav/Nav.js +29 -0
- package/Nav/Nav.js.map +1 -0
- package/{types/components/Nav → Nav}/Nav.types.d.ts +1 -1
- package/Nav/index.d.ts +4 -0
- package/Nav/index.js +7 -0
- package/Nav/index.js.map +1 -0
- package/Nav/package.json +1 -0
- package/{types/components/NavBar → NavBar}/Navbar.d.ts +7 -8
- package/NavBar/Navbar.js +36 -0
- package/NavBar/Navbar.js.map +1 -0
- package/{types/components/NavBar → NavBar}/Navbar.types.d.ts +2 -1
- package/NavBar/index.d.ts +4 -0
- package/NavBar/index.js +8 -0
- package/NavBar/index.js.map +1 -0
- package/NavBar/package.json +1 -0
- package/NavDropdown/NavDropdown.d.ts +99 -0
- package/NavDropdown/NavDropdown.js +75 -0
- package/NavDropdown/NavDropdown.js.map +1 -0
- package/NavDropdown/index.d.ts +3 -0
- package/NavDropdown/index.js +7 -0
- package/NavDropdown/index.js.map +1 -0
- package/NavDropdown/package.json +1 -0
- package/Overlay/Overlay.d.ts +4 -0
- package/Overlay/Overlay.js +242 -0
- package/Overlay/Overlay.js.map +1 -0
- package/Overlay/Overlay.types.d.ts +22 -0
- package/{src/Overlay/index.ts → Overlay/index.d.ts} +3 -3
- package/Overlay/index.js +7 -0
- package/Overlay/index.js.map +1 -0
- package/Overlay/package.json +1 -0
- package/{types/components/Popout → Popout}/Popout.d.ts +6 -6
- package/Popout/Popout.js +111 -0
- package/Popout/Popout.js.map +1 -0
- package/{types/components/Popout → Popout}/Popout.types.d.ts +1 -1
- package/Popout/index.d.ts +3 -0
- package/Popout/index.js +7 -0
- package/Popout/index.js.map +1 -0
- package/Popout/package.json +1 -0
- package/Spinner/Spinner.js +11 -0
- package/Spinner/Spinner.js.map +1 -0
- package/Spinner/index.d.ts +3 -0
- package/Spinner/index.js +7 -0
- package/Spinner/index.js.map +1 -0
- package/Spinner/package.json +1 -0
- package/Table/Table.js +12 -0
- package/Table/Table.js.map +1 -0
- package/{types/components/Table → Table}/Table.types.d.ts +1 -1
- package/Table/index.d.ts +3 -0
- package/Table/index.js +7 -0
- package/Table/index.js.map +1 -0
- package/Table/package.json +1 -0
- package/Tabs/Tabs.js +162 -0
- package/Tabs/Tabs.js.map +1 -0
- package/{types/components/Tabs → Tabs}/Tabs.types.d.ts +12 -2
- package/Tabs/index.d.ts +3 -0
- package/Tabs/index.js +7 -0
- package/Tabs/index.js.map +1 -0
- package/Tabs/package.json +1 -0
- package/ToggleButton/ToggleButton.d.ts +4 -0
- package/ToggleButton/ToggleButton.js +18 -0
- package/ToggleButton/ToggleButton.js.map +1 -0
- package/ToggleButton/ToggleButton.types.d.ts +7 -0
- package/ToggleButton/index.d.ts +3 -0
- package/ToggleButton/index.js +7 -0
- package/ToggleButton/index.js.map +1 -0
- package/ToggleButton/package.json +1 -0
- package/{src/hooks/index.ts → hooks/index.d.ts} +6 -7
- package/hooks/index.js +7 -0
- package/hooks/index.js.map +1 -0
- package/hooks/package.json +1 -0
- package/hooks/useClassname.d.ts +2 -0
- package/hooks/useClassname.js +7 -0
- package/hooks/useClassname.js.map +1 -0
- package/hooks/useDraggable.d.ts +23 -0
- package/hooks/useDraggable.js +147 -0
- package/hooks/useDraggable.js.map +1 -0
- package/hooks/useKeepElementFocused.d.ts +2 -0
- package/hooks/useKeepElementFocused.js +37 -0
- package/hooks/useKeepElementFocused.js.map +1 -0
- package/hooks/useQueryParams.d.ts +2 -0
- package/hooks/useQueryParams.js +13 -0
- package/hooks/useQueryParams.js.map +1 -0
- package/hooks/useScreenSize.d.ts +5 -0
- package/hooks/useScreenSize.js +21 -0
- package/hooks/useScreenSize.js.map +1 -0
- package/index.d.ts +18 -0
- package/index.js +19 -0
- package/index.js.map +1 -0
- package/package.json +1 -79
- package/styles/stargazerui.css +6552 -0
- package/styles/stargazerui.css.map +1 -0
- package/{src/utils/BaseTypes.ts → utils/BaseTypes.d.ts} +25 -32
- package/utils/ContrastingColor.d.ts +1 -0
- package/utils/CreateSyntheticEvent.d.ts +2 -0
- package/utils/CreateSyntheticEvent.js +33 -0
- package/utils/CreateSyntheticEvent.js.map +1 -0
- package/utils/IsInputKey.d.ts +7 -0
- package/utils/IsInputKey.js +20 -0
- package/utils/IsInputKey.js.map +1 -0
- package/utils/MergeClassnames.d.ts +2 -0
- package/utils/MergeClassnames.js +7 -0
- package/utils/MergeClassnames.js.map +1 -0
- package/utils/MergeRefs.d.ts +1 -0
- package/utils/MergeRefs.js +16 -0
- package/utils/MergeRefs.js.map +1 -0
- package/.babelrc.json +0 -10
- package/.eslintrc.cjs +0 -18
- package/.gitattributes +0 -2
- package/LICENSE +0 -21
- package/dev/index.html +0 -12
- package/dev/index.jsx +0 -46
- package/dev/index.scss +0 -74
- package/dev/pages/ButtonPage.jsx +0 -44
- package/dev/pages/CardPage.jsx +0 -81
- package/dev/pages/DropdownPage.jsx +0 -32
- package/dev/pages/FormPage.jsx +0 -155
- package/dev/pages/ListPage.jsx +0 -52
- package/dev/pages/ModalPage.jsx +0 -38
- package/dev/pages/OverlayPage.jsx +0 -39
- package/dev/pages/components.jsx +0 -19
- package/dev/stargazerui.css +0 -3762
- package/dev/stargazerui.css.map +0 -1
- package/dev/test.jsx +0 -87
- package/rollup.config.js +0 -140
- package/scripts/writePackageJsons.js +0 -42
- package/src/Bar/Bar.tsx +0 -0
- package/src/Bar/Bar.type.ts +0 -9
- package/src/Bar/index.ts +0 -0
- package/src/Button/Button.tsx +0 -20
- package/src/Button/Button.types.ts +0 -8
- package/src/Button/index.ts +0 -3
- package/src/ButtonGroup/ButtonGroup.tsx +0 -14
- package/src/ButtonGroup/ButtonGroup.types.ts +0 -8
- package/src/ButtonGroup/index.ts +0 -3
- package/src/Card/Card.tsx +0 -70
- package/src/Card/Card.types.ts +0 -33
- package/src/Card/index.ts +0 -3
- package/src/CloseButton/CloseButton.tsx +0 -14
- package/src/CloseButton/CloseButton.types.ts +0 -6
- package/src/CloseButton/index.ts +0 -3
- package/src/Dropdown/Dropdown.tsx +0 -440
- package/src/Dropdown/Dropdown.types.ts +0 -60
- package/src/Dropdown/DropdownOld.tsx +0 -409
- package/src/Dropdown/index.ts +0 -4
- package/src/FileUploadButton/FileUploadButton.tsx +0 -27
- package/src/FileUploadButton/FileUploadButton.types.ts +0 -9
- package/src/FileUploadButton/index.ts +0 -3
- package/src/FloatingLabel/FloatingLabel.tsx +0 -22
- package/src/FloatingLabel/FloatingLabel.types.ts +0 -11
- package/src/FloatingLabel/index.ts +0 -3
- package/src/Form/Form.tsx +0 -398
- package/src/Form/Form.types.ts +0 -169
- package/src/Form/FormSelect.tsx +0 -527
- package/src/Form/index.ts +0 -4
- package/src/InputGroup/InputGroup.tsx +0 -46
- package/src/InputGroup/InputGroup.types.ts +0 -22
- package/src/InputGroup/index.ts +0 -4
- package/src/List/List.tsx +0 -112
- package/src/List/List.types.ts +0 -34
- package/src/List/index.ts +0 -4
- package/src/Modal/Modal.tsx +0 -229
- package/src/Modal/Modal.types.ts +0 -49
- package/src/Modal/index.ts +0 -4
- package/src/Nav/Nav.tsx +0 -43
- package/src/Nav/Nav.types.ts +0 -21
- package/src/Nav/index.ts +0 -4
- package/src/NavBar/Navbar.tsx +0 -57
- package/src/NavBar/Navbar.types.ts +0 -24
- package/src/NavBar/index.ts +0 -4
- package/src/NavDropdown/NavDropdown.tsx +0 -93
- package/src/NavDropdown/NavDropdown.types.ts +0 -6
- package/src/NavDropdown/index.ts +0 -3
- package/src/Overlay/Overlay.tsx +0 -309
- package/src/Overlay/Overlay.types.ts +0 -24
- package/src/Popout/Popout.tsx +0 -155
- package/src/Popout/Popout.types.ts +0 -42
- package/src/Popout/index.ts +0 -3
- package/src/Spinner/Spinner.tsx +0 -15
- package/src/Spinner/Spinner.types.ts +0 -7
- package/src/Spinner/index.ts +0 -3
- package/src/Table/Table.tsx +0 -16
- package/src/Table/Table.types.ts +0 -9
- package/src/Table/index.ts +0 -3
- package/src/Tabs/Tabs.tsx +0 -233
- package/src/Tabs/Tabs.types.ts +0 -52
- package/src/Tabs/index.ts +0 -3
- package/src/ToggleButton/ToggleButton.tsx +0 -21
- package/src/ToggleButton/ToggleButton.types.ts +0 -8
- package/src/ToggleButton/index.ts +0 -3
- package/src/assets/tooltip-pointer.svg +0 -3
- package/src/assets/warning.svg +0 -39
- package/src/hooks/useClassname.ts +0 -5
- package/src/hooks/useDraggable.ts +0 -186
- package/src/hooks/useKeepElementFocused.ts +0 -37
- package/src/hooks/useQueryParams.ts +0 -12
- package/src/hooks/useScreenSize.ts +0 -24
- package/src/index.ts +0 -21
- package/src/styles/_Card.scss +0 -166
- package/src/styles/_CloseButton.scss +0 -51
- package/src/styles/_CustomButton.scss +0 -134
- package/src/styles/_Dropdown.scss +0 -127
- package/src/styles/_FloatingLabel.scss +0 -56
- package/src/styles/_Forms.scss +0 -7
- package/src/styles/_Grid.scss +0 -178
- package/src/styles/_InputGroup.scss +0 -71
- package/src/styles/_List.scss +0 -62
- package/src/styles/_Modal.scss +0 -234
- package/src/styles/_ModalOld.scss +0 -242
- package/src/styles/_Nav.scss +0 -36
- package/src/styles/_NavBar.scss +0 -116
- package/src/styles/_NavDropdown.scss +0 -33
- package/src/styles/_OffCanvas.scss +0 -260
- package/src/styles/_OverLay.scss +0 -64
- package/src/styles/_Popout.scss +0 -75
- package/src/styles/_Spinner.scss +0 -19
- package/src/styles/_Table.scss +0 -34
- package/src/styles/_Tabs.scss +0 -129
- package/src/styles/_colors.scss +0 -510
- package/src/styles/_components.scss +0 -40
- package/src/styles/_functions.scss +0 -134
- package/src/styles/_mixins.scss +0 -26
- package/src/styles/_reset.scss +0 -237
- package/src/styles/_utilities.scss +0 -2480
- package/src/styles/_variables.scss +0 -164
- package/src/styles/forms/_FormCheck.scss +0 -270
- package/src/styles/forms/_FormControl.scss +0 -135
- package/src/styles/forms/_FormGroup.scss +0 -26
- package/src/styles/forms/_FormLabel.scss +0 -3
- package/src/styles/forms/_FormSelect.scss +0 -196
- package/src/styles/forms/_FormSlider.scss +0 -116
- package/src/styles/forms/_FormText.scss +0 -6
- package/src/utils/ContrastingColor.ts +0 -25
- package/src/utils/CreateSyntheticEvent.ts +0 -30
- package/src/utils/FileImportExport.js +0 -50
- package/src/utils/IsInputKey.ts +0 -18
- package/src/utils/MergeClassnames.ts +0 -5
- package/src/utils/MergeRefs.ts +0 -12
- package/src/vite-env.d.ts +0 -1
- package/tsconfig-build.json +0 -4
- package/tsconfig.json +0 -79
- package/tsconfig.node.json +0 -10
- package/types/BaseTypes.d.ts +0 -19
- package/types/components/Button/index.d.ts +0 -1
- package/types/components/Card/index.d.ts +0 -1
- package/types/components/CloseButton/index.d.ts +0 -1
- package/types/components/Dropdown/Dropdown.d.ts +0 -71
- package/types/components/Dropdown/index.d.ts +0 -1
- package/types/components/FloatingLabel/index.d.ts +0 -1
- package/types/components/Form/Form.d.ts +0 -17
- package/types/components/Form/Form.types.d.ts +0 -50
- package/types/components/Form/index.d.ts +0 -1
- package/types/components/InputGroup/InputGroup.d.ts +0 -6
- package/types/components/InputGroup/InputGroup.types.d.ts +0 -10
- package/types/components/InputGroup/index.d.ts +0 -1
- package/types/components/Modal/index.d.ts +0 -1
- package/types/components/Nav/index.d.ts +0 -1
- package/types/components/NavBar/index.d.ts +0 -1
- package/types/components/NavDropdown/NavDropdown.d.ts +0 -35
- package/types/components/NavDropdown/index.d.ts +0 -1
- package/types/components/Popout/index.d.ts +0 -1
- package/types/components/Spinner/index.d.ts +0 -1
- package/types/components/Table/index.d.ts +0 -1
- package/types/components/Tabs/index.d.ts +0 -1
- package/types/components/ToggleButton/ToggleButton.d.ts +0 -9
- package/types/components/ToggleButton/ToggleButton.types.d.ts +0 -0
- package/types/components/ToggleButton/index.d.ts +0 -1
- package/types/components/index.d.ts +0 -16
- package/types/index.d.ts +0 -1
- package/vite.config.js +0 -57
- package/vite.config.js.timestamp-1708777378490-e94428ceb2bf9.mjs +0 -42
- /package/{types/components/Button → Button}/Button.d.ts +0 -0
- /package/{types/components/CloseButton → CloseButton}/CloseButton.d.ts +0 -0
- /package/{types/components/FloatingLabel → FloatingLabel}/FloatingLabel.d.ts +0 -0
- /package/{types/components/NavDropdown → NavDropdown}/NavDropdown.types.d.ts +0 -0
- /package/{types/components/Spinner → Spinner}/Spinner.d.ts +0 -0
- /package/{types/components/Spinner → Spinner}/Spinner.types.d.ts +0 -0
- /package/{types/components/Table → Table}/Table.d.ts +0 -0
- /package/{types/components/Tabs → Tabs}/Tabs.d.ts +0 -0
package/src/Form/Form.tsx
DELETED
|
@@ -1,398 +0,0 @@
|
|
|
1
|
-
import React, { forwardRef, useContext, createContext, useMemo, useState, useRef, useEffect, InvalidEvent } from "react";
|
|
2
|
-
|
|
3
|
-
import { HintType, ErrorType, FormTagContextType, FormCheckType, FormContextType, FormControlType, FormGroupType, FormLabelType, FormSliderType, FormTextType, FormType, FormSelectTagType, SliderContextType, WarningIconType } from "./Form.types";
|
|
4
|
-
import useClassname from "../hooks/useClassname";
|
|
5
|
-
import mergeClassnames from "../utils/MergeClassnames";
|
|
6
|
-
import mergeRefs from "../utils/MergeRefs";
|
|
7
|
-
import contrastingColor from "../utils/ContrastingColor";
|
|
8
|
-
|
|
9
|
-
import Overlay from "../Overlay";
|
|
10
|
-
import Select from "./FormSelect"
|
|
11
|
-
import OverlayTrigger from "react-bootstrap/OverlayTrigger"
|
|
12
|
-
import Tooltip from "react-bootstrap/Tooltip"
|
|
13
|
-
|
|
14
|
-
const WarningIcon = forwardRef<SVGSVGElement, WarningIconType>( ({className, alt, color, size, ...restProps}, ref) => {
|
|
15
|
-
const sizeComputed = {width: size ?? "1rem", height: size ?? "1rem"}
|
|
16
|
-
const classNameComputed = mergeClassnames("sg-form-control-error-icon", className)
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<svg
|
|
20
|
-
ref={ref} className={classNameComputed} color={color ?? "currentColor"} xmlns="http://www.w3.org/2000/svg"
|
|
21
|
-
width={sizeComputed.width} height={sizeComputed.height} viewBox="0 0 256 256"
|
|
22
|
-
{...restProps}
|
|
23
|
-
>
|
|
24
|
-
<path
|
|
25
|
-
fill="transparent"
|
|
26
|
-
stroke="currentColor"
|
|
27
|
-
strokeLinecap="round"
|
|
28
|
-
strokeLinejoin="round"
|
|
29
|
-
strokeWidth={28}
|
|
30
|
-
d="M128 83v65"
|
|
31
|
-
/>
|
|
32
|
-
<circle cx={128} cy={183} r={14} fill="currentColor" />
|
|
33
|
-
<path
|
|
34
|
-
fill="transparent"
|
|
35
|
-
stroke="currentColor"
|
|
36
|
-
strokeLinecap="round"
|
|
37
|
-
strokeLinejoin="round"
|
|
38
|
-
strokeWidth={20}
|
|
39
|
-
d="M40 223h176l16-32-79-158h-50L24 191l16 32Z"
|
|
40
|
-
/>
|
|
41
|
-
</svg>
|
|
42
|
-
)
|
|
43
|
-
})
|
|
44
|
-
WarningIcon.displayName = "WarningIcon"
|
|
45
|
-
|
|
46
|
-
const FormTagContext = createContext<FormTagContextType | null>(null)
|
|
47
|
-
const FormTagContextProvider = ({children, value} : {children: React.ReactNode, value:FormTagContextType}) => {
|
|
48
|
-
return(
|
|
49
|
-
<FormTagContext.Provider value={value}>
|
|
50
|
-
{children}
|
|
51
|
-
</FormTagContext.Provider>
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
export const useFormTagContext = () => {
|
|
55
|
-
const context = useContext(FormTagContext)
|
|
56
|
-
if(!context) {
|
|
57
|
-
return { noValidate: null}
|
|
58
|
-
}
|
|
59
|
-
return context
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export const FormContext = createContext<FormContextType | null>(null)
|
|
63
|
-
export const FormContextProvider = ({children, value} : {children: React.ReactNode, value:FormContextType}) => {
|
|
64
|
-
return (
|
|
65
|
-
<FormContext.Provider value={value}>
|
|
66
|
-
{children}
|
|
67
|
-
</FormContext.Provider>
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
export const useFormContext = () => {
|
|
71
|
-
const context = useContext(FormContext)
|
|
72
|
-
if(!context) {
|
|
73
|
-
return {}
|
|
74
|
-
}
|
|
75
|
-
return context
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const Form = forwardRef<HTMLFormElement, FormType>(({children, noValidate, ...restProps}, ref) => {
|
|
80
|
-
const context = useMemo(() => {
|
|
81
|
-
return {noValidate: !!noValidate}
|
|
82
|
-
}, [noValidate])
|
|
83
|
-
return (
|
|
84
|
-
<form ref={ref} noValidate={noValidate} {...restProps}>
|
|
85
|
-
<FormTagContextProvider value={context}>
|
|
86
|
-
{children}
|
|
87
|
-
</FormTagContextProvider>
|
|
88
|
-
</form>
|
|
89
|
-
)
|
|
90
|
-
})
|
|
91
|
-
Form.displayName = "Form"
|
|
92
|
-
|
|
93
|
-
export const ErrorMessage = forwardRef<HTMLParagraphElement, ErrorType>(({children, className, id, message, ...restProps}, ref) => {
|
|
94
|
-
|
|
95
|
-
const classNameComputed = mergeClassnames("sg-form-control-error", className)
|
|
96
|
-
return(
|
|
97
|
-
<p ref={ref} id={id+"-error-message"} className={classNameComputed} {...restProps}>
|
|
98
|
-
<WarningIcon width="1.25em" height="1.25em" />
|
|
99
|
-
<span>{message ?? children}</span>
|
|
100
|
-
</p>
|
|
101
|
-
)
|
|
102
|
-
})
|
|
103
|
-
ErrorMessage.displayName = "ErrorMessage"
|
|
104
|
-
export const HintMessage = forwardRef<HTMLParagraphElement, HintType>(({children, className, id, message, ...restProps}, ref) => {
|
|
105
|
-
const classNameComputed = mergeClassnames("sg-form-control-hint", className)
|
|
106
|
-
return(
|
|
107
|
-
<>
|
|
108
|
-
{message ?
|
|
109
|
-
<p ref={ref} id={id+"-hint-message"} className={classNameComputed} {...restProps}>
|
|
110
|
-
{message}
|
|
111
|
-
</p>
|
|
112
|
-
:
|
|
113
|
-
<div ref={ref} id={id} className={classNameComputed} {...restProps}>
|
|
114
|
-
{children}
|
|
115
|
-
</div>
|
|
116
|
-
}
|
|
117
|
-
</>
|
|
118
|
-
)
|
|
119
|
-
})
|
|
120
|
-
HintMessage.displayName = "HintMessage"
|
|
121
|
-
const Control = forwardRef<HTMLInputElement, FormControlType>( (
|
|
122
|
-
{as = "input", className = "", plaintext = false, id, type = "text", autoFocus=false, error, errorAsOverlay=false, hint, required, "aria-describedby":ariaDescribedby, ...restProps}, ref
|
|
123
|
-
) => {
|
|
124
|
-
let Component = as
|
|
125
|
-
|
|
126
|
-
const { noValidate } = useFormTagContext()
|
|
127
|
-
const { controlId, isInputGroup, isFLoatingLabel } = useFormContext()
|
|
128
|
-
const isOverlay = isInputGroup || isFLoatingLabel || errorAsOverlay
|
|
129
|
-
|
|
130
|
-
let elementId = id ?? controlId
|
|
131
|
-
|
|
132
|
-
let computedClassName = mergeClassnames(
|
|
133
|
-
plaintext ? "sg-form-control-plaintext" : "sg-form-control",
|
|
134
|
-
className != "" ? className : "",
|
|
135
|
-
type == "color" ? "sg-form-control-color" : "",
|
|
136
|
-
error ? "invalid":""
|
|
137
|
-
)
|
|
138
|
-
const errorMessageId = error ? elementId+"-error-message":undefined
|
|
139
|
-
const hintMessageId = hint ? elementId+"-hint-message":undefined
|
|
140
|
-
const tooltipMessage = isOverlay && (error || hint) ?
|
|
141
|
-
<div className="sg-form-control-description tooltip">
|
|
142
|
-
{error? <ErrorMessage id={errorMessageId} message={error.message} /> : null}
|
|
143
|
-
{hint? <HintMessage id={hintMessageId} message={hint.message} /> : null}
|
|
144
|
-
</div> : undefined// "Testing a tooltip with a long message. This messsage is so long it hsould in theory trigger a wrap."
|
|
145
|
-
|
|
146
|
-
const describedby = mergeClassnames(ariaDescribedby, errorMessageId, hintMessageId)
|
|
147
|
-
return (
|
|
148
|
-
<>
|
|
149
|
-
<Overlay trigger={"focus"} position="top" tooltip={tooltipMessage}>
|
|
150
|
-
<Component
|
|
151
|
-
required={(required && !noValidate) ?? undefined}
|
|
152
|
-
aria-required={required ?? undefined} aria-invalid={error ? "true":"false"} aria-describedby={describedby != "" ? describedby : null}
|
|
153
|
-
autoFocus={autoFocus} ref={ref}
|
|
154
|
-
id={elementId} type={type} className={computedClassName} {...restProps} />
|
|
155
|
-
</Overlay>
|
|
156
|
-
<div className="sg-form-control-description">
|
|
157
|
-
{error && !isOverlay ?
|
|
158
|
-
<ErrorMessage id={elementId} message={error.message} style={error.style} className={error.className}/>
|
|
159
|
-
: null }
|
|
160
|
-
{hint && !isOverlay ?
|
|
161
|
-
<HintMessage id={elementId} message={hint.message} style={hint.style} className={hint.className}/>
|
|
162
|
-
: null }
|
|
163
|
-
</div>
|
|
164
|
-
</>
|
|
165
|
-
)
|
|
166
|
-
})
|
|
167
|
-
Control.displayName = "FormControl"
|
|
168
|
-
|
|
169
|
-
const Group = forwardRef<HTMLDivElement, FormGroupType>( ({children, className, controlId, vertical, ...restProps}, ref) => {
|
|
170
|
-
const context = useMemo(() => {
|
|
171
|
-
return {controlId: controlId}
|
|
172
|
-
}, [controlId])
|
|
173
|
-
return (
|
|
174
|
-
<div ref={ref} className={`sg-form-group${className ? " "+className : ""}${vertical ? " sg-form-group-vertical":""}`} {...restProps}>
|
|
175
|
-
<FormContextProvider value={context}>
|
|
176
|
-
{children}
|
|
177
|
-
</FormContextProvider>
|
|
178
|
-
</div>
|
|
179
|
-
)
|
|
180
|
-
})
|
|
181
|
-
Group.displayName = "FormGroup"
|
|
182
|
-
|
|
183
|
-
const Label = forwardRef<HTMLLabelElement, FormLabelType>( ({children, className, htmlFor, ...restProps}, ref) => {
|
|
184
|
-
const { controlId } = useFormContext()
|
|
185
|
-
|
|
186
|
-
let elementHtmlFor = htmlFor ?? controlId
|
|
187
|
-
return (
|
|
188
|
-
<label ref={ref} htmlFor={elementHtmlFor} className={`sg-form-label${className ? " "+className : ""}`} {...restProps}>
|
|
189
|
-
{children}
|
|
190
|
-
</label>
|
|
191
|
-
)
|
|
192
|
-
})
|
|
193
|
-
Label.displayName = "FormLabel"
|
|
194
|
-
|
|
195
|
-
const Check = forwardRef<HTMLInputElement, FormCheckType>( ({ children,
|
|
196
|
-
classNameContainer, containerRef, containerId, styleContainer,
|
|
197
|
-
classNameLabel, labelRef, label, labelId, styleLabel,
|
|
198
|
-
className, type="checkbox", id, reverse=false, style, onChange, required, ...restProps
|
|
199
|
-
} , ref) => {
|
|
200
|
-
const { noValidate } = useFormTagContext()
|
|
201
|
-
const { controlId } = useFormContext()
|
|
202
|
-
|
|
203
|
-
const typeComputed = !["radio", "checkbox", "color"].includes(type) ? "checkbox" : type
|
|
204
|
-
const classNameComputed = mergeClassnames(
|
|
205
|
-
"sg-form-check-input",
|
|
206
|
-
className ?? ""
|
|
207
|
-
)
|
|
208
|
-
const classNameLabelComputed = mergeClassnames(
|
|
209
|
-
"sg-form-check-label",
|
|
210
|
-
classNameLabel ?? ""
|
|
211
|
-
)
|
|
212
|
-
const classNameContainerComputed = mergeClassnames(
|
|
213
|
-
"sg-form-check",
|
|
214
|
-
reverse ? " sg-form-check-reverse":"",
|
|
215
|
-
classNameContainer ?? "",
|
|
216
|
-
type === "switch" ? " sg-form-switch":""
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
const [contrastColor, setContrastColor] = useState<React.CSSProperties>({})
|
|
220
|
-
const onChangeInternal = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
221
|
-
//setContrastColor({backgroundColor: "#"+contrastingColor(event.target.value)})
|
|
222
|
-
if(onChange) onChange(event)
|
|
223
|
-
}
|
|
224
|
-
//required={(required && !noValidate) ?? undefined} aria-required={required ?? undefined}
|
|
225
|
-
const elementId = id ?? controlId
|
|
226
|
-
return (
|
|
227
|
-
<div ref={containerRef} id={containerId} style={styleContainer} className={classNameContainerComputed} >
|
|
228
|
-
{
|
|
229
|
-
controlId ?
|
|
230
|
-
<input required={(required && !noValidate) ?? undefined} aria-required={required ?? undefined} id={controlId} ref={ref} type={typeComputed} style={style} className={classNameComputed} onChange={event => onChangeInternal(event)} {...restProps} />
|
|
231
|
-
:
|
|
232
|
-
<label ref={labelRef} htmlFor={elementId} id={labelId} style={styleLabel} className={classNameLabelComputed}>
|
|
233
|
-
{reverse ? <span>{children ?? label}</span> : null}
|
|
234
|
-
<input required={(required && !noValidate) ?? undefined} aria-required={required ?? undefined} ref={ref} type={typeComputed} style={style} id={elementId} className={classNameComputed} onChange={event => onChangeInternal(event)} {...restProps} />
|
|
235
|
-
{!reverse ? <span>{children ?? label}</span> : null}
|
|
236
|
-
</label>
|
|
237
|
-
}
|
|
238
|
-
</div>
|
|
239
|
-
)
|
|
240
|
-
})
|
|
241
|
-
Check.displayName = "FormCheck"
|
|
242
|
-
|
|
243
|
-
const Text = forwardRef<HTMLElement, FormTextType>( ({children, className, ...restProps}, ref) => {
|
|
244
|
-
return (
|
|
245
|
-
<small ref={ref} className={`sg-form-text${className ? " "+className:""}`} {...restProps}>
|
|
246
|
-
{children}
|
|
247
|
-
</small>
|
|
248
|
-
)
|
|
249
|
-
})
|
|
250
|
-
Check.displayName = "FormText"
|
|
251
|
-
|
|
252
|
-
export const SliderContext = createContext<SliderContextType | null>(null)
|
|
253
|
-
export const SliderContextProvider = ({children, value} : {children: React.ReactNode, value:SliderContextType}) => {
|
|
254
|
-
return (
|
|
255
|
-
<SliderContext.Provider value={value}>
|
|
256
|
-
{children}
|
|
257
|
-
</SliderContext.Provider>
|
|
258
|
-
)
|
|
259
|
-
}
|
|
260
|
-
export const useSliderContext = () => {
|
|
261
|
-
const context = useContext(SliderContext)
|
|
262
|
-
if(!context) {
|
|
263
|
-
throw new Error("UseSliderContext must be used within a SliderContextProvider!")
|
|
264
|
-
}
|
|
265
|
-
return context
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
const Slider = forwardRef<HTMLSpanElement, FormSliderType>( ({className, style, controlId, min=1, max=10, step=1, defaultValue=6, value, onChange, ...restProps}, ref) => {
|
|
269
|
-
const internalRef = useRef<HTMLDivElement>(null)
|
|
270
|
-
//if(internalRef.current) console.log(internalRef.current)
|
|
271
|
-
const trackEmpty = useRef<HTMLDivElement>(null)
|
|
272
|
-
const trackFilled = useRef<HTMLDivElement>(null)
|
|
273
|
-
const thumbRef = useRef<HTMLSpanElement>(null)
|
|
274
|
-
const [ internalValue, setInternalValue ] = useState(value ? value + 1 - min : defaultValue - min)
|
|
275
|
-
if(value && value != internalValue + min) {
|
|
276
|
-
setInternalValue(value - min)
|
|
277
|
-
}
|
|
278
|
-
const internalMin = min < 1 ? 1 : min
|
|
279
|
-
const internalMax = min < 1 ? max + 1 - min : max
|
|
280
|
-
|
|
281
|
-
const [ isGrabbing, setIsGrabbing ] = useState(false)
|
|
282
|
-
const updateValue = (value: number) => {
|
|
283
|
-
let parsedValue = value < internalMin - 1 ? internalMin - 1 : value
|
|
284
|
-
parsedValue = parsedValue > internalMax - internalMin ? internalMax - internalMin : parsedValue
|
|
285
|
-
if(parsedValue === internalValue) return
|
|
286
|
-
|
|
287
|
-
setInternalValue(parsedValue)
|
|
288
|
-
if(onChange) {
|
|
289
|
-
onChange(Math.abs(parsedValue) + min)
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
const getNearestStep = (event: React.PointerEvent, targetElement: HTMLElement) => {
|
|
293
|
-
const { pageX } = event
|
|
294
|
-
const paddingLeft = parseFloat(window.getComputedStyle(targetElement, null).getPropertyValue('padding-left'))
|
|
295
|
-
const leftEdge = targetElement.getBoundingClientRect().left + paddingLeft
|
|
296
|
-
|
|
297
|
-
const width = targetElement.scrollWidth - 2*paddingLeft
|
|
298
|
-
const thresholdDeltaX = width*(step)/(internalMax-internalMin)
|
|
299
|
-
|
|
300
|
-
const relativeMousePositionX = (pageX - leftEdge)/thresholdDeltaX < 0 ? 0 : (pageX - leftEdge)/thresholdDeltaX
|
|
301
|
-
const nearestStep = Math.round((pageX - leftEdge)/thresholdDeltaX)
|
|
302
|
-
return { relativeMousePositionX, nearestStep }
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const onPointerDownTrack = (event: React.PointerEvent) => {
|
|
306
|
-
if(!internalRef.current) return
|
|
307
|
-
const { nearestStep } = getNearestStep(event, internalRef.current)
|
|
308
|
-
updateValue(nearestStep*step)
|
|
309
|
-
}
|
|
310
|
-
const onPointerDown = (event: React.PointerEvent) => {
|
|
311
|
-
(event.target as HTMLElement).setPointerCapture(event.pointerId)
|
|
312
|
-
setIsGrabbing(true)
|
|
313
|
-
if(!thumbRef.current) return
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const onPointerMove = (event: React.PointerEvent) => {
|
|
318
|
-
if(!isGrabbing) return
|
|
319
|
-
if(!internalRef.current) return
|
|
320
|
-
const { relativeMousePositionX, nearestStep } = getNearestStep(event, internalRef.current)
|
|
321
|
-
//console.log(nearestStep)
|
|
322
|
-
const lowerBoundary = nearestStep === 0 || relativeMousePositionX === 0? -0.05 : 0.95*nearestStep
|
|
323
|
-
const upperBoundary = nearestStep === 0 || relativeMousePositionX === 0? 0.05 : 1.05*nearestStep
|
|
324
|
-
if(lowerBoundary < relativeMousePositionX && relativeMousePositionX < upperBoundary) {
|
|
325
|
-
updateValue(nearestStep*step)
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
const onPointerUp = (event: React.PointerEvent) => {
|
|
331
|
-
setIsGrabbing(false)
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
const onKeyDown = (event: React.KeyboardEvent) => {
|
|
335
|
-
let caseTrue = false
|
|
336
|
-
switch (event.key) {
|
|
337
|
-
case "ArrowLeft":
|
|
338
|
-
case "ArrowDown":
|
|
339
|
-
updateValue(internalValue - 1)
|
|
340
|
-
event.preventDefault()
|
|
341
|
-
break
|
|
342
|
-
case "ArrowRight":
|
|
343
|
-
case "ArrowUp":
|
|
344
|
-
updateValue(internalValue + 1)
|
|
345
|
-
event.preventDefault()
|
|
346
|
-
break
|
|
347
|
-
case "End":
|
|
348
|
-
updateValue(internalMax - 1)
|
|
349
|
-
event.preventDefault()
|
|
350
|
-
break
|
|
351
|
-
case "Home":
|
|
352
|
-
updateValue(internalMin - 1)
|
|
353
|
-
event.preventDefault()
|
|
354
|
-
break
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
const filled = (internalValue)/(internalMax-internalMin)
|
|
358
|
-
const pointerActions = {onPointerDown, onPointerMove, onPointerUp}
|
|
359
|
-
return (
|
|
360
|
-
<div onPointerDown={onPointerDownTrack} ref={mergeRefs([ref, internalRef])} id={controlId} style={{...style, "--filled":filled*100+"%"} as React.CSSProperties} className={useClassname("sg-form-slider", className)}>
|
|
361
|
-
<span ref={trackFilled} className="sg-form-slider-filled" id={controlId+"-track-filled"}></span>
|
|
362
|
-
<span
|
|
363
|
-
role="slider" tabIndex={0} ref={thumbRef} data-grabbing={isGrabbing} id={controlId+"-track-thumb"}
|
|
364
|
-
{...pointerActions} onKeyDown={onKeyDown} className="sg-form-slider-thumb"
|
|
365
|
-
aria-valuenow={internalValue + min} aria-valuemax={max} aria-valuemin={min} {...restProps}
|
|
366
|
-
></span>
|
|
367
|
-
<span ref={trackEmpty} className="sg-form-slider-empty" id={controlId+"-track-empty"}></span>
|
|
368
|
-
</div>
|
|
369
|
-
)
|
|
370
|
-
})
|
|
371
|
-
Slider.displayName = "FormSlider"
|
|
372
|
-
|
|
373
|
-
const SelectTag = forwardRef<HTMLSelectElement, FormSelectTagType>( ({children, className, id, required,...restProps}, ref) => {
|
|
374
|
-
const { noValidate } = useFormTagContext()
|
|
375
|
-
const { controlId } = useFormContext()
|
|
376
|
-
const elementId = id ?? controlId
|
|
377
|
-
const classNameComputed = mergeClassnames("sg-form-select-tag", className ?? "")
|
|
378
|
-
return (
|
|
379
|
-
<select ref={ref} required={(required && !noValidate) ?? undefined} aria-required={required ?? undefined} className={classNameComputed} id={elementId} {...restProps}>
|
|
380
|
-
{children}
|
|
381
|
-
</select>
|
|
382
|
-
)
|
|
383
|
-
})
|
|
384
|
-
SelectTag.displayName = "FormSelectTag"
|
|
385
|
-
|
|
386
|
-
export default Object.assign(Form, {
|
|
387
|
-
Control: Control,
|
|
388
|
-
Select: Select,
|
|
389
|
-
SelectTag: SelectTag,
|
|
390
|
-
Group: Group,
|
|
391
|
-
Label: Label,
|
|
392
|
-
Check: Check,
|
|
393
|
-
Text: Text,
|
|
394
|
-
Slider: Slider,
|
|
395
|
-
WarningIcon: WarningIcon,
|
|
396
|
-
Hint: HintMessage,
|
|
397
|
-
Error: ErrorMessage
|
|
398
|
-
})
|
package/src/Form/Form.types.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { ReactNode, Dispatch, Children, ReactElement } from "react";
|
|
2
|
-
|
|
3
|
-
import { BaseElementType, BaseElementType2, BaseParagraphType, BaseDivType, BaseFormType, BaseInputType, BaseLabelType, BaseLItemType, BaseSelectType, BaseSpanType, BaseSliderType, BaseSmallType, BaseUListType, BaseSVGType, BaseButtonType } from "../utils/BaseTypes";
|
|
4
|
-
|
|
5
|
-
export type FormTagContextType = {
|
|
6
|
-
noValidate: boolean
|
|
7
|
-
}
|
|
8
|
-
export type FormContextType = {
|
|
9
|
-
controlId?: string,
|
|
10
|
-
isInputGroup?: boolean,
|
|
11
|
-
isFLoatingLabel?: boolean,
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type FormType = {
|
|
15
|
-
children: ReactNode
|
|
16
|
-
} & BaseFormType
|
|
17
|
-
|
|
18
|
-
type ErrorMessageType = {
|
|
19
|
-
message: string,
|
|
20
|
-
type?: string,
|
|
21
|
-
className?: string,
|
|
22
|
-
style?: React.CSSProperties,
|
|
23
|
-
} & BaseParagraphType
|
|
24
|
-
type HintMessageType = {
|
|
25
|
-
message: string,
|
|
26
|
-
custom?: boolean,
|
|
27
|
-
className?: string,
|
|
28
|
-
style?: React.CSSProperties,
|
|
29
|
-
} & BaseParagraphType
|
|
30
|
-
export type ErrorType = {children?: ReactNode} & ErrorMessageType
|
|
31
|
-
export type HintType = {children?: ReactNode} & HintMessageType
|
|
32
|
-
export type FormControlType = {
|
|
33
|
-
as?: React.ElementType,
|
|
34
|
-
className?: string,
|
|
35
|
-
plaintext?: boolean,
|
|
36
|
-
id?: string,
|
|
37
|
-
type?: string,
|
|
38
|
-
autoFocus?: boolean,
|
|
39
|
-
error?: ErrorMessageType,
|
|
40
|
-
errorAsOverlay?: boolean
|
|
41
|
-
hint?: HintMessageType
|
|
42
|
-
} & BaseInputType
|
|
43
|
-
|
|
44
|
-
// Form Select types
|
|
45
|
-
export type SelectContextType = {
|
|
46
|
-
internalId?:string,
|
|
47
|
-
showList: boolean,
|
|
48
|
-
setShowList: Dispatch<React.SetStateAction<boolean>>,
|
|
49
|
-
activeDescendant: any,
|
|
50
|
-
setActiveDescendant: Dispatch<React.SetStateAction<any>>,
|
|
51
|
-
inputValue: string,
|
|
52
|
-
setInputValue: Dispatch<React.SetStateAction<string>>,
|
|
53
|
-
selectedDescendant: any
|
|
54
|
-
setSelectedDescendant: Dispatch<React.SetStateAction<any>>,
|
|
55
|
-
children: ReactNode
|
|
56
|
-
}
|
|
57
|
-
export type FormSelectTagType = {
|
|
58
|
-
children: ReactNode,
|
|
59
|
-
className?: string,
|
|
60
|
-
id?: string,
|
|
61
|
-
required?: boolean,
|
|
62
|
-
value?: any,
|
|
63
|
-
error?: ErrorMessageType,
|
|
64
|
-
errorAsOverlay?: boolean
|
|
65
|
-
hint?: HintMessageType
|
|
66
|
-
} & BaseSelectType
|
|
67
|
-
|
|
68
|
-
export type FormSelectType = {
|
|
69
|
-
children: ReactNode,
|
|
70
|
-
className?: string,
|
|
71
|
-
id?: string,
|
|
72
|
-
required?: boolean,
|
|
73
|
-
value?: any,
|
|
74
|
-
error?: ErrorMessageType,
|
|
75
|
-
errorAsOverlay?: boolean
|
|
76
|
-
hint?: HintMessageType,
|
|
77
|
-
loading?: boolean
|
|
78
|
-
} & FormSelectControlType
|
|
79
|
-
export type FormSelectControlType = {
|
|
80
|
-
children?: ReactNode,
|
|
81
|
-
required?: boolean,
|
|
82
|
-
className?: string,
|
|
83
|
-
placeholder?: string,
|
|
84
|
-
searchable?: boolean,
|
|
85
|
-
value: any,
|
|
86
|
-
label: ReactNode
|
|
87
|
-
} & BaseButtonType
|
|
88
|
-
|
|
89
|
-
export type FormSelectInputType = {
|
|
90
|
-
className?: string,
|
|
91
|
-
id?: string
|
|
92
|
-
} & BaseInputType
|
|
93
|
-
export type FormSelectListType = {
|
|
94
|
-
children: ReactNode,
|
|
95
|
-
className?: string,
|
|
96
|
-
id?: string
|
|
97
|
-
} & BaseUListType
|
|
98
|
-
export type FormSelectOptionType = {
|
|
99
|
-
children?: ReactNode,
|
|
100
|
-
className?: string,
|
|
101
|
-
value: string,
|
|
102
|
-
disabled?: boolean,
|
|
103
|
-
label?: string,
|
|
104
|
-
selected?: boolean,
|
|
105
|
-
type?: string
|
|
106
|
-
} & BaseLItemType & BaseElementType
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export type FormGroupType = {
|
|
110
|
-
children: ReactNode,
|
|
111
|
-
className?: string,
|
|
112
|
-
controlId: string,
|
|
113
|
-
vertical?: boolean
|
|
114
|
-
} & BaseDivType
|
|
115
|
-
|
|
116
|
-
export type FormLabelType = {
|
|
117
|
-
children: ReactNode,
|
|
118
|
-
className?: string,
|
|
119
|
-
htmlFor?: string
|
|
120
|
-
} & BaseLabelType
|
|
121
|
-
|
|
122
|
-
export type FormCheckType = {
|
|
123
|
-
children?: ReactNode,
|
|
124
|
-
style?: React.CSSProperties,
|
|
125
|
-
classNameContainer?:string,
|
|
126
|
-
containerRef?:React.LegacyRef<HTMLDivElement>,
|
|
127
|
-
containerId?: string,
|
|
128
|
-
styleContainer?: React.CSSProperties,
|
|
129
|
-
classNameLabel?: string,
|
|
130
|
-
labelRef?: React.LegacyRef<HTMLLabelElement>,
|
|
131
|
-
label?: string,
|
|
132
|
-
labelId?: string,
|
|
133
|
-
styleLabel?: React.CSSProperties,
|
|
134
|
-
className?: string,
|
|
135
|
-
type?: string,
|
|
136
|
-
controlId?: string,
|
|
137
|
-
reverse?: boolean,
|
|
138
|
-
} & BaseInputType
|
|
139
|
-
|
|
140
|
-
export type FormTextType = {
|
|
141
|
-
children: ReactNode,
|
|
142
|
-
className?: string,
|
|
143
|
-
} & BaseSmallType
|
|
144
|
-
|
|
145
|
-
export type FormSliderType = {
|
|
146
|
-
children?: ReactNode,
|
|
147
|
-
className?: string,
|
|
148
|
-
style?: React.CSSProperties,
|
|
149
|
-
controlId: string,
|
|
150
|
-
min?: number,
|
|
151
|
-
max?: number,
|
|
152
|
-
step?: number,
|
|
153
|
-
defaultValue?: number,
|
|
154
|
-
value: number,
|
|
155
|
-
onChange(value :number): () => any
|
|
156
|
-
} & BaseSpanType // BaseSliderType
|
|
157
|
-
export type SliderContextType = {
|
|
158
|
-
children: ReactNode,
|
|
159
|
-
controlId: string,
|
|
160
|
-
min?: number,
|
|
161
|
-
max?: number,
|
|
162
|
-
step?: number
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export type WarningIconType = {
|
|
166
|
-
alt?: string,
|
|
167
|
-
size?: string | number,
|
|
168
|
-
color?: string
|
|
169
|
-
} & BaseSVGType
|