test-stpr-ui-kit 0.6.15 → 1.0.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/README.md +52 -9
- package/dist/components/Accordion/Accordion.css +1 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.js +78 -0
- package/dist/components/Accordion/Accordion.module.scss.js +37 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Accordion/types/index.d.ts +22 -0
- package/dist/components/ApplyButtons/ApplyButtons.css +1 -0
- package/dist/components/ApplyButtons/ApplyButtons.d.ts +3 -0
- package/dist/components/ApplyButtons/ApplyButtons.js +67 -0
- package/dist/components/ApplyButtons/ApplyButtons.module.scss.js +16 -0
- package/dist/components/ApplyButtons/index.d.ts +2 -0
- package/dist/components/ApplyButtons/types/index.d.ts +24 -0
- package/dist/components/AuthProtected/AuthProtected.d.ts +3 -0
- package/dist/components/AuthProtected/AuthProtected.js +37 -0
- package/dist/components/AuthProtected/index.d.ts +2 -0
- package/dist/components/AuthProtected/types/index.d.ts +11 -0
- package/dist/components/BaseTooltip/BaseTooltip.css +1 -0
- package/dist/components/BaseTooltip/BaseTooltip.d.ts +3 -0
- package/dist/components/BaseTooltip/BaseTooltip.js +25 -0
- package/dist/components/BaseTooltip/BaseTooltip.module.scss.js +11 -0
- package/dist/components/BaseTooltip/index.d.ts +2 -0
- package/dist/components/BaseTooltip/types/index.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.css +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +3 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +42 -0
- package/dist/components/Breadcrumb/Breadcrumb.module.scss.js +17 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Breadcrumb/types/index.d.ts +11 -0
- package/dist/components/Button/Button.css +1 -0
- package/dist/components/Button/Button.d.ts +3 -0
- package/dist/components/Button/Button.js +74 -0
- package/dist/components/Button/Button.module.scss.js +33 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types/index.d.ts +24 -0
- package/dist/components/Checkbox/Checkbox.css +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.js +72 -0
- package/dist/components/Checkbox/Checkbox.module.scss.js +33 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/types/index.d.ts +24 -0
- package/dist/components/Confirm/Confirm.d.ts +3 -0
- package/dist/components/Confirm/Confirm.js +85 -0
- package/dist/components/Confirm/index.d.ts +2 -0
- package/dist/components/Confirm/types/index.d.ts +7 -0
- package/dist/components/ContextMenu/ContextMenu.css +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +3 -0
- package/dist/components/ContextMenu/ContextMenu.js +39 -0
- package/dist/components/ContextMenu/ContextMenu.module.scss.js +13 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/ContextMenu/types/index.d.ts +12 -0
- package/dist/components/DatePicker/DatePicker.css +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.js +198 -0
- package/dist/components/DatePicker/DatePicker.module.scss.js +31 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/types/index.d.ts +33 -0
- package/dist/components/DatePickerInput/DatePickerInput.css +1 -0
- package/dist/components/DatePickerInput/DatePickerInput.d.ts +3 -0
- package/dist/components/DatePickerInput/DatePickerInput.js +101 -0
- package/dist/components/DatePickerInput/DatePickerInput.module.scss.js +25 -0
- package/dist/components/DatePickerInput/index.d.ts +2 -0
- package/dist/components/DatePickerInput/types/index.d.ts +32 -0
- package/dist/components/DefaultDropzone/DefaultDropzone.d.ts +3 -0
- package/dist/components/DefaultDropzone/DefaultDropzone.js +11 -0
- package/dist/components/DefaultDropzone/hooks/useDefaultDropzone.d.ts +2 -0
- package/dist/components/DefaultDropzone/hooks/useDefaultDropzone.js +5 -0
- package/dist/components/DefaultDropzone/index.d.ts +2 -0
- package/dist/components/DefaultDropzone/types/index.d.ts +10 -0
- package/dist/components/Dropdown/Dropdown.css +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/components/Dropdown/Dropdown.js +68 -0
- package/dist/components/Dropdown/Dropdown.module.scss.js +21 -0
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/Dropdown/types/index.d.ts +14 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.css +1 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.d.ts +3 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.js +75 -0
- package/dist/components/EllipsisTextWithTooltip/EllipsisTextWithTooltip.module.scss.js +11 -0
- package/dist/components/EllipsisTextWithTooltip/index.d.ts +2 -0
- package/dist/components/EllipsisTextWithTooltip/types/index.d.ts +13 -0
- package/dist/components/EllipsisTextWithTooltip/utils/index.d.ts +2 -0
- package/dist/components/EllipsisTextWithTooltip/utils/index.js +5 -0
- package/dist/components/Form/Form.css +1 -0
- package/dist/components/Form/Form.d.ts +3 -0
- package/dist/components/Form/Form.js +28 -0
- package/dist/components/Form/Form.module.scss.js +15 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/types/index.d.ts +13 -0
- package/dist/components/Icons/Icon.css +1 -0
- package/dist/components/Icons/Icon.d.ts +43 -0
- package/dist/components/Icons/Icon.js +136 -0
- package/dist/components/Icons/Icon.module.scss.js +7 -0
- package/dist/components/Icons/index.d.ts +3 -0
- package/dist/components/Icons/types/index.d.ts +47 -0
- package/dist/components/Icons/types/index.js +4 -0
- package/dist/components/IfcPreview/IfcPreview.css +1 -0
- package/dist/components/IfcPreview/IfcPreview.d.ts +3 -0
- package/dist/components/IfcPreview/IfcPreview.js +104 -0
- package/dist/components/IfcPreview/IfcPreview.module.scss.js +37 -0
- package/dist/components/IfcPreview/components/IfcPreviewCard/IfcPreviewCard.d.ts +14 -0
- package/dist/components/IfcPreview/components/IfcPreviewCard/IfcPreviewCard.js +79 -0
- package/dist/components/IfcPreview/components/IfcPreviewCard/index.d.ts +1 -0
- package/dist/components/IfcPreview/components/IfcPreviewViewerLayer/IfcPreviewViewerLayer.d.ts +18 -0
- package/dist/components/IfcPreview/components/IfcPreviewViewerLayer/IfcPreviewViewerLayer.js +59 -0
- package/dist/components/IfcPreview/components/IfcPreviewViewerLayer/index.d.ts +1 -0
- package/dist/components/IfcPreview/constants/index.d.ts +3 -0
- package/dist/components/IfcPreview/constants/index.js +6 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewModel.d.ts +20 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewModel.js +34 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewViewer.d.ts +30 -0
- package/dist/components/IfcPreview/hooks/useIfcPreviewViewer.js +73 -0
- package/dist/components/IfcPreview/index.d.ts +2 -0
- package/dist/components/IfcPreview/types/index.d.ts +52 -0
- package/dist/components/IfcPreview/utils/file-hellper.d.ts +2 -0
- package/dist/components/IfcPreview/utils/file-hellper.js +7 -0
- package/dist/components/IfcPreview/utils/fileSizeLimit.d.ts +7 -0
- package/dist/components/IfcPreview/utils/fileSizeLimit.js +8 -0
- package/dist/components/IfcPreview/utils/modelSource.d.ts +7 -0
- package/dist/components/IfcPreview/utils/modelSource.js +35 -0
- package/dist/components/IfcViewer/IfcViewer.css +1 -0
- package/dist/components/IfcViewer/IfcViewer.d.ts +3 -0
- package/dist/components/IfcViewer/IfcViewer.js +71 -0
- package/dist/components/IfcViewer/IfcViewer.module.scss.js +13 -0
- package/dist/components/IfcViewer/index.d.ts +2 -0
- package/dist/components/IfcViewer/types/index.d.ts +12 -0
- package/dist/components/IfcViewer/utils/fetchIfc.d.ts +1 -0
- package/dist/components/IfcViewer/utils/fetchIfc.js +9 -0
- package/dist/components/IfcViewer/utils/formatMeshProgress.d.ts +1 -0
- package/dist/components/IfcViewer/utils/formatMeshProgress.js +4 -0
- package/dist/components/IfcViewer/utils/ifcWebViewer.d.ts +14 -0
- package/dist/components/IfcViewer/utils/ifcWebViewer.js +120 -0
- package/dist/components/Input/Input.css +1 -0
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +121 -0
- package/dist/components/Input/Input.module.scss.js +33 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Input/types/index.d.ts +40 -0
- package/dist/components/Label/Label.css +1 -0
- package/dist/components/Label/Label.d.ts +3 -0
- package/dist/components/Label/Label.js +36 -0
- package/dist/components/Label/Label.module.scss.js +9 -0
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/Label/types/index.d.ts +9 -0
- package/dist/components/Layer/Layer.css +1 -0
- package/dist/components/Layer/Layer.d.ts +3 -0
- package/dist/components/Layer/Layer.js +26 -0
- package/dist/components/Layer/Layer.module.scss.js +9 -0
- package/dist/components/Layer/index.d.ts +2 -0
- package/dist/components/Layer/types/index.d.ts +7 -0
- package/dist/components/MediaContextProvider/MediaContextProvider.d.ts +3 -0
- package/dist/components/MediaContextProvider/MediaContextProvider.js +25 -0
- package/dist/components/MediaContextProvider/constants/index.d.ts +3 -0
- package/dist/components/MediaContextProvider/constants/index.js +11 -0
- package/dist/components/MediaContextProvider/hooks/index.d.ts +8 -0
- package/dist/components/MediaContextProvider/hooks/index.js +14 -0
- package/dist/components/MediaContextProvider/index.d.ts +4 -0
- package/dist/components/MediaContextProvider/types/index.d.ts +23 -0
- package/dist/components/Modal/Modal.css +1 -0
- package/dist/components/Modal/Modal.d.ts +3 -0
- package/dist/components/Modal/Modal.js +89 -0
- package/dist/components/Modal/Modal.module.scss.js +56 -0
- package/dist/components/Modal/hooks/index.d.ts +17 -0
- package/dist/components/Modal/hooks/index.js +25 -0
- package/dist/components/Modal/index.d.ts +3 -0
- package/dist/components/Modal/types/index.d.ts +24 -0
- package/dist/components/Portal/Potral.d.ts +3 -0
- package/dist/components/Portal/Potral.js +18 -0
- package/dist/components/Portal/index.d.ts +2 -0
- package/dist/components/Portal/types/index.d.ts +5 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.css +1 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.d.ts +3 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.js +50 -0
- package/dist/components/ProgressWrapper/ProgressWrapper.module.scss.js +17 -0
- package/dist/components/ProgressWrapper/constants/index.d.ts +1 -0
- package/dist/components/ProgressWrapper/constants/index.js +4 -0
- package/dist/components/ProgressWrapper/hooks/index.d.ts +5 -0
- package/dist/components/ProgressWrapper/hooks/index.js +41 -0
- package/dist/components/ProgressWrapper/index.d.ts +3 -0
- package/dist/components/ProgressWrapper/types/index.d.ts +17 -0
- package/dist/components/Select/Select.css +1 -0
- package/dist/components/Select/Select.d.ts +3 -0
- package/dist/components/Select/Select.js +195 -0
- package/dist/components/Select/Select.module.scss.js +69 -0
- package/dist/components/Select/constants/index.d.ts +3 -0
- package/dist/components/Select/constants/index.js +5 -0
- package/dist/components/Select/hooks/useSelect.d.ts +28 -0
- package/dist/components/Select/hooks/useSelect.js +73 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/types/index.d.ts +50 -0
- package/dist/components/Skeleton/Skeleton.css +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.js +38 -0
- package/dist/components/Skeleton/Skeleton.module.scss.js +13 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/typs/index.d.ts +10 -0
- package/dist/components/Spinner/Spinner.css +1 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -0
- package/dist/components/Spinner/Spinner.js +46 -0
- package/dist/components/Spinner/Spinner.module.scss.js +28 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/types/index.d.ts +9 -0
- package/dist/components/Table/Table.css +1 -0
- package/dist/components/Table/Table.d.ts +2 -0
- package/dist/components/Table/Table.js +219 -0
- package/dist/components/Table/Table.module.scss.js +41 -0
- package/dist/components/Table/hooks/index.d.ts +12 -0
- package/dist/components/Table/hooks/index.js +28 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/types/index.d.ts +39 -0
- package/dist/components/Table/utils/index.d.ts +2 -0
- package/dist/components/Table/utils/index.js +5 -0
- package/dist/components/Tabs/Tabs.css +1 -0
- package/dist/components/Tabs/Tabs.d.ts +3 -0
- package/dist/components/Tabs/Tabs.js +73 -0
- package/dist/components/Tabs/Tabs.module.scss.js +26 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/types/index.d.ts +25 -0
- package/dist/components/Text/Text.css +1 -0
- package/dist/components/Text/Text.d.ts +3 -0
- package/dist/components/Text/Text.js +39 -0
- package/dist/components/Text/Text.module.scss.js +17 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/types/index.d.ts +15 -0
- package/dist/components/TextWithLabel/TextWithLabel.css +1 -0
- package/dist/components/TextWithLabel/TextWithLabel.d.ts +3 -0
- package/dist/components/TextWithLabel/TextWithLabel.js +39 -0
- package/dist/components/TextWithLabel/TextWithLabel.module.scss.js +9 -0
- package/dist/components/TextWithLabel/index.d.ts +2 -0
- package/dist/components/TextWithLabel/types/index.d.ts +6 -0
- package/dist/components/Textarea/Textarea.css +1 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -0
- package/dist/components/Textarea/Textarea.js +132 -0
- package/dist/components/Textarea/Textarea.module.scss.js +35 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/types/index.d.ts +45 -0
- package/dist/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +4 -0
- package/dist/components/Tooltip/Tooltip.js +191 -0
- package/dist/components/Tooltip/Tooltip.module.scss.js +13 -0
- package/dist/components/Tooltip/index.d.ts +3 -0
- package/dist/components/Tooltip/types/index.d.ts +36 -0
- package/dist/components/Tooltip/types/index.js +4 -0
- package/dist/components/UploadFiles/UploadFiles.css +1 -0
- package/dist/components/UploadFiles/UploadFiles.d.ts +3 -0
- package/dist/components/UploadFiles/UploadFiles.js +238 -0
- package/dist/components/UploadFiles/UploadFiles.module.scss.js +73 -0
- package/dist/components/UploadFiles/index.d.ts +2 -0
- package/dist/components/UploadFiles/types/index.d.ts +33 -0
- package/dist/components/UploadFiles/utils/index.d.ts +12 -0
- package/dist/components/UploadFiles/utils/index.js +67 -0
- package/dist/components/ViewImageModal/ViewImageModal.css +1 -0
- package/dist/components/ViewImageModal/ViewImageModal.d.ts +3 -0
- package/dist/components/ViewImageModal/ViewImageModal.js +71 -0
- package/dist/components/ViewImageModal/ViewImageModal.module.scss.js +19 -0
- package/dist/components/ViewImageModal/index.d.ts +2 -0
- package/dist/components/ViewImageModal/types/index.d.ts +13 -0
- package/dist/components-assets/IfcPreview/web-ifc/web-ifc.wasm +0 -0
- package/dist/hooks/useClickOutside.d.ts +14 -0
- package/dist/hooks/useClickOutside.js +15 -0
- package/dist/images/add_file.svg.js +5 -0
- package/dist/images/add_user.svg.js +5 -0
- package/dist/images/arrow-bottom.svg.js +5 -0
- package/dist/images/calendar.svg.js +5 -0
- package/dist/images/check.svg.js +5 -0
- package/dist/images/chevron_down.svg.js +5 -0
- package/dist/images/close.svg.js +5 -0
- package/dist/images/copy.svg.js +5 -0
- package/dist/images/dots.svg.js +5 -0
- package/dist/images/download.svg.js +5 -0
- package/dist/images/edit.svg.js +5 -0
- package/dist/images/eye.svg.js +5 -0
- package/dist/images/file.svg.js +5 -0
- package/dist/images/file_not_filled.svg.js +5 -0
- package/dist/images/filter.svg.js +5 -0
- package/dist/images/folder.svg.js +5 -0
- package/dist/images/history_clock.svg.js +5 -0
- package/dist/images/info.svg.js +5 -0
- package/dist/images/info_error.svg.js +5 -0
- package/dist/images/layers-three.svg.js +5 -0
- package/dist/images/link-angled.svg.js +5 -0
- package/dist/images/logout.svg.js +5 -0
- package/dist/images/minus.svg.js +5 -0
- package/dist/images/pause-circle.svg.js +5 -0
- package/dist/images/play-circle.svg.js +5 -0
- package/dist/images/plus.svg.js +5 -0
- package/dist/images/plus_circle.svg.js +5 -0
- package/dist/images/plus_square.svg.js +5 -0
- package/dist/images/refresh.svg.js +5 -0
- package/dist/images/save.svg.js +5 -0
- package/dist/images/search.svg.js +5 -0
- package/dist/images/select_chevron_down.svg.js +5 -0
- package/dist/images/terminal_square.svg.js +5 -0
- package/dist/images/trash.svg.js +5 -0
- package/dist/images/update.svg.js +5 -0
- package/dist/images/upload-top.svg.js +5 -0
- package/dist/images/upload.svg.js +5 -0
- package/dist/images/user-right.svg.js +5 -0
- package/dist/images/warning_color.svg.js +5 -0
- package/dist/styles/tokens.css +250 -0
- package/dist/test-stpr-ui-kit.d.ts +36 -0
- package/dist/test-stpr-ui-kit.js +43 -15043
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/stringHelper.d.ts +13 -0
- package/dist/utils/stringHelper.js +4 -0
- package/package.json +34 -30
- package/dist/images/icon.svg +0 -8
- package/dist/images/viewImageExample.jpg +0 -0
- package/dist/test-stpr-ui-kit.css +0 -1
- package/dist/test-stpr-ui-kit.es.d.ts +0 -829
- package/dist/test-stpr-ui-kit.umd.cjs +0 -9
- /package/dist/{images → components-assets/ViewImageModal}/fallBackSrc.jpeg +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { ForwardedRef } from "react";
|
|
2
|
+
import { ETooltipPosition } from "../../Tooltip";
|
|
3
|
+
export type TInputVariant = "outlined" | "filled";
|
|
4
|
+
export type TInputSize = "md" | "xl";
|
|
5
|
+
export interface IInputProps {
|
|
6
|
+
name: string;
|
|
7
|
+
variant?: TInputVariant;
|
|
8
|
+
onChange?: TOnChangeInput;
|
|
9
|
+
onBlur?: TOnBlurInput;
|
|
10
|
+
value?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
isAbsolutePositionError?: boolean;
|
|
13
|
+
isClearable?: boolean;
|
|
14
|
+
pattern?: RegExp | string;
|
|
15
|
+
onMouseEnter?: () => void;
|
|
16
|
+
label?: string;
|
|
17
|
+
infoTooltipText?: string;
|
|
18
|
+
tooltipPosition?: ETooltipPosition;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
isVisibleDefaultTitle?: boolean;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
classNameError?: string;
|
|
24
|
+
classNameLabel?: string;
|
|
25
|
+
classNameRoot?: string;
|
|
26
|
+
classNameBaseTooltipRoot?: string;
|
|
27
|
+
ref?: ForwardedRef<HTMLInputElement>;
|
|
28
|
+
mask?: string | (string | RegExp)[];
|
|
29
|
+
alwaysShowMask?: boolean;
|
|
30
|
+
maskChar?: string;
|
|
31
|
+
size?: TInputSize;
|
|
32
|
+
}
|
|
33
|
+
export type TOnChangeInput = (event: React.ChangeEvent<HTMLInputElement>, data: {
|
|
34
|
+
name: string;
|
|
35
|
+
value: string | null;
|
|
36
|
+
}) => void;
|
|
37
|
+
export type TOnBlurInput = (event: React.FocusEvent<HTMLInputElement>, data: {
|
|
38
|
+
name: string;
|
|
39
|
+
value: string | null;
|
|
40
|
+
}) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._spLabel_15xnk_1{--spui-label-font-size: 12px;display:flex;align-items:center;gap:var(--spui-spacing-1x);color:var(--spui-color-text-secondary);font-family:var(--spui-font-family-main),serif;font-weight:var(--spui-font-weight-regular);font-size:var(--spui-label-font-size);line-height:20px}._spLabel_15xnk_1{opacity:1;visibility:visible}._spLabel_15xnk_1{transition:all .3s ease-in-out}@starting-style{._spLabel_15xnk_1{opacity:0;visibility:hidden}}@media only screen and (min-width:768px){._spLabel_15xnk_1{--spui-label-font-size: 14px}}._spLabel__tooltipIcon_15xnk_30{width:var(--spui-icon-size-sm);height:var(--spui-icon-size-sm)}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as N, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import e from "clsx";
|
|
3
|
+
import a from "./Label.module.scss.js";
|
|
4
|
+
import { InfoTooltip as T } from "../Tooltip/Tooltip.js";
|
|
5
|
+
const R = (l) => {
|
|
6
|
+
const {
|
|
7
|
+
required: r,
|
|
8
|
+
label: i,
|
|
9
|
+
infoTooltipText: o,
|
|
10
|
+
tooltipPosition: p,
|
|
11
|
+
classNameRoot: s,
|
|
12
|
+
classNameBaseTooltipRoot: c
|
|
13
|
+
} = l, m = e({
|
|
14
|
+
[a.spLabel]: !0,
|
|
15
|
+
...s && { [s]: !0 }
|
|
16
|
+
}), n = e({
|
|
17
|
+
[a.spLabel__tooltipIcon]: !0
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ N("label", { className: m, children: [
|
|
20
|
+
i,
|
|
21
|
+
r && /* @__PURE__ */ t("span", { children: "*" }),
|
|
22
|
+
o && /* @__PURE__ */ t(
|
|
23
|
+
T,
|
|
24
|
+
{
|
|
25
|
+
hover: !0,
|
|
26
|
+
position: p,
|
|
27
|
+
text: o,
|
|
28
|
+
classNameTriggerIcon: n,
|
|
29
|
+
classNameBaseTooltipRoot: c
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
] });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
R as Label
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._layer_o453j_1{position:fixed;inset:0;overflow:hidden;overflow-y:auto;z-index:1400;background:var(--spui-color-surface-mask);padding:20px}._layer_o453j_1{opacity:1;visibility:visible}._layer_o453j_1{transition:all .3s ease-in-out}@starting-style{._layer_o453j_1{opacity:0;visibility:hidden}}._layer_o453j_1::-webkit-scrollbar{width:var(--spui-scrollbar-width);height:var(--spui-scrollbar-width)}._layer_o453j_1::-webkit-scrollbar-track{background:var(--spui-color-surface-transparent)}._layer_o453j_1::-webkit-scrollbar-thumb{background:var(--color-aqua-blue)}._layer_o453j_1::-webkit-scrollbar-thumb:hover{background:var(--color-accent-blue)}._layer_o453j_1,._layer_o453j_1 *{box-sizing:border-box}@media only screen and (min-width:768px){._layer_o453j_1{padding:32px}}@media only screen and (min-width:1440px){._layer_o453j_1{padding:60px}}._layer_hidden_o453j_49{visibility:hidden}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import c from "clsx";
|
|
3
|
+
import { useEffect as i } from "react";
|
|
4
|
+
import t from "./Layer.module.scss.js";
|
|
5
|
+
import { Portal as y } from "../Portal/Potral.js";
|
|
6
|
+
const N = (s) => {
|
|
7
|
+
const {
|
|
8
|
+
children: d,
|
|
9
|
+
zIndex: l = 999,
|
|
10
|
+
isHiddenModal: n = !1,
|
|
11
|
+
classNameRoot: o
|
|
12
|
+
} = s, a = document.body, m = c({
|
|
13
|
+
[t.layer]: !0,
|
|
14
|
+
[t.layer_hidden]: n,
|
|
15
|
+
...o && { [o]: !0 }
|
|
16
|
+
});
|
|
17
|
+
return i(() => {
|
|
18
|
+
const e = document.body;
|
|
19
|
+
return e.style.overflow = "hidden", () => {
|
|
20
|
+
e.style.overflow = "";
|
|
21
|
+
};
|
|
22
|
+
}, []), /* @__PURE__ */ r(y, { node: a, children: /* @__PURE__ */ r("div", { style: { zIndex: l }, className: m, children: d }) });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
N as Layer
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MediaContext as d } from "./constants/index.js";
|
|
3
|
+
import { useMediaContext as m } from "./hooks/index.js";
|
|
4
|
+
const x = (t) => {
|
|
5
|
+
const {
|
|
6
|
+
breakpoints: e = {
|
|
7
|
+
desktop: { minWidth: 1440 },
|
|
8
|
+
tablet: { minWidth: 768, maxWidth: 1439 },
|
|
9
|
+
mobile: { maxWidth: 767 }
|
|
10
|
+
},
|
|
11
|
+
children: i
|
|
12
|
+
} = t, { device: o } = m(e);
|
|
13
|
+
return /* @__PURE__ */ r(
|
|
14
|
+
d.Provider,
|
|
15
|
+
{
|
|
16
|
+
value: {
|
|
17
|
+
device: o
|
|
18
|
+
},
|
|
19
|
+
children: i
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
x as MediaContextProvider
|
|
25
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMediaQuery as e } from "react-responsive";
|
|
2
|
+
const b = (t) => {
|
|
3
|
+
const { desktop: o, tablet: s, mobile: i } = t, n = e(o), c = e(s), r = e(i);
|
|
4
|
+
return {
|
|
5
|
+
device: {
|
|
6
|
+
isDesktop: n,
|
|
7
|
+
isTablet: c,
|
|
8
|
+
isMobile: r
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
b as useMediaContext
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type TBreakpoints = {
|
|
3
|
+
desktop: {
|
|
4
|
+
minWidth: number;
|
|
5
|
+
};
|
|
6
|
+
tablet: {
|
|
7
|
+
minWidth: number;
|
|
8
|
+
maxWidth: number;
|
|
9
|
+
};
|
|
10
|
+
mobile: {
|
|
11
|
+
maxWidth: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export interface MediaContextProviderProps extends React.PropsWithChildren {
|
|
15
|
+
breakpoints?: TBreakpoints;
|
|
16
|
+
}
|
|
17
|
+
export interface IMediaContext {
|
|
18
|
+
device: {
|
|
19
|
+
isDesktop: boolean;
|
|
20
|
+
isTablet: boolean;
|
|
21
|
+
isMobile: boolean;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._modalWrapper_r484v_1{display:flex;justify-content:center;height:100%;width:100%;--layer-padding: 20px;padding:var(--layer-padding)}@media only screen and (min-width:768px){._modalWrapper_r484v_1{--layer-padding: 32px}}@media only screen and (min-width:1440px){._modalWrapper_r484v_1{--layer-padding: 60px }}._modalWrapper--modalVerticalAlign-top_r484v_19{align-items:flex-start}._modalWrapper--modalVerticalAlign-center_r484v_22{align-items:center}._modalWrapper--textAlign-left_r484v_25{text-align:left}._modalWrapper--textAlign-center_r484v_28{text-align:center}._modalWrapper--textAlign-right_r484v_31{text-align:right}._modalWrapper__modal_r484v_34{display:flex;font-family:var(--spui-font-family-main),serif;font-weight:var(--spui-font-weight-regular);position:relative;background-color:var(--spui-color-surface-default);--modal-padding: 20px;padding:var(--modal-padding);flex-direction:column;gap:var(--modal-gap);width:100%;height:fit-content;min-width:335px}._modalWrapper__modal_r484v_34::-webkit-scrollbar{width:var(--spui-scrollbar-width);height:var(--spui-scrollbar-width)}._modalWrapper__modal_r484v_34::-webkit-scrollbar-track{background:var(--spui-color-surface-transparent)}._modalWrapper__modal_r484v_34::-webkit-scrollbar-thumb{background:var(--color-aqua-blue)}._modalWrapper__modal_r484v_34::-webkit-scrollbar-thumb:hover{background:var(--color-accent-blue)}._modalWrapper__modal--size-lg_r484v_61{--modal-gap: 32px}@media only screen and (min-width:768px){._modalWrapper__modal--size-lg_r484v_61{--modal-padding: 64px;--modal-gap: 48px;max-width:920px}}._modalWrapper__modal--size-md_r484v_71{--modal-gap: 24px}@media only screen and (min-width:768px){._modalWrapper__modal--size-md_r484v_71{--modal-padding: 32px;--modal-gap: 32px;max-width:600px}}._modalWrapper--modalVerticalAlign-center_r484v_22 ._modalWrapper__modal_r484v_34{max-height:calc(100vh - var(--layer-padding) * 2)}._modalWrapper__modal_disabled_r484v_84,._modalWrapper__modal_loading_r484v_84{pointer-events:none}._modalWrapper__content_r484v_87{width:100%}._modalWrapper--modalVerticalAlign-center_r484v_22 ._modalWrapper__content_r484v_87{width:calc(100% + var(--modal-padding) / 2);padding-right:calc(var(--modal-padding) / 2);overflow-y:auto;flex:1}._modalWrapper--modalVerticalAlign-center_r484v_22 ._modalWrapper__content_r484v_87::-webkit-scrollbar{width:var(--spui-scrollbar-width);height:var(--spui-scrollbar-width)}._modalWrapper--modalVerticalAlign-center_r484v_22 ._modalWrapper__content_r484v_87::-webkit-scrollbar-track{background:var(--spui-color-surface-secondary-hover)}._modalWrapper--modalVerticalAlign-center_r484v_22 ._modalWrapper__content_r484v_87::-webkit-scrollbar-thumb{background:var(--color-aqua-blue)}._modalWrapper--modalVerticalAlign-center_r484v_22 ._modalWrapper__content_r484v_87::-webkit-scrollbar-thumb:hover{background:var(--color-accent-blue)}._modalWrapper__content_disabled_r484v_109,._modalWrapper__content_loading_r484v_109{opacity:.5}._modalWrapper__header_r484v_112{width:calc(100% - 22px);display:flex;flex-direction:column;gap:12px}@media only screen and (min-width:768px){._modalWrapper__header_r484v_112{gap:16px;width:100%}}._modalWrapper__footer_r484v_124{width:100%}._modalWrapper__closeButton_r484v_127{padding:0;cursor:pointer;margin-left:0;position:absolute;top:20px;right:20px}@media only screen and (min-width:768px){._modalWrapper__closeButton--size-lg_r484v_136{top:37px;right:37px}._modalWrapper__closeButton--size-md_r484v_140{top:20px;right:20px}}._modalWrapper__closeButton_r484v_127 ._modalWrapper__closeButtonIconContainer--size-lg_r484v_145 svg{width:24px;height:24px}._modalWrapper__closeButton_r484v_127 ._modalWrapper__closeButtonIconContainer--size-md_r484v_149 svg{width:20px;height:20px}._modalWrapper__closeButton_disabled_r484v_153,._modalWrapper__closeButton_loading_r484v_153{opacity:.5}._modalWrapper__header_r484v_112,._modalWrapper__subHeader_r484v_156,._modalWrapper__footer_r484v_124{flex-shrink:0}._modalWrapper__header_disabled_r484v_159,._modalWrapper__header_loading_r484v_159,._modalWrapper__subHeader_disabled_r484v_159,._modalWrapper__subHeader_loading_r484v_159,._modalWrapper__footer_disabled_r484v_159,._modalWrapper__footer_loading_r484v_159{opacity:.5}._modalWrapper__spinnerOverlay_r484v_162{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background-color:#ffffffb3;z-index:10}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as a, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import r from "clsx";
|
|
3
|
+
import e from "./Modal.module.scss.js";
|
|
4
|
+
import { Layer as S } from "../Layer/Layer.js";
|
|
5
|
+
import { Text as b } from "../Text/Text.js";
|
|
6
|
+
import { Button as $ } from "../Button/Button.js";
|
|
7
|
+
import { EIconName as F } from "../Icons/types/index.js";
|
|
8
|
+
import { Spinner as L } from "../Spinner/Spinner.js";
|
|
9
|
+
const w = (h) => {
|
|
10
|
+
const {
|
|
11
|
+
zIndex: R = 999,
|
|
12
|
+
isHiddenModal: C = !1,
|
|
13
|
+
disabled: l = !1,
|
|
14
|
+
loading: o = !1,
|
|
15
|
+
isVisibleCloseButton: H = !0,
|
|
16
|
+
children: p,
|
|
17
|
+
classNameLayerRoot: m,
|
|
18
|
+
classNameRoot: n,
|
|
19
|
+
classNameHeaderRoot: i,
|
|
20
|
+
classNameSubHeaderRoot: _,
|
|
21
|
+
classNameFooterRoot: c,
|
|
22
|
+
style: y,
|
|
23
|
+
modalVerticalAlign: u = "top",
|
|
24
|
+
textAlign: N = "left",
|
|
25
|
+
onClose: W,
|
|
26
|
+
header: t,
|
|
27
|
+
subHeader: s,
|
|
28
|
+
footer: f,
|
|
29
|
+
size: d = "lg"
|
|
30
|
+
} = h, v = r({
|
|
31
|
+
[e.modalWrapper]: !0,
|
|
32
|
+
[e[`modalWrapper--modalVerticalAlign-${u}`]]: u,
|
|
33
|
+
[e[`modalWrapper--textAlign-${N}`]]: N,
|
|
34
|
+
...m && { [m]: !0 }
|
|
35
|
+
}), x = r({
|
|
36
|
+
[e.modalWrapper__modal]: !0,
|
|
37
|
+
[e[`modalWrapper__modal--size-${d}`]]: d,
|
|
38
|
+
[e.modalWrapper__modal_disabled]: l,
|
|
39
|
+
[e.modalWrapper__modal_loading]: o,
|
|
40
|
+
...n && { [n]: !0 }
|
|
41
|
+
}), B = r({
|
|
42
|
+
[e.modalWrapper__closeButton]: !0,
|
|
43
|
+
[e.modalWrapper__closeButton_disabled]: l,
|
|
44
|
+
[e.modalWrapper__closeButton_loading]: o,
|
|
45
|
+
[e[`modalWrapper__closeButton--size-${d}`]]: d
|
|
46
|
+
}), M = r({
|
|
47
|
+
[e.modalWrapper__content]: !0,
|
|
48
|
+
[e.modalWrapper__content_disabled]: l,
|
|
49
|
+
[e.modalWrapper__content_loading]: o
|
|
50
|
+
}), z = r({
|
|
51
|
+
[e.modalWrapper__header]: !0,
|
|
52
|
+
[e.modalWrapper__header_disabled]: l,
|
|
53
|
+
[e.modalWrapper__header_loading]: o,
|
|
54
|
+
...i && { [i]: !0 }
|
|
55
|
+
}), A = r({
|
|
56
|
+
[e.modalWrapper__subHeader]: !0,
|
|
57
|
+
[e.modalWrapper__subHeader_disabled]: l,
|
|
58
|
+
[e.modalWrapper__subHeader_loading]: o,
|
|
59
|
+
..._ && { [_]: !0 }
|
|
60
|
+
}), I = r({
|
|
61
|
+
[e.modalWrapper__footer]: !0,
|
|
62
|
+
[e.modalWrapper__footer_disabled]: l,
|
|
63
|
+
[e.modalWrapper__footer_loading]: o,
|
|
64
|
+
...c && { [c]: !0 }
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ a(S, { zIndex: R, isHiddenModal: C, classNameRoot: v, children: /* @__PURE__ */ g("div", { className: x, style: y, children: [
|
|
67
|
+
(t || s) && /* @__PURE__ */ g("div", { className: z, children: [
|
|
68
|
+
typeof t == "string" ? /* @__PURE__ */ a(b, { type: "h3", children: t }) : t,
|
|
69
|
+
s && /* @__PURE__ */ a("div", { className: A, children: typeof s == "string" ? /* @__PURE__ */ a(b, { children: s }) : s })
|
|
70
|
+
] }),
|
|
71
|
+
p && /* @__PURE__ */ a("div", { className: M, children: p }),
|
|
72
|
+
f && /* @__PURE__ */ a("div", { className: I, children: f }),
|
|
73
|
+
H && W && /* @__PURE__ */ a(
|
|
74
|
+
$,
|
|
75
|
+
{
|
|
76
|
+
classNameRoot: B,
|
|
77
|
+
onClick: W,
|
|
78
|
+
startIconName: F.Close,
|
|
79
|
+
variant: "link",
|
|
80
|
+
noPadding: !0,
|
|
81
|
+
isOnlyIcon: !0
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
o && /* @__PURE__ */ a("div", { className: e.modalWrapper__spinnerOverlay, children: /* @__PURE__ */ a(L, { size: "lg" }) })
|
|
85
|
+
] }) });
|
|
86
|
+
};
|
|
87
|
+
export {
|
|
88
|
+
w as Modal
|
|
89
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import './Modal.css';const _ = "_modalWrapper_r484v_1", a = "_modalWrapper__modal_r484v_34", r = "_modalWrapper__modal_disabled_r484v_84", e = "_modalWrapper__modal_loading_r484v_84", o = "_modalWrapper__content_r484v_87", l = "_modalWrapper__content_disabled_r484v_109", d = "_modalWrapper__content_loading_r484v_109", p = "_modalWrapper__header_r484v_112", t = "_modalWrapper__footer_r484v_124", n = "_modalWrapper__closeButton_r484v_127", m = "_modalWrapper__closeButton_disabled_r484v_153", s = "_modalWrapper__closeButton_loading_r484v_153", W = "_modalWrapper__subHeader_r484v_156", i = "_modalWrapper__header_disabled_r484v_159", c = "_modalWrapper__header_loading_r484v_159", g = "_modalWrapper__subHeader_disabled_r484v_159", v = "_modalWrapper__subHeader_loading_r484v_159", b = "_modalWrapper__footer_disabled_r484v_159", u = "_modalWrapper__footer_loading_r484v_159", B = "_modalWrapper__spinnerOverlay_r484v_162", f = {
|
|
2
|
+
modalWrapper: _,
|
|
3
|
+
"modalWrapper--modalVerticalAlign-top": "_modalWrapper--modalVerticalAlign-top_r484v_19",
|
|
4
|
+
"modalWrapper--modalVerticalAlign-center": "_modalWrapper--modalVerticalAlign-center_r484v_22",
|
|
5
|
+
"modalWrapper--textAlign-left": "_modalWrapper--textAlign-left_r484v_25",
|
|
6
|
+
"modalWrapper--textAlign-center": "_modalWrapper--textAlign-center_r484v_28",
|
|
7
|
+
"modalWrapper--textAlign-right": "_modalWrapper--textAlign-right_r484v_31",
|
|
8
|
+
modalWrapper__modal: a,
|
|
9
|
+
"modalWrapper__modal--size-lg": "_modalWrapper__modal--size-lg_r484v_61",
|
|
10
|
+
"modalWrapper__modal--size-md": "_modalWrapper__modal--size-md_r484v_71",
|
|
11
|
+
modalWrapper__modal_disabled: r,
|
|
12
|
+
modalWrapper__modal_loading: e,
|
|
13
|
+
modalWrapper__content: o,
|
|
14
|
+
modalWrapper__content_disabled: l,
|
|
15
|
+
modalWrapper__content_loading: d,
|
|
16
|
+
modalWrapper__header: p,
|
|
17
|
+
modalWrapper__footer: t,
|
|
18
|
+
modalWrapper__closeButton: n,
|
|
19
|
+
"modalWrapper__closeButton--size-lg": "_modalWrapper__closeButton--size-lg_r484v_136",
|
|
20
|
+
"modalWrapper__closeButton--size-md": "_modalWrapper__closeButton--size-md_r484v_140",
|
|
21
|
+
"modalWrapper__closeButtonIconContainer--size-lg": "_modalWrapper__closeButtonIconContainer--size-lg_r484v_145",
|
|
22
|
+
"modalWrapper__closeButtonIconContainer--size-md": "_modalWrapper__closeButtonIconContainer--size-md_r484v_149",
|
|
23
|
+
modalWrapper__closeButton_disabled: m,
|
|
24
|
+
modalWrapper__closeButton_loading: s,
|
|
25
|
+
modalWrapper__subHeader: W,
|
|
26
|
+
modalWrapper__header_disabled: i,
|
|
27
|
+
modalWrapper__header_loading: c,
|
|
28
|
+
modalWrapper__subHeader_disabled: g,
|
|
29
|
+
modalWrapper__subHeader_loading: v,
|
|
30
|
+
modalWrapper__footer_disabled: b,
|
|
31
|
+
modalWrapper__footer_loading: u,
|
|
32
|
+
modalWrapper__spinnerOverlay: B
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
f as default,
|
|
36
|
+
_ as modalWrapper,
|
|
37
|
+
n as modalWrapper__closeButton,
|
|
38
|
+
m as modalWrapper__closeButton_disabled,
|
|
39
|
+
s as modalWrapper__closeButton_loading,
|
|
40
|
+
o as modalWrapper__content,
|
|
41
|
+
l as modalWrapper__content_disabled,
|
|
42
|
+
d as modalWrapper__content_loading,
|
|
43
|
+
t as modalWrapper__footer,
|
|
44
|
+
b as modalWrapper__footer_disabled,
|
|
45
|
+
u as modalWrapper__footer_loading,
|
|
46
|
+
p as modalWrapper__header,
|
|
47
|
+
i as modalWrapper__header_disabled,
|
|
48
|
+
c as modalWrapper__header_loading,
|
|
49
|
+
a as modalWrapper__modal,
|
|
50
|
+
r as modalWrapper__modal_disabled,
|
|
51
|
+
e as modalWrapper__modal_loading,
|
|
52
|
+
B as modalWrapper__spinnerOverlay,
|
|
53
|
+
W as modalWrapper__subHeader,
|
|
54
|
+
g as modalWrapper__subHeader_disabled,
|
|
55
|
+
v as modalWrapper__subHeader_loading
|
|
56
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface UseModalParams {
|
|
3
|
+
initialValue?: never;
|
|
4
|
+
}
|
|
5
|
+
export declare const useModal: (params?: UseModalParams) => {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
modalData: {
|
|
8
|
+
[name: string]: any;
|
|
9
|
+
} | null;
|
|
10
|
+
onOpenModal: (modalData: {
|
|
11
|
+
[name: string]: boolean | NonNullable<unknown>;
|
|
12
|
+
}, isKeepRest?: boolean) => void;
|
|
13
|
+
onCloseModal: (_event?: React.MouseEvent<HTMLButtonElement>, closeData?: {
|
|
14
|
+
[name: string]: boolean | NonNullable<unknown>;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useState as r } from "react";
|
|
2
|
+
const M = (s = {}) => {
|
|
3
|
+
const { initialValue: a = null } = s, [l, o] = r(a);
|
|
4
|
+
return {
|
|
5
|
+
isOpen: !!l,
|
|
6
|
+
modalData: l,
|
|
7
|
+
onOpenModal: (e, n = !1) => {
|
|
8
|
+
if (n) {
|
|
9
|
+
o((t) => ({ ...t, ...e }));
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
o(e);
|
|
13
|
+
},
|
|
14
|
+
onCloseModal: (e, n) => {
|
|
15
|
+
if (n && Object.keys(n).length > 0) {
|
|
16
|
+
o((t) => ({ ...t, ...n }));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
o(null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
M as useModal
|
|
25
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactNode } from "react";
|
|
2
|
+
export type TModalVerticalAlign = "center" | "top";
|
|
3
|
+
export type TTextAlign = "center" | "left" | "right";
|
|
4
|
+
export type TModalSize = "md" | "lg";
|
|
5
|
+
export interface ModalProps extends React.PropsWithChildren {
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
size?: TModalSize;
|
|
8
|
+
modalVerticalAlign?: TModalVerticalAlign;
|
|
9
|
+
textAlign?: TTextAlign;
|
|
10
|
+
isHiddenModal?: boolean;
|
|
11
|
+
isVisibleCloseButton?: boolean;
|
|
12
|
+
classNameRoot?: string;
|
|
13
|
+
classNameHeaderRoot?: string;
|
|
14
|
+
classNameSubHeaderRoot?: string;
|
|
15
|
+
classNameFooterRoot?: string;
|
|
16
|
+
classNameLayerRoot?: string;
|
|
17
|
+
header: string | ReactNode;
|
|
18
|
+
footer?: ReactNode;
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
subHeader?: ReactNode;
|
|
21
|
+
onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useState as u, useEffect as c } from "react";
|
|
2
|
+
import a from "react-dom";
|
|
3
|
+
const f = ({ children: i, node: t, classNameRoot: r }) => {
|
|
4
|
+
const [n, o] = u(() => t ?? null);
|
|
5
|
+
return c(() => {
|
|
6
|
+
if (t) {
|
|
7
|
+
o(t);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const e = document.createElement("div");
|
|
11
|
+
return r && (e.className = r), document.body.appendChild(e), o(e), () => {
|
|
12
|
+
document.body.removeChild(e);
|
|
13
|
+
};
|
|
14
|
+
}, [t, r]), n ? a.createPortal(i, n) : null;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
f as Portal
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";._progressWrapper_iry74_2{position:relative;width:100%;z-index:1;transition:background .3s ease}._progressWrapper_iry74_2{opacity:1;visibility:visible}._progressWrapper_iry74_2{transition:all .3s ease-in-out}@starting-style{._progressWrapper_iry74_2{opacity:0;visibility:hidden}}._progressWrapper_loading_iry74_21{opacity:.7;pointer-events:none;cursor:not-allowed}._progressWrapper_loading_iry74_21._progressWrapper--animated-pulse_iry74_26{animation:_pulse_iry74_1 2s infinite}._progressWrapper_loading_iry74_21._progressWrapper--animated-backgroundProgress_iry74_29{background:linear-gradient(to right,var(--spui-color-blue-50) var(--progress, 0%),var(--spui-color-surface-default) var(--progress, 0%))}._progressWrapper__progressBadge_iry74_32{z-index:2;position:absolute;top:2px;right:2px;padding:var(--spui-spacing-1x);padding-left:var(--spui-spacing-2x);font-size:12px;font-weight:var(--spui-font-weight-medium);font-variant-numeric:tabular-nums;color:var(--spui-color-text-secondary);transition:all .5s ease}._progressWrapper__progressBadge_loading_iry74_45{color:var(--spui-color-text-action)}@media only screen and (min-width:768px){._progressWrapper__progressBadge_iry74_32{padding:var(--spui-spacing-2x);padding-left:var(--spui-spacing-3x);font-size:14px}}@keyframes _pulse_iry74_1{0%{opacity:1}50%{opacity:.5}to{opacity:1}}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import { useAnimatedValue as R } from "./hooks/index.js";
|
|
4
|
+
import r from "./ProgressWrapper.module.scss.js";
|
|
5
|
+
import { Text as W } from "../Text/Text.js";
|
|
6
|
+
const b = (d) => {
|
|
7
|
+
const {
|
|
8
|
+
value: m,
|
|
9
|
+
classNameRoot: o,
|
|
10
|
+
classNameProgressBadgeRoot: a,
|
|
11
|
+
duration: c = 2e3,
|
|
12
|
+
children: i,
|
|
13
|
+
doneValue: t = 100,
|
|
14
|
+
animationVariant: s = "backgroundProgress",
|
|
15
|
+
onSuccessLoaded: l
|
|
16
|
+
} = d, { animatedValue: p, isLoading: e } = R({
|
|
17
|
+
targetValue: m,
|
|
18
|
+
duration: c,
|
|
19
|
+
doneValue: t,
|
|
20
|
+
onSuccessLoaded: l
|
|
21
|
+
}), u = n({
|
|
22
|
+
[r.progressWrapper]: !0,
|
|
23
|
+
[r[`progressWrapper--animated-${s}`]]: s,
|
|
24
|
+
[r.progressWrapper_loading]: e,
|
|
25
|
+
...o && { [o]: !0 }
|
|
26
|
+
}), N = n({
|
|
27
|
+
[r.progressWrapper__progressBadge]: !0,
|
|
28
|
+
[r.progressWrapper__progressBadge_loading]: e,
|
|
29
|
+
...a && { [a]: !0 }
|
|
30
|
+
}), P = {
|
|
31
|
+
"--progress": `${p / t * 100}%`
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ g(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: u,
|
|
37
|
+
style: s === "backgroundProgress" ? P : void 0,
|
|
38
|
+
children: [
|
|
39
|
+
i,
|
|
40
|
+
e && /* @__PURE__ */ g(W, { classNameRoot: N, children: [
|
|
41
|
+
p,
|
|
42
|
+
"%"
|
|
43
|
+
] })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
b as ProgressWrapper
|
|
50
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import './ProgressWrapper.css';const r = "_progressWrapper_iry74_2", s = "_progressWrapper_loading_iry74_21", p = "_pulse_iry74_1", e = "_progressWrapper__progressBadge_iry74_32", a = "_progressWrapper__progressBadge_loading_iry74_45", o = {
|
|
2
|
+
progressWrapper: r,
|
|
3
|
+
progressWrapper_loading: s,
|
|
4
|
+
"progressWrapper--animated-pulse": "_progressWrapper--animated-pulse_iry74_26",
|
|
5
|
+
pulse: p,
|
|
6
|
+
"progressWrapper--animated-backgroundProgress": "_progressWrapper--animated-backgroundProgress_iry74_29",
|
|
7
|
+
progressWrapper__progressBadge: e,
|
|
8
|
+
progressWrapper__progressBadge_loading: a
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
o as default,
|
|
12
|
+
r as progressWrapper,
|
|
13
|
+
e as progressWrapper__progressBadge,
|
|
14
|
+
a as progressWrapper__progressBadge_loading,
|
|
15
|
+
s as progressWrapper_loading,
|
|
16
|
+
p as pulse
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_DURATION = 2000;
|