react-science 0.28.1 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib-esm/app/hooks/file-loading.d.ts +2 -1
- package/lib-esm/app/hooks/file-loading.d.ts.map +1 -1
- package/lib-esm/app/hooks/file-loading.js.map +1 -1
- package/lib-esm/app/panels/SignalProcessingPanel.d.ts.map +1 -1
- package/lib-esm/app/panels/SignalProcessingPanel.js +3 -3
- package/lib-esm/app/panels/SignalProcessingPanel.js.map +1 -1
- package/lib-esm/components/button/Button.d.ts +8 -14
- package/lib-esm/components/button/Button.d.ts.map +1 -1
- package/lib-esm/components/button/Button.js +7 -31
- package/lib-esm/components/button/Button.js.map +1 -1
- package/lib-esm/components/drop-zone/DropZone.d.ts +6 -2
- package/lib-esm/components/drop-zone/DropZone.d.ts.map +1 -1
- package/lib-esm/components/drop-zone/DropZone.js +9 -15
- package/lib-esm/components/drop-zone/DropZone.js.map +1 -1
- package/lib-esm/components/forms/index.d.ts +0 -5
- package/lib-esm/components/forms/index.d.ts.map +1 -1
- package/lib-esm/components/forms/index.js +0 -5
- package/lib-esm/components/forms/index.js.map +1 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts +1 -0
- package/lib-esm/components/forms/radio-group/RadioGroup.d.ts.map +1 -1
- package/lib-esm/components/forms/radio-group/RadioGroup.js +2 -2
- package/lib-esm/components/forms/radio-group/RadioGroup.js.map +1 -1
- package/lib-esm/components/forms/styles.d.ts +0 -22
- package/lib-esm/components/forms/styles.d.ts.map +1 -1
- package/lib-esm/components/forms/styles.js +0 -72
- package/lib-esm/components/forms/styles.js.map +1 -1
- package/lib-esm/components/header/PanelHeader.d.ts.map +1 -1
- package/lib-esm/components/header/PanelHeader.js +1 -2
- package/lib-esm/components/header/PanelHeader.js.map +1 -1
- package/lib-esm/components/index.d.ts +0 -2
- package/lib-esm/components/index.d.ts.map +1 -1
- package/lib-esm/components/index.js +0 -2
- package/lib-esm/components/index.js.map +1 -1
- package/lib-esm/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib-esm/components/info-panel/InfoPanel.js +5 -4
- package/lib-esm/components/info-panel/InfoPanel.js.map +1 -1
- package/lib-esm/components/modal/ConfirmModal.d.ts.map +1 -1
- package/lib-esm/components/modal/ConfirmModal.js +1 -7
- package/lib-esm/components/modal/ConfirmModal.js.map +1 -1
- package/lib-esm/components/modal/Modal.d.ts.map +1 -1
- package/lib-esm/components/modal/Modal.js +2 -2
- package/lib-esm/components/modal/Modal.js.map +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js +1 -2
- package/lib-esm/components/toolbar/PanelPreferencesToolbar.js.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib-esm/components/toolbar/Toolbar.js +16 -12
- package/lib-esm/components/toolbar/Toolbar.js.map +1 -1
- package/package.json +25 -23
- package/src/app/hooks/file-loading.ts +4 -2
- package/src/app/panels/SignalProcessingPanel.tsx +3 -6
- package/src/components/button/Button.tsx +29 -59
- package/src/components/drop-zone/DropZone.tsx +42 -25
- package/src/components/forms/index.ts +0 -5
- package/src/components/forms/radio-group/RadioGroup.tsx +3 -0
- package/src/components/forms/styles.ts +0 -92
- package/src/components/header/PanelHeader.tsx +1 -8
- package/src/components/index.ts +0 -2
- package/src/components/info-panel/InfoPanel.tsx +6 -3
- package/src/components/modal/ConfirmModal.tsx +2 -16
- package/src/components/modal/Modal.tsx +10 -2
- package/src/components/toolbar/PanelPreferencesToolbar.tsx +2 -15
- package/src/components/toolbar/Toolbar.tsx +25 -29
- package/lib-esm/components/dropdown-menu/DropdownMenu.d.ts +0 -28
- package/lib-esm/components/dropdown-menu/DropdownMenu.d.ts.map +0 -1
- package/lib-esm/components/dropdown-menu/DropdownMenu.js +0 -41
- package/lib-esm/components/dropdown-menu/DropdownMenu.js.map +0 -1
- package/lib-esm/components/dropdown-menu/MenuItems.d.ts +0 -19
- package/lib-esm/components/dropdown-menu/MenuItems.d.ts.map +0 -1
- package/lib-esm/components/dropdown-menu/MenuItems.js +0 -77
- package/lib-esm/components/dropdown-menu/MenuItems.js.map +0 -1
- package/lib-esm/components/dropdown-menu/index.d.ts +0 -3
- package/lib-esm/components/dropdown-menu/index.d.ts.map +0 -1
- package/lib-esm/components/dropdown-menu/index.js +0 -2
- package/lib-esm/components/dropdown-menu/index.js.map +0 -1
- package/lib-esm/components/dropdown-menu/useContextMenuPlacement.d.ts +0 -18
- package/lib-esm/components/dropdown-menu/useContextMenuPlacement.d.ts.map +0 -1
- package/lib-esm/components/dropdown-menu/useContextMenuPlacement.js +0 -49
- package/lib-esm/components/dropdown-menu/useContextMenuPlacement.js.map +0 -1
- package/lib-esm/components/forms/Checkbox.d.ts +0 -11
- package/lib-esm/components/forms/Checkbox.d.ts.map +0 -1
- package/lib-esm/components/forms/Checkbox.js +0 -35
- package/lib-esm/components/forms/Checkbox.js.map +0 -1
- package/lib-esm/components/forms/Input.d.ts +0 -19
- package/lib-esm/components/forms/Input.d.ts.map +0 -1
- package/lib-esm/components/forms/Input.js +0 -60
- package/lib-esm/components/forms/Input.js.map +0 -1
- package/lib-esm/components/forms/Select.d.ts +0 -21
- package/lib-esm/components/forms/Select.d.ts.map +0 -1
- package/lib-esm/components/forms/Select.js +0 -90
- package/lib-esm/components/forms/Select.js.map +0 -1
- package/lib-esm/components/forms/TextArea.d.ts +0 -8
- package/lib-esm/components/forms/TextArea.d.ts.map +0 -1
- package/lib-esm/components/forms/TextArea.js +0 -19
- package/lib-esm/components/forms/TextArea.js.map +0 -1
- package/lib-esm/components/forms/context/FieldsContext.d.ts +0 -16
- package/lib-esm/components/forms/context/FieldsContext.d.ts.map +0 -1
- package/lib-esm/components/forms/context/FieldsContext.js +0 -47
- package/lib-esm/components/forms/context/FieldsContext.js.map +0 -1
- package/lib-esm/components/forms/context/index.d.ts +0 -2
- package/lib-esm/components/forms/context/index.d.ts.map +0 -1
- package/lib-esm/components/forms/context/index.js +0 -2
- package/lib-esm/components/forms/context/index.js.map +0 -1
- package/lib-esm/components/modal/ModalCloseButton.d.ts +0 -4
- package/lib-esm/components/modal/ModalCloseButton.d.ts.map +0 -1
- package/lib-esm/components/modal/ModalCloseButton.js +0 -11
- package/lib-esm/components/modal/ModalCloseButton.js.map +0 -1
- package/lib-esm/components/spinner/FullSpinner.d.ts +0 -7
- package/lib-esm/components/spinner/FullSpinner.d.ts.map +0 -1
- package/lib-esm/components/spinner/FullSpinner.js +0 -24
- package/lib-esm/components/spinner/FullSpinner.js.map +0 -1
- package/lib-esm/components/spinner/index.d.ts +0 -2
- package/lib-esm/components/spinner/index.d.ts.map +0 -1
- package/lib-esm/components/spinner/index.js +0 -2
- package/lib-esm/components/spinner/index.js.map +0 -1
- package/src/components/dropdown-menu/DropdownMenu.tsx +0 -160
- package/src/components/dropdown-menu/MenuItems.tsx +0 -146
- package/src/components/dropdown-menu/index.ts +0 -2
- package/src/components/dropdown-menu/useContextMenuPlacement.ts +0 -76
- package/src/components/forms/Checkbox.tsx +0 -77
- package/src/components/forms/Input.tsx +0 -144
- package/src/components/forms/Select.tsx +0 -197
- package/src/components/forms/TextArea.tsx +0 -45
- package/src/components/forms/context/FieldsContext.tsx +0 -82
- package/src/components/forms/context/index.ts +0 -1
- package/src/components/modal/ModalCloseButton.tsx +0 -21
- package/src/components/spinner/FullSpinner.tsx +0 -57
- package/src/components/spinner/index.ts +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
5
|
-
import { RxCheck, RxMinus } from 'react-icons/rx/index';
|
|
6
|
-
import { disabledColor, enabledColor } from './styles';
|
|
7
|
-
export function Checkbox(props) {
|
|
8
|
-
const { checked = 'indeterminate', disabled = false, label, onChange, } = props;
|
|
9
|
-
return (_jsxs("label", { style: {
|
|
10
|
-
display: 'flex',
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
fontSize: '1.125em',
|
|
13
|
-
}, children: [_jsx(RadixCheckbox.Root, { checked: checked, onCheckedChange: onChange, disabled: disabled, css: css({
|
|
14
|
-
width: '16px',
|
|
15
|
-
height: '16px',
|
|
16
|
-
backgroundColor: disabled
|
|
17
|
-
? 'rgba(0, 0, 0, 0.04)'
|
|
18
|
-
: checked
|
|
19
|
-
? enabledColor
|
|
20
|
-
: 'white',
|
|
21
|
-
borderWidth: '1px',
|
|
22
|
-
borderColor: checked && !disabled ? enabledColor : disabledColor,
|
|
23
|
-
borderRadius: '4px',
|
|
24
|
-
display: 'flex',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
28
|
-
}), children: _jsx(RadixCheckbox.Indicator, { css: css({
|
|
29
|
-
color: disabled ? disabledColor : 'white',
|
|
30
|
-
}), children: checked === true ? (_jsx(RxCheck, {})) : checked === 'indeterminate' ? (_jsx(RxMinus, {})) : null }) }), _jsx("span", { style: {
|
|
31
|
-
paddingInline: '8px',
|
|
32
|
-
lineHeight: '16px',
|
|
33
|
-
}, children: label })] }));
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/forms/Checkbox.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CA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KAAK,EAAE;oBACL,aAAa,EAAE,KAAK;oBACpB,UAAU,EAAE,MAAM;iBACnB,YAEA,KAAK,GACD,IACD,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { InputVariant } from './styles';
|
|
3
|
-
import { SubTextProps } from './utils';
|
|
4
|
-
interface RenderAddon {
|
|
5
|
-
addon: ReactNode;
|
|
6
|
-
inline?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface InputProps extends InputHTMLAttributes<HTMLInputElement>, SubTextProps {
|
|
9
|
-
variant?: InputVariant;
|
|
10
|
-
leadingAddon?: RenderAddon;
|
|
11
|
-
trailingAddon?: RenderAddon;
|
|
12
|
-
help?: string;
|
|
13
|
-
error?: string;
|
|
14
|
-
valid?: true | string;
|
|
15
|
-
loading?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export declare function Input(props: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
19
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvD,OAAO,EAIL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAW,YAAY,EAAE,MAAM,SAAS,CAAC;AAoDhD,UAAU,WAAW;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UACf,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,YAAY;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CA8DtC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import { FullSpinner } from '../index';
|
|
4
|
-
import { useFieldsContext } from './context/FieldsContext';
|
|
5
|
-
import { InputContainer, GroupStyled, LabelStyled, } from './styles';
|
|
6
|
-
import { SubText } from './utils';
|
|
7
|
-
const InputStyled = styled.input `
|
|
8
|
-
padding: 0;
|
|
9
|
-
flex: 1 1 0%;
|
|
10
|
-
border: none;
|
|
11
|
-
position: relative;
|
|
12
|
-
outline: none;
|
|
13
|
-
`;
|
|
14
|
-
const LeadingAddonStyled = styled.div `
|
|
15
|
-
padding-left: 0.75rem;
|
|
16
|
-
padding-right: 0.75rem;
|
|
17
|
-
border-right-width: 0px;
|
|
18
|
-
border-width: 1px;
|
|
19
|
-
border-top-left-radius: 0.375rem;
|
|
20
|
-
border-bottom-left-radius: 0.375rem;
|
|
21
|
-
align-items: center;
|
|
22
|
-
display: inline-flex;
|
|
23
|
-
|
|
24
|
-
border-right: none;
|
|
25
|
-
|
|
26
|
-
border-color: var(--custom-border-color);
|
|
27
|
-
`;
|
|
28
|
-
const TrailingAddonStyled = styled.div `
|
|
29
|
-
padding-left: 0.75rem;
|
|
30
|
-
padding-right: 0.75rem;
|
|
31
|
-
border-left-width: 0px;
|
|
32
|
-
border-width: 1px;
|
|
33
|
-
border-top-right-radius: 0.375rem;
|
|
34
|
-
border-bottom-right-radius: 0.375rem;
|
|
35
|
-
align-items: center;
|
|
36
|
-
display: inline-flex;
|
|
37
|
-
|
|
38
|
-
border-left: none;
|
|
39
|
-
|
|
40
|
-
border-color: var(--custom-border-color);
|
|
41
|
-
`;
|
|
42
|
-
const LeadingInlineAddonStyled = styled.div `
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
padding-right: 0.5rem;
|
|
46
|
-
`;
|
|
47
|
-
const TrailingInlineAddonStyled = styled.div `
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
padding-left: 0.5rem;
|
|
51
|
-
`;
|
|
52
|
-
export function Input(props) {
|
|
53
|
-
const { variant: variantProps, trailingAddon, leadingAddon, help, error, valid, loading, ...otherProps } = props;
|
|
54
|
-
const { name, variant: contextVariant } = useFieldsContext();
|
|
55
|
-
const hasLeading = (leadingAddon && !leadingAddon.inline) || false;
|
|
56
|
-
const hasTrailing = (trailingAddon && !trailingAddon.inline) || false;
|
|
57
|
-
const variant = variantProps || contextVariant;
|
|
58
|
-
return (_jsxs(InputContainer, { children: [_jsxs(GroupStyled, { hasError: !!error, hasValid: !!valid, children: [leadingAddon && !leadingAddon.inline && (_jsx(LeadingAddonStyled, { children: leadingAddon.addon })), _jsxs(LabelStyled, { variant: variant, hasLeading: hasLeading, hasTrailing: hasTrailing, children: [leadingAddon?.inline && (_jsx(LeadingInlineAddonStyled, { className: "addon", children: leadingAddon.addon })), _jsx(InputStyled, { id: name, name: name, ...otherProps }), trailingAddon?.inline && (_jsx(TrailingInlineAddonStyled, { className: "addon", children: trailingAddon.addon })), loading && (_jsx(TrailingInlineAddonStyled, { style: { height: variant === 'default' ? 20 : 10 }, children: _jsx(FullSpinner, { height: variant === 'default' ? 20 : 10, width: variant === 'default' ? 20 : 10 }) }))] }), trailingAddon && !trailingAddon.inline && (_jsx(TrailingAddonStyled, { children: trailingAddon.addon }))] }), _jsx(SubText, { error: error, help: help, valid: valid })] }));
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":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ReactNode;
|
|
4
|
-
options: Option[];
|
|
5
|
-
}
|
|
6
|
-
interface Option {
|
|
7
|
-
label: ReactNode;
|
|
8
|
-
value: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface SelectProps {
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
value: string | undefined;
|
|
14
|
-
onSelect?: (value: string | undefined) => void;
|
|
15
|
-
options: Array<Option[] | Category[]>;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
style?: CSSProperties;
|
|
18
|
-
}
|
|
19
|
-
export declare function Select(props: SelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/forms/Select.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAY,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3D,UAAU,QAAQ;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AACD,UAAU,MAAM;IACd,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC/C,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAkFD,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,oDAwFxC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import styled from '@emotion/styled';
|
|
4
|
-
import * as RadixSelect from '@radix-ui/react-select';
|
|
5
|
-
import { SelectGroup } from '@radix-ui/react-select';
|
|
6
|
-
import { Fragment } from 'react';
|
|
7
|
-
import { FaCheck, FaChevronDown, FaChevronUp } from 'react-icons/fa';
|
|
8
|
-
import { Portal } from '../root-layout/Portal';
|
|
9
|
-
const SelectRoot = styled.div `
|
|
10
|
-
display: inline-flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: space-between;
|
|
13
|
-
background-color: #ffffff;
|
|
14
|
-
font-size: 1.125em;
|
|
15
|
-
width: 120px;
|
|
16
|
-
`;
|
|
17
|
-
const SelectTrigger = styled(RadixSelect.Trigger) `
|
|
18
|
-
width: 100%;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
border-radius: 4px;
|
|
23
|
-
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
24
|
-
padding: 4px 11px;
|
|
25
|
-
user-select: none;
|
|
26
|
-
font-size: 1.125em;
|
|
27
|
-
line-height: 1.125em;
|
|
28
|
-
|
|
29
|
-
&[data-disabled] {
|
|
30
|
-
color: rgba(0, 0, 0, 0.5);
|
|
31
|
-
background-color: #f5f5f5;
|
|
32
|
-
}
|
|
33
|
-
`;
|
|
34
|
-
const SelectContent = styled(RadixSelect.Content) `
|
|
35
|
-
width: var(--radix-select-trigger-width);
|
|
36
|
-
max-height: var(--radix-select-content-available-height);
|
|
37
|
-
`;
|
|
38
|
-
const SelectViewport = styled(RadixSelect.Viewport) `
|
|
39
|
-
width: var(--radix-select-trigger-width);
|
|
40
|
-
border-radius: 4px;
|
|
41
|
-
box-sizing: border-box;
|
|
42
|
-
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
43
|
-
background-color: white;
|
|
44
|
-
padding: 5px;
|
|
45
|
-
`;
|
|
46
|
-
const SelectItem = styled(RadixSelect.Item) `
|
|
47
|
-
user-select: none;
|
|
48
|
-
font-size: 1.125em;
|
|
49
|
-
padding: 4px 11px;
|
|
50
|
-
width: 100%;
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
justify-content: space-between;
|
|
54
|
-
|
|
55
|
-
&:hover {
|
|
56
|
-
background-color: #e6f4ff;
|
|
57
|
-
}
|
|
58
|
-
&[data-disabled] {
|
|
59
|
-
color: rgba(0, 0, 0, 0.5);
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
const SelectLabel = styled(RadixSelect.Label) `
|
|
63
|
-
color: rgba(0, 0, 0, 0.5);
|
|
64
|
-
font-size: 1em;
|
|
65
|
-
padding: 4px 11px;
|
|
66
|
-
margin-top: 8px;
|
|
67
|
-
`;
|
|
68
|
-
const SelectItemIndicator = styled(RadixSelect.ItemIndicator) `
|
|
69
|
-
right: 0;
|
|
70
|
-
width: 25px;
|
|
71
|
-
display: inline-flex;
|
|
72
|
-
align-items: center;
|
|
73
|
-
justify-content: center;
|
|
74
|
-
`;
|
|
75
|
-
const SelectSeparator = styled(RadixSelect.Separator) `
|
|
76
|
-
height: 1px;
|
|
77
|
-
width: 100%;
|
|
78
|
-
background-color: rgba(0, 0, 0, 0.15);
|
|
79
|
-
margin: 5px 0;
|
|
80
|
-
`;
|
|
81
|
-
export function Select(props) {
|
|
82
|
-
const { placeholder, value, onSelect, options, disabled = false, style, } = props;
|
|
83
|
-
const selectedLabel = options
|
|
84
|
-
.flatMap((group) => group.flatMap((optionOrCategory) => 'options' in optionOrCategory
|
|
85
|
-
? optionOrCategory.options
|
|
86
|
-
: [optionOrCategory]))
|
|
87
|
-
.find((option) => option.value === value)?.label;
|
|
88
|
-
return (_jsx(SelectRoot, { style: { ...style }, children: _jsxs(RadixSelect.Root, { value: value, onValueChange: onSelect, disabled: disabled, children: [_jsxs(SelectTrigger, { children: [_jsx(RadixSelect.Value, { children: _jsxs("span", { children: [selectedLabel || placeholder, "\u00A0"] }) }), _jsx(RadixSelect.Icon, { asChild: true, children: _jsx(FaChevronDown, {}) })] }), _jsx(Portal, { children: _jsxs(SelectContent, { position: "popper", children: [_jsx(RadixSelect.ScrollUpButton, { children: _jsx(FaChevronUp, {}) }), _jsx(SelectViewport, { children: options.map((group, groupIndex) => (_jsxs(Fragment, { children: [group.map((optionOrCategory, optionOrCategoryIndex) => 'options' in optionOrCategory ? (_jsxs(SelectGroup, { children: [_jsx(SelectLabel, { children: optionOrCategory.label }), optionOrCategory.options.map((option) => (_jsxs(SelectItem, { value: option.value, disabled: option.disabled, children: [_jsx(RadixSelect.ItemText, { children: option.label }), _jsx(SelectItemIndicator, { children: _jsx(FaCheck, {}) })] }, option.value)))] }, optionOrCategoryIndex)) : (_jsxs(SelectItem, { value: optionOrCategory.value, disabled: optionOrCategory.disabled, children: [_jsx(RadixSelect.ItemText, { children: optionOrCategory.label }), _jsx(SelectItemIndicator, { children: _jsx(FaCheck, {}) })] }, optionOrCategory.value))), groupIndex < options.length - 1 && _jsx(SelectSeparator, {})] }, groupIndex))) }), _jsx(RadixSelect.ScrollDownButton, {}), _jsx(RadixSelect.Arrow, {})] }) })] }) }));
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/components/forms/Select.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAA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CAAC,QAAQ,aAEnC,KAAC,WAAW,CAAC,QAAQ,cAClB,gBAAgB,CAAC,KAAK,GACF,EACvB,KAAC,mBAAmB,cAClB,KAAC,OAAO,KAAG,GACS,KATjB,gBAAgB,CAAC,KAAK,CAUhB,CACd,CACF,EACA,UAAU,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,eAAe,KAAG,KAnC1C,UAAU,CAoCd,CACZ,CAAC,GACa,EACjB,KAAC,WAAW,CAAC,gBAAgB,KAAG,EAChC,KAAC,WAAW,CAAC,KAAK,KAAG,IACP,GACT,IACQ,GACR,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
-
import { InputVariant } from './styles';
|
|
3
|
-
import { SubTextProps } from './utils';
|
|
4
|
-
export interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, SubTextProps {
|
|
5
|
-
variant?: InputVariant;
|
|
6
|
-
}
|
|
7
|
-
export declare function TextArea(props: TextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=TextArea.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../src/components/forms/TextArea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,EAIL,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAW,YAAY,EAAE,MAAM,SAAS,CAAC;AAUhD,MAAM,WAAW,aACf,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC,EACjD,YAAY;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAkB5C"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import { useFieldsContext } from './context/FieldsContext';
|
|
4
|
-
import { InputContainer, GroupStyled, LabelStyled, } from './styles';
|
|
5
|
-
import { SubText } from './utils';
|
|
6
|
-
const TextAreaStyled = styled.textarea `
|
|
7
|
-
padding: 0;
|
|
8
|
-
flex: 1 1 0%;
|
|
9
|
-
border: none;
|
|
10
|
-
position: relative;
|
|
11
|
-
outline: none;
|
|
12
|
-
`;
|
|
13
|
-
export function TextArea(props) {
|
|
14
|
-
const { variant: variantProps, help, error, valid, ...otherProps } = props;
|
|
15
|
-
const { name, variant: contextVariant } = useFieldsContext();
|
|
16
|
-
const variant = variantProps || contextVariant;
|
|
17
|
-
return (_jsxs(InputContainer, { children: [_jsx(GroupStyled, { hasError: !!error, hasValid: !!valid, children: _jsx(LabelStyled, { variant: variant, children: _jsx(TextAreaStyled, { id: name, name: name, ...otherProps }) }) }), _jsx(SubText, { error: error, help: help, valid: valid })] }));
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=TextArea.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/components/forms/TextArea.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,GAEZ,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAEhD,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAA;;;;;;CAMrC,CAAC;AAQF,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAE3E,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAE7D,MAAM,OAAO,GAAG,YAAY,IAAI,cAAc,CAAC;IAE/C,OAAO,CACL,MAAC,cAAc,eACb,KAAC,WAAW,IAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,KAAK,YAC/C,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,YAC3B,KAAC,cAAc,IAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAM,UAAU,GAAI,GAC5C,GACF,EAEd,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAI,IACpC,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
interface FieldContext {
|
|
3
|
-
name?: string;
|
|
4
|
-
variant: 'default' | 'small';
|
|
5
|
-
}
|
|
6
|
-
interface FieldProps {
|
|
7
|
-
name: string;
|
|
8
|
-
label: string;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
variant?: 'default' | 'small';
|
|
11
|
-
required?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function useFieldsContext(): FieldContext;
|
|
14
|
-
export declare function Field(props: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=FieldsContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldsContext.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/context/FieldsContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAEtE,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC;CAC9B;AAED,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAoCD,wBAAgB,gBAAgB,IAAI,YAAY,CAQ/C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,2CAqBtC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from '@emotion/styled';
|
|
3
|
-
import { createContext, useContext, useMemo } from 'react';
|
|
4
|
-
const context = createContext(null);
|
|
5
|
-
const FieldContextRoot = styled.div `
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-flow: row;
|
|
8
|
-
min-width: 0;
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
gap: 5px;
|
|
12
|
-
`;
|
|
13
|
-
const Label = styled.label `
|
|
14
|
-
position: relative;
|
|
15
|
-
display: inline-flex;
|
|
16
|
-
max-width: 100%;
|
|
17
|
-
line-height: ${(props) => (props.variant === 'small' ? '28px' : '32px')};
|
|
18
|
-
font-size: ${(props) => (props.variant === 'small' ? '1em' : '1.125em')};
|
|
19
|
-
white-space: nowrap;
|
|
20
|
-
text-align: end;
|
|
21
|
-
`;
|
|
22
|
-
const LabelContainer = styled.div `
|
|
23
|
-
flex-grow: 0;
|
|
24
|
-
display: inline-block;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
text-align: end;
|
|
27
|
-
vertical-align: middle;
|
|
28
|
-
white-space: nowrap;
|
|
29
|
-
`;
|
|
30
|
-
const FieldContextRequired = styled.span `
|
|
31
|
-
color: red;
|
|
32
|
-
`;
|
|
33
|
-
export function useFieldsContext() {
|
|
34
|
-
const ctx = useContext(context);
|
|
35
|
-
if (!ctx) {
|
|
36
|
-
return { name: undefined, variant: 'default' };
|
|
37
|
-
}
|
|
38
|
-
return ctx;
|
|
39
|
-
}
|
|
40
|
-
export function Field(props) {
|
|
41
|
-
const { label, name, children, required, variant } = props;
|
|
42
|
-
const memoized = useMemo(() => {
|
|
43
|
-
return { name, variant: variant || 'default' };
|
|
44
|
-
}, [name, variant]);
|
|
45
|
-
return (_jsx(context.Provider, { value: memoized, children: _jsxs(FieldContextRoot, { children: [_jsx(LabelContainer, { children: _jsxs(Label, { htmlFor: name, variant: memoized.variant, children: [label, " ", required && _jsx(FieldContextRequired, { children: "*" }), ":", ' '] }) }), children] }) }));
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=FieldsContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldsContext.js","sourceRoot":"","sources":["../../../../src/components/forms/context/FieldsContext.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,aAAa,EAAa,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAetE,MAAM,OAAO,GAAG,aAAa,CAAsB,IAAI,CAAC,CAAC;AAEzD,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOlC,CAAC;AAEF,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAoC;;;;iBAI7C,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;eAC1D,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;;;CAGxE,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;CAOhC,CAAC;AAEF,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAA;;CAEvC,CAAC;AAEF,MAAM,UAAU,gBAAgB;IAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEhC,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;KAChD;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,KAAiB;IACrC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE3D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,CAAC;IACjD,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAC/B,MAAC,gBAAgB,eACf,KAAC,cAAc,cACb,MAAC,KAAK,IAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,aAC5C,KAAK,OAAG,QAAQ,IAAI,KAAC,oBAAoB,oBAAyB,OACjE,GAAG,IACC,GACO,EAEhB,QAAQ,IACQ,GACF,CACpB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/forms/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCloseButton.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalCloseButton.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,oDAgBvE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
-
/** @jsxImportSource @emotion/react */
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { FaTimes } from 'react-icons/fa';
|
|
5
|
-
export default function ModalCloseButton(props) {
|
|
6
|
-
return (_jsx("div", { style: { position: 'absolute', top: 4, right: 4 }, children: _jsx("button", { type: "button", style: { padding: '10px 6px 10px 6px' }, onClick: props.onClick, css: css({
|
|
7
|
-
color: 'rgba(239, 68, 68)',
|
|
8
|
-
':hover': { color: 'rgba(185, 28, 28)' },
|
|
9
|
-
}), children: _jsx(FaTimes, {}) }) }));
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=ModalCloseButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModalCloseButton.js","sourceRoot":"","sources":["../../../src/components/modal/ModalCloseButton.tsx"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA+B;IACtE,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,YACpD,iBACE,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,EACvC,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,GAAG,EAAE,GAAG,CAAC;gBACP,KAAK,EAAE,mBAAmB;gBAC1B,QAAQ,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE;aACzC,CAAC,YAEF,KAAC,OAAO,KAAG,GACJ,GACL,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FullSpinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/FullSpinner.tsx"],"names":[],"mappings":"AASA,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAoClD"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { keyframes } from '@emotion/react';
|
|
3
|
-
import styled from '@emotion/styled';
|
|
4
|
-
const spin = keyframes `
|
|
5
|
-
100% {
|
|
6
|
-
transform: rotate(360deg);
|
|
7
|
-
}
|
|
8
|
-
`;
|
|
9
|
-
const Spinner = styled.svg `
|
|
10
|
-
height: ${({ height }) => `${height || 40}px`};
|
|
11
|
-
width: ${({ width }) => `${width || 40}px`};
|
|
12
|
-
animation: ${spin} 0.8s linear infinite;
|
|
13
|
-
`;
|
|
14
|
-
export function FullSpinner(props) {
|
|
15
|
-
// First div is used when using nextjs/dynamic even after component is loaded
|
|
16
|
-
return (_jsx("div", { style: { height: '100%' }, children: _jsx("div", { style: {
|
|
17
|
-
display: 'flex',
|
|
18
|
-
height: '100%',
|
|
19
|
-
width: '100%',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
justifyContent: 'center',
|
|
22
|
-
}, children: _jsxs(Spinner, { ...props, xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [_jsx("circle", { style: { opacity: 0.25 }, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), _jsx("path", { style: { opacity: 0.75 }, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] }) }) }));
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=FullSpinner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FullSpinner.js","sourceRoot":"","sources":["../../../src/components/spinner/FullSpinner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,IAAI,GAAG,SAAS,CAAA;;;;CAIrB,CAAC;AAOF,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAkB;YAChC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,EAAE,IAAI;WACpC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,EAAE,IAAI;eAC7B,IAAI;CAClB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,6EAA6E;IAC7E,OAAO,CACL,cAAK,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,YAC5B,cACE,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,MAAM,EAAE,MAAM;gBACd,KAAK,EAAE,MAAM;gBACb,UAAU,EAAE,QAAQ;gBACpB,cAAc,EAAE,QAAQ;aACzB,YAED,MAAC,OAAO,OACF,KAAK,EACT,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,aAEnB,iBACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,EAAE,EAAC,IAAI,EACP,EAAE,EAAC,IAAI,EACP,CAAC,EAAC,IAAI,EACN,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,GACf,EACF,eACE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EACxB,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,iHAAiH,GACnH,IACM,GACN,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, @typescript-eslint/prefer-ts-expect-error
|
|
2
|
-
// @ts-ignore This import fails when compiling to CJS.
|
|
3
|
-
import { Menu } from '@headlessui/react';
|
|
4
|
-
import type { Placement } from '@popperjs/core';
|
|
5
|
-
import { ReactNode, useRef, ElementType, ComponentProps } from 'react';
|
|
6
|
-
|
|
7
|
-
import { useModifiedPopper } from '../hooks/useModifiedPopper';
|
|
8
|
-
import { useOnClickOutside } from '../hooks/useOnClickOutside';
|
|
9
|
-
import { useOnOff } from '../hooks/useOnOff';
|
|
10
|
-
import { Portal } from '../root-layout/Portal';
|
|
11
|
-
|
|
12
|
-
import { MenuItems, MenuOption, MenuOptions } from './MenuItems';
|
|
13
|
-
import { useContextMenuPlacement } from './useContextMenuPlacement';
|
|
14
|
-
|
|
15
|
-
interface DropdownMenuBaseProps<T> {
|
|
16
|
-
/**
|
|
17
|
-
* Placement for react-popper
|
|
18
|
-
*/
|
|
19
|
-
placement?: Placement;
|
|
20
|
-
|
|
21
|
-
options: MenuOptions<T>;
|
|
22
|
-
onSelect: (selected: MenuOption<T>) => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type ElementProps<E = unknown> = E extends ElementType
|
|
26
|
-
? ComponentProps<E>
|
|
27
|
-
: never;
|
|
28
|
-
|
|
29
|
-
interface DropdownMenuClickProps<T> extends DropdownMenuBaseProps<T> {
|
|
30
|
-
/**
|
|
31
|
-
* Node to be inside the Button
|
|
32
|
-
*/
|
|
33
|
-
children: ReactNode;
|
|
34
|
-
trigger: 'click';
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
interface DropdownMenuContextProps<T, E> extends DropdownMenuBaseProps<T> {
|
|
38
|
-
trigger: 'contextMenu';
|
|
39
|
-
children: ReactNode;
|
|
40
|
-
as?: E;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type DropdownMenuProps<T, E> =
|
|
44
|
-
| DropdownMenuContextProps<T, E>
|
|
45
|
-
| DropdownMenuClickProps<T>;
|
|
46
|
-
|
|
47
|
-
export function DropdownMenu<T = unknown, E extends ElementType = 'div'>(
|
|
48
|
-
props: DropdownMenuProps<T, E> &
|
|
49
|
-
Omit<ElementProps<E>, keyof DropdownMenuProps<T, E>>,
|
|
50
|
-
) {
|
|
51
|
-
const { trigger, ...otherProps } = props;
|
|
52
|
-
|
|
53
|
-
if (trigger === 'contextMenu') {
|
|
54
|
-
return <DropdownContextMenu<T, E> {...props} />;
|
|
55
|
-
}
|
|
56
|
-
return (
|
|
57
|
-
<DropdownClickMenu {...otherProps}>{props.children}</DropdownClickMenu>
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function DropdownContextMenu<T, E extends ElementType = 'div'>(
|
|
62
|
-
props: Omit<DropdownMenuContextProps<T, E>, 'trigger'> &
|
|
63
|
-
Omit<ElementProps<E>, keyof DropdownMenuProps<T, E>>,
|
|
64
|
-
) {
|
|
65
|
-
const {
|
|
66
|
-
children,
|
|
67
|
-
onSelect,
|
|
68
|
-
as: Wrapper = 'div',
|
|
69
|
-
placement = 'right-start',
|
|
70
|
-
options,
|
|
71
|
-
...otherProps
|
|
72
|
-
} = props;
|
|
73
|
-
|
|
74
|
-
const {
|
|
75
|
-
isPopperElementOpen,
|
|
76
|
-
closePopperElement,
|
|
77
|
-
handleContextMenu,
|
|
78
|
-
setPopperElement,
|
|
79
|
-
styles,
|
|
80
|
-
attributes,
|
|
81
|
-
} = useContextMenuPlacement(placement);
|
|
82
|
-
|
|
83
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
84
|
-
useOnClickOutside(ref, closePopperElement);
|
|
85
|
-
|
|
86
|
-
const { style = {}, ...otherWrapperProps } = otherProps as ElementProps<E>;
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<Wrapper
|
|
90
|
-
style={{ ...(!props?.as && { display: 'contents' }), ...style }}
|
|
91
|
-
{...otherWrapperProps}
|
|
92
|
-
onContextMenu={handleContextMenu}
|
|
93
|
-
>
|
|
94
|
-
<>
|
|
95
|
-
{isPopperElementOpen && (
|
|
96
|
-
<Portal>
|
|
97
|
-
<div ref={ref}>
|
|
98
|
-
<div
|
|
99
|
-
ref={setPopperElement}
|
|
100
|
-
style={styles.popper}
|
|
101
|
-
{...attributes.popper}
|
|
102
|
-
>
|
|
103
|
-
<Menu>
|
|
104
|
-
<MenuItems
|
|
105
|
-
itemsStatic
|
|
106
|
-
onSelect={(selected) => {
|
|
107
|
-
closePopperElement();
|
|
108
|
-
onSelect(selected);
|
|
109
|
-
}}
|
|
110
|
-
options={options}
|
|
111
|
-
/>
|
|
112
|
-
</Menu>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</Portal>
|
|
116
|
-
)}
|
|
117
|
-
|
|
118
|
-
{children}
|
|
119
|
-
</>
|
|
120
|
-
</Wrapper>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function DropdownClickMenu<T, E>(
|
|
125
|
-
props: Omit<DropdownMenuProps<T, E>, 'trigger'> & { children: ReactNode },
|
|
126
|
-
) {
|
|
127
|
-
const { placement = 'bottom-start', onSelect, ...otherProps } = props;
|
|
128
|
-
|
|
129
|
-
const [isOpened, , closeItems, toggle] = useOnOff(false);
|
|
130
|
-
|
|
131
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
132
|
-
useOnClickOutside(ref, closeItems);
|
|
133
|
-
|
|
134
|
-
const { setReferenceElement, setPopperElement, popperProps } =
|
|
135
|
-
useModifiedPopper<HTMLButtonElement>({ placement, offset: 6 });
|
|
136
|
-
|
|
137
|
-
return (
|
|
138
|
-
<Menu>
|
|
139
|
-
<Menu.Button ref={setReferenceElement} onClick={toggle}>
|
|
140
|
-
{props.children}
|
|
141
|
-
</Menu.Button>
|
|
142
|
-
{isOpened && (
|
|
143
|
-
<Portal>
|
|
144
|
-
<div ref={ref}>
|
|
145
|
-
<div ref={setPopperElement} {...popperProps}>
|
|
146
|
-
<MenuItems
|
|
147
|
-
itemsStatic
|
|
148
|
-
onSelect={(selected) => {
|
|
149
|
-
closeItems();
|
|
150
|
-
onSelect(selected);
|
|
151
|
-
}}
|
|
152
|
-
{...otherProps}
|
|
153
|
-
/>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</Portal>
|
|
157
|
-
)}
|
|
158
|
-
</Menu>
|
|
159
|
-
);
|
|
160
|
-
}
|