@geneui/components 3.0.0-next-06dadf3-29102024 → 3.0.0-next-63cb5e7-01112024
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/Avatar.js +63 -0
- package/Divider.js +23 -0
- package/{GeneUIProvider/index.js → GeneUIProvider.js} +51 -64
- package/HelperText.js +69 -0
- package/Info.js +64 -0
- package/Label.js +38 -0
- package/Loader.js +21 -0
- package/Pill.js +64 -0
- package/TextLink.js +20 -0
- package/{index-c7646e48.js → Tooltip.js} +101 -79
- package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
- package/components/atoms/Avatar/index.d.ts +1 -0
- package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
- package/components/atoms/Divider/index.d.ts +1 -0
- package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
- package/components/atoms/HelperText/index.d.ts +1 -0
- package/{lib → components}/atoms/Info/Info.d.ts +5 -5
- package/components/atoms/Info/index.d.ts +1 -0
- package/{lib → components}/atoms/Label/Label.d.ts +3 -3
- package/components/atoms/Label/index.d.ts +1 -0
- package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
- package/components/atoms/Loader/index.d.ts +1 -0
- package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
- package/components/atoms/Pill/index.d.ts +1 -0
- package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
- package/components/atoms/TextLink/index.d.ts +1 -0
- package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
- package/components/molecules/Tooltip/index.d.ts +1 -0
- package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
- package/components/providers/GeneUIProvider/index.d.ts +1 -0
- package/hooks/index.d.ts +2 -20
- package/hooks/useDebounceCallback/index.d.ts +1 -0
- package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
- package/hooks/useEllipsisDetection/index.d.ts +1 -1
- package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
- package/{index-031ff73c.js → index-ce02421b.js} +4 -4
- package/index.d.ts +11 -121
- package/index.js +12 -159
- package/package.json +24 -43
- package/tokens-0abb4e1b.js +6 -0
- package/types/index.d.ts +0 -3
- package/useEllipsisDetection-46d712b6.js +34 -0
- package/ActionableList/index.js +0 -1694
- package/AdvancedSearch/index.js +0 -892
- package/Alert/index.js +0 -98
- package/Avatar/index.js +0 -58
- package/Badge/index.js +0 -29
- package/Breadcrumb/index.js +0 -130
- package/BusyLoader/index.js +0 -31
- package/Button/index.js +0 -30
- package/Card/index.js +0 -502
- package/CardList/index.js +0 -662
- package/CellMeasurerCache-26f3693c.js +0 -229
- package/Charts/index.js +0 -17662
- package/Checkbox/index.js +0 -229
- package/CheckboxGroup/index.js +0 -203
- package/CheckboxGroupWithSearch/index.js +0 -280
- package/Collapse/index.js +0 -195
- package/ColorPicker/index.js +0 -210
- package/ComboBox/index.js +0 -524
- package/Copy/index.js +0 -56
- package/Counter/index.js +0 -312
- package/DateFilter/index.js +0 -183
- package/DatePicker/index.js +0 -1229
- package/DatePickerInput/index.js +0 -883
- package/Divider/index.js +0 -23
- package/Drawer/index.js +0 -261
- package/Dropdown/index.js +0 -43
- package/Editor/index.js +0 -22975
- package/Empty/index.js +0 -76
- package/ExtendedInput/index.js +0 -590
- package/Form/index.js +0 -85
- package/FormContainer/index.js +0 -189
- package/FormableCheckbox/index.js +0 -24
- package/FormableDatePicker/index.js +0 -43
- package/FormableDropdown/index.js +0 -50
- package/FormableEditor/index.js +0 -26
- package/FormableHOC-85f89a81.js +0 -83
- package/FormableMultiSelectDropdown/index.js +0 -50
- package/FormableNumberInput/index.js +0 -34
- package/FormableRadio/index.js +0 -22
- package/FormableSwitcher/index.js +0 -22
- package/FormableTextInput/index.js +0 -34
- package/FormableUploader/index.js +0 -44
- package/Grid/index.js +0 -167
- package/HelperText/index.js +0 -86
- package/Holder/index.js +0 -261
- package/Icon/index.js +0 -62
- package/Image/index.js +0 -45
- package/ImagePreview/index.js +0 -217
- package/Info/index.js +0 -41
- package/InfoOutline-dd2e89d9.js +0 -29
- package/InteractiveWidget/index.js +0 -78
- package/KeyValue/index.js +0 -22
- package/Label/index.js +0 -48
- package/LinkButton/index.js +0 -34
- package/Loader/index.js +0 -23
- package/Menu/index.js +0 -281
- package/MobileNavigation/index.js +0 -94
- package/MobilePopup/index.js +0 -182
- package/Modal/index.js +0 -251
- package/ModuleTitle/index.js +0 -141
- package/NavigationMenu/index.js +0 -222
- package/Notification/index.js +0 -120
- package/Option/index.js +0 -184
- package/Overlay/index.js +0 -187
- package/Overspread/index.js +0 -291
- package/Pagination/index.js +0 -261
- package/Paper/index.js +0 -96
- package/Pill/index.js +0 -67
- package/Popover/index.js +0 -725
- package/PopoverV2/index.js +0 -19
- package/Portal/index.js +0 -58
- package/Products/index.js +0 -115
- package/Profile/index.js +0 -589
- package/Progress/index.js +0 -200
- package/QRCode/index.js +0 -814
- package/Radio/index.js +0 -151
- package/RadioGroup/index.js +0 -104
- package/Range/index.js +0 -191
- package/Rating/index.js +0 -174
- package/RichEditor/index.js +0 -13
- package/RichEditor-6ca8346f.js +0 -228
- package/Scrollbar/index.js +0 -1585
- package/Search/index.js +0 -75
- package/SearchWithDropdown/index.js +0 -140
- package/Section/index.js +0 -61
- package/SkeletonLoader/index.js +0 -81
- package/Slider/index.js +0 -261
- package/Status/index.js +0 -97
- package/Steps/index.js +0 -314
- package/SuggestionList/index.js +0 -385
- package/Switcher/index.js +0 -193
- package/Table/index.js +0 -57
- package/TableCompositions/index.js +0 -16995
- package/Tabs/index.js +0 -235
- package/Tag/index.js +0 -102
- package/TextLink/index.js +0 -20
- package/Textarea/index.js +0 -242
- package/Time/index.js +0 -62
- package/TimePicker/index.js +0 -575
- package/Timeline/index.js +0 -113
- package/Title/index.js +0 -65
- package/Toaster/index.js +0 -116
- package/Tooltip/index.js +0 -6
- package/TransferList/index.js +0 -493
- package/Uploader/index.js +0 -992
- package/ValidatableCheckbox/index.js +0 -123
- package/ValidatableDatePicker/index.js +0 -316
- package/ValidatableDropdown/index.js +0 -141
- package/ValidatableElements/index.js +0 -67
- package/ValidatableMultiSelectDropdown/index.js +0 -152
- package/ValidatableNumberInput/index.js +0 -204
- package/ValidatableRadio/index.js +0 -116
- package/ValidatableSwitcher/index.js +0 -93
- package/ValidatableTextInput/index.js +0 -167
- package/ValidatableTimeInput/index.js +0 -174
- package/ValidatableUploader/index.js +0 -98
- package/Widget/index.js +0 -225
- package/_commonjsHelpers-24198af3.js +0 -35
- package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
- package/callAfterDelay-7272faca.js +0 -12
- package/checkTimeValidation-e56771be.js +0 -16
- package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
- package/clsx.m-2bb6df4b.js +0 -3
- package/config-1053d64d.js +0 -20
- package/configs-00612ce0.js +0 -103
- package/configs.js +0 -111
- package/dateValidation-67caec66.js +0 -225
- package/debounce-4419bc2f.js +0 -17
- package/guid-8ddf77b3.js +0 -16
- package/hooks/useBodyScroll.js +0 -16
- package/hooks/useClick.js +0 -18
- package/hooks/useClickOutside.js +0 -25
- package/hooks/useDebounce.js +0 -28
- package/hooks/useDeviceType.js +0 -17
- package/hooks/useDidMount.js +0 -15
- package/hooks/useForceUpdate.js +0 -8
- package/hooks/useHover.js +0 -20
- package/hooks/useImgDownload.js +0 -18
- package/hooks/useKeyDown.js +0 -21
- package/hooks/useMount.js +0 -13
- package/hooks/useMutationObserver.js +0 -21
- package/hooks/usePrevious.js +0 -10
- package/hooks/useThrottle.js +0 -16
- package/hooks/useToggle.js +0 -11
- package/hooks/useUpdatableRef.js +0 -14
- package/hooks/useUpdate.js +0 -10
- package/hooks/useWidth.js +0 -16
- package/hooks/useWindowSize.js +0 -40
- package/index-122432cd.js +0 -270
- package/index-262edd7a.js +0 -77
- package/index-3188e46e.js +0 -1940
- package/index-45eafea6.js +0 -90
- package/index-5f37f281.js +0 -168
- package/index-ce12e4a9.js +0 -10032
- package/index-d0ecb950.js +0 -6483
- package/index-fcbae78d.js +0 -4
- package/index.mobile.d.ts +0 -14
- package/lib/atoms/Avatar/index.d.ts +0 -1
- package/lib/atoms/Badge/Badge.d.ts +0 -36
- package/lib/atoms/Badge/index.d.ts +0 -1
- package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
- package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
- package/lib/atoms/BusyLoader/index.d.ts +0 -1
- package/lib/atoms/Button/Button.d.ts +0 -70
- package/lib/atoms/Button/index.d.ts +0 -1
- package/lib/atoms/Divider/index.d.ts +0 -1
- package/lib/atoms/Empty/Empty.d.ts +0 -39
- package/lib/atoms/Empty/index.d.ts +0 -1
- package/lib/atoms/Empty/utils.d.ts +0 -9
- package/lib/atoms/HelperText/index.d.ts +0 -1
- package/lib/atoms/Image/Image.d.ts +0 -51
- package/lib/atoms/Image/index.d.ts +0 -1
- package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
- package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
- package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
- package/lib/atoms/ImagePreview/index.d.ts +0 -1
- package/lib/atoms/Info/index.d.ts +0 -1
- package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
- package/lib/atoms/KeyValue/index.d.ts +0 -1
- package/lib/atoms/Label/index.d.ts +0 -1
- package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
- package/lib/atoms/LinkButton/index.d.ts +0 -1
- package/lib/atoms/Loader/index.d.ts +0 -1
- package/lib/atoms/Pill/index.d.ts +0 -1
- package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
- package/lib/atoms/Rating/Rating.d.ts +0 -49
- package/lib/atoms/Rating/index.d.ts +0 -1
- package/lib/atoms/TextLink/index.d.ts +0 -1
- package/lib/molecules/Copy/Copy.d.ts +0 -38
- package/lib/molecules/Copy/index.d.ts +0 -1
- package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
- package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
- package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
- package/lib/molecules/Tooltip/index.d.ts +0 -1
- package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
- package/lib/providers/GeneUIProvider/index.d.ts +0 -1
- package/localization-4ba17032.js +0 -46
- package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
- package/rangeAndSlider-740a236c.js +0 -8676
- package/react-beautiful-dnd.esm-8c7b5a83.js +0 -10116
- package/react-lifecycles-compat.es-6e1f3768.js +0 -158
- package/redux-e591c1b8.js +0 -536
- package/tokens-8ab1179c.js +0 -6
- package/tslib.es6-f211516f.js +0 -35
- package/useEllipsisDetection-c1c9ad94.js +0 -38
package/Timeline/index.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import { c as childrenOf } from '../index-5f37f281.js';
|
|
6
|
-
import Icon from '../Icon/index.js';
|
|
7
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
8
|
-
import '../dateValidation-67caec66.js';
|
|
9
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
10
|
-
import 'react-dom';
|
|
11
|
-
|
|
12
|
-
var css_248z$1 = "[data-gene-ui-version=\"2.16.4\"] .timeline-item{display:flex;font-weight:600;line-height:1.36}[data-gene-ui-version=\"2.16.4\"] .timeline-item.c-success{--hero:var(--confirm);--hero-hover:var(--confirm-hover);--hero-sc:var(--confirm-sc);--hero-rgb:var(--confirm-rgb);--hero-sc-rgb:var(--confirm-sc-rgb)}[data-gene-ui-version=\"2.16.4\"] .timeline-item.c-danger{--hero:var(--danger);--hero-hover:var(--danger-hover);--hero-sc:var(--danger-sc);--hero-rgb:var(--danger-rgb);--hero-sc-rgb:var(--danger-sc-rgb)}[data-gene-ui-version=\"2.16.4\"] .timeline-item:not(:last-child).with-line .t-line:before{background:rgba(var(--background-sc-rgb),.1)}[data-gene-ui-version=\"2.16.4\"] .timeline-item:not(:last-child) .t-texts{padding:0 0 2rem}[data-gene-ui-version=\"2.16.4\"] .timeline-item>li{display:flex}[data-gene-ui-version=\"2.16.4\"] .timeline-item.a-default .t-texts>*+*{margin:0 0 0 1rem}html[dir=rtl] .timeline-item.a-default .t-texts>*+*{margin:0 1rem 0 0}[data-gene-ui-version=\"2.16.4\"] .timeline-item.a-compact .t-texts{flex-direction:column}[data-gene-ui-version=\"2.16.4\"] .timeline-item.a-compact .t-texts>*+*{margin:.5rem 0 0}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-line{flex-shrink:0;position:relative}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-line:before{content:\"\";display:block;height:100%;margin:0 .5rem;width:1px}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-texts{flex:auto;margin:0 0 0 1.5rem}html[dir=rtl] .timeline-item .t-texts{margin:0 1.5rem 0 0}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-description{color:rgba(var(--background-sc-rgb),.6);font:600 1.2rem/1.8rem var(--font-family)}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-description,[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-title{max-width:100%}[data-gene-ui-version=\"2.16.4\"] .timeline-item .icon{background:var(--background);border-radius:100%;color:var(--hero);left:50%;position:absolute;top:0;transform:translate3d(-50%,-.3rem,0)}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-icon{background:var(--background);border:.2rem solid var(--hero);border-radius:100%;box-shadow:0 0 0 .4rem var(--background);font-size:1.5rem;height:1.1rem;left:0;position:absolute;top:.4rem;width:1.1rem}[data-gene-ui-version=\"2.16.4\"] .timeline-item .t-icon.bc-icon-loader{top:.2rem}";
|
|
13
|
-
styleInject(css_248z$1);
|
|
14
|
-
|
|
15
|
-
const timelineColors = ['hero', 'success', 'danger'];
|
|
16
|
-
const timelineAppearances = ['default', 'compact'];
|
|
17
|
-
function TimelineItem(props) {
|
|
18
|
-
const {
|
|
19
|
-
icon,
|
|
20
|
-
title,
|
|
21
|
-
color,
|
|
22
|
-
withLine,
|
|
23
|
-
isLoading,
|
|
24
|
-
className,
|
|
25
|
-
appearance,
|
|
26
|
-
description,
|
|
27
|
-
...restProps
|
|
28
|
-
} = props;
|
|
29
|
-
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
30
|
-
className: classnames('timeline-item', "a-".concat(appearance), "c-".concat(color), className, {
|
|
31
|
-
'with-line': withLine
|
|
32
|
-
})
|
|
33
|
-
}, restProps), /*#__PURE__*/React__default.createElement("li", {
|
|
34
|
-
className: "t-line"
|
|
35
|
-
}, isLoading ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
36
|
-
type: "bc-icon-loader"
|
|
37
|
-
}) : icon ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
38
|
-
type: icon
|
|
39
|
-
}) : /*#__PURE__*/React__default.createElement("div", {
|
|
40
|
-
className: "t-icon"
|
|
41
|
-
})), /*#__PURE__*/React__default.createElement("li", {
|
|
42
|
-
className: "t-texts"
|
|
43
|
-
}, !!title && /*#__PURE__*/React__default.createElement("div", {
|
|
44
|
-
className: "t-title"
|
|
45
|
-
}, title), !!description && /*#__PURE__*/React__default.createElement("div", {
|
|
46
|
-
className: "t-description"
|
|
47
|
-
}, description)));
|
|
48
|
-
}
|
|
49
|
-
TimelineItem.propTypes = {
|
|
50
|
-
/**
|
|
51
|
-
* Is loading state.
|
|
52
|
-
*/
|
|
53
|
-
isLoading: PropTypes.bool,
|
|
54
|
-
/**
|
|
55
|
-
* Title for item
|
|
56
|
-
*/
|
|
57
|
-
title: PropTypes.string,
|
|
58
|
-
/**
|
|
59
|
-
* Icon for item
|
|
60
|
-
*/
|
|
61
|
-
icon: PropTypes.string,
|
|
62
|
-
/**
|
|
63
|
-
* Render line between items
|
|
64
|
-
*/
|
|
65
|
-
withLine: PropTypes.bool,
|
|
66
|
-
/**
|
|
67
|
-
* Description fot item
|
|
68
|
-
*/
|
|
69
|
-
description: PropTypes.string,
|
|
70
|
-
/**
|
|
71
|
-
* External/Additional className
|
|
72
|
-
*/
|
|
73
|
-
className: PropTypes.string,
|
|
74
|
-
/**
|
|
75
|
-
* Different colors for items
|
|
76
|
-
*/
|
|
77
|
-
color: PropTypes.oneOf(timelineColors),
|
|
78
|
-
/**
|
|
79
|
-
* Any valid React node.
|
|
80
|
-
*/
|
|
81
|
-
appearance: PropTypes.oneOf(timelineAppearances)
|
|
82
|
-
};
|
|
83
|
-
TimelineItem.defaultProps = {
|
|
84
|
-
color: timelineColors[0],
|
|
85
|
-
withLine: true,
|
|
86
|
-
appearance: timelineAppearances[0]
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
var css_248z = "[data-gene-ui-version=\"2.16.4\"] .timeline-holder{display:flex;flex-direction:column}";
|
|
90
|
-
styleInject(css_248z);
|
|
91
|
-
|
|
92
|
-
function Timeline(props) {
|
|
93
|
-
const {
|
|
94
|
-
children,
|
|
95
|
-
className,
|
|
96
|
-
...restProps
|
|
97
|
-
} = props;
|
|
98
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
99
|
-
className: classnames('timeline-holder', className)
|
|
100
|
-
}, restProps), children);
|
|
101
|
-
}
|
|
102
|
-
Timeline.propTypes = {
|
|
103
|
-
/**
|
|
104
|
-
* External/Additional className
|
|
105
|
-
*/
|
|
106
|
-
className: PropTypes.string,
|
|
107
|
-
/**
|
|
108
|
-
* Any valid React node.
|
|
109
|
-
*/
|
|
110
|
-
children: childrenOf([TimelineItem])
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export { Timeline, TimelineItem, timelineAppearances, timelineColors };
|
package/Title/index.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import { t as titleConfig } from '../configs-00612ce0.js';
|
|
6
|
-
import Icon from '../Icon/index.js';
|
|
7
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
8
|
-
|
|
9
|
-
var css_248z = "[data-gene-ui-version=\"2.16.4\"] .title-holder{align-items:center;display:flex;font:600 1.4rem/1.8rem var(--font-family);min-height:3.2rem;width:100%}[data-gene-ui-version=\"2.16.4\"] .title-holder.c-hero .title-text{color:var(--hero)}[data-gene-ui-version=\"2.16.4\"] .title-holder>li{align-items:center;display:flex;flex-shrink:0}[data-gene-ui-version=\"2.16.4\"] .title-holder>li.line{flex:auto}[data-gene-ui-version=\"2.16.4\"] .title-holder>li.line i{background:rgba(var(--background-sc-rgb),.1);display:block;height:1px;width:100%}[data-gene-ui-version=\"2.16.4\"] .title-holder>li~li{margin:0 0 0 1rem}html[dir=rtl] .title-holder>li~li{margin:0 1rem 0 0}[data-gene-ui-version=\"2.16.4\"] .title-holder .divider{margin:0 1rem}";
|
|
10
|
-
styleInject(css_248z);
|
|
11
|
-
|
|
12
|
-
function Title(_ref) {
|
|
13
|
-
let {
|
|
14
|
-
icon,
|
|
15
|
-
text,
|
|
16
|
-
actions,
|
|
17
|
-
color,
|
|
18
|
-
withLine,
|
|
19
|
-
className,
|
|
20
|
-
...restProps
|
|
21
|
-
} = _ref;
|
|
22
|
-
return /*#__PURE__*/React__default.createElement("ul", _extends({
|
|
23
|
-
className: classnames('title-holder', "c-".concat(color), className)
|
|
24
|
-
}, restProps), icon && /*#__PURE__*/React__default.createElement("li", null, /*#__PURE__*/React__default.createElement(Icon, {
|
|
25
|
-
type: icon
|
|
26
|
-
})), /*#__PURE__*/React__default.createElement("li", {
|
|
27
|
-
className: "title-text"
|
|
28
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
29
|
-
className: "ellipsis-text"
|
|
30
|
-
}, text)), /*#__PURE__*/React__default.createElement("li", {
|
|
31
|
-
className: "line"
|
|
32
|
-
}, withLine && /*#__PURE__*/React__default.createElement("i", null)), actions && /*#__PURE__*/React__default.createElement("li", null, actions));
|
|
33
|
-
}
|
|
34
|
-
Title.propTypes = {
|
|
35
|
-
/**
|
|
36
|
-
* Display an icon. Values are the same as "Icon" atoms type prop
|
|
37
|
-
*/
|
|
38
|
-
icon: PropTypes.string,
|
|
39
|
-
/**
|
|
40
|
-
* Text/Component to be displayed. Any valid React node
|
|
41
|
-
*/
|
|
42
|
-
text: PropTypes.node.isRequired,
|
|
43
|
-
/**
|
|
44
|
-
* Actions to be displayed. Any valid React node
|
|
45
|
-
*/
|
|
46
|
-
actions: PropTypes.node,
|
|
47
|
-
/**
|
|
48
|
-
* Title color
|
|
49
|
-
*/
|
|
50
|
-
color: PropTypes.oneOf(titleConfig.color),
|
|
51
|
-
/**
|
|
52
|
-
* Displays a divider line
|
|
53
|
-
*/
|
|
54
|
-
withLine: PropTypes.bool,
|
|
55
|
-
/**
|
|
56
|
-
* Additional className
|
|
57
|
-
*/
|
|
58
|
-
className: PropTypes.string
|
|
59
|
-
};
|
|
60
|
-
Title.defaultProps = {
|
|
61
|
-
color: titleConfig.color[1],
|
|
62
|
-
withLine: false
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export { Title as default };
|
package/Toaster/index.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from '../_rollupPluginBabelHelpers-a83240e1.js';
|
|
2
|
-
import React__default, { useState, useCallback, useEffect } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { c as classnames } from '../index-031ff73c.js';
|
|
5
|
-
import '../dateValidation-67caec66.js';
|
|
6
|
-
import { g as guid } from '../guid-8ddf77b3.js';
|
|
7
|
-
import 'react-dom';
|
|
8
|
-
import Portal from '../Portal/index.js';
|
|
9
|
-
import Notification from '../Notification/index.js';
|
|
10
|
-
import Alert, { alertTypes } from '../Alert/index.js';
|
|
11
|
-
import { s as styleInject } from '../style-inject.es-746bb8ed.js';
|
|
12
|
-
import '../_commonjsHelpers-24198af3.js';
|
|
13
|
-
import '../GeneUIProvider/index.js';
|
|
14
|
-
import '../hooks/useDeviceType.js';
|
|
15
|
-
import '../configs-00612ce0.js';
|
|
16
|
-
import '../hooks/useWindowSize.js';
|
|
17
|
-
import '../hooks/useDebounce.js';
|
|
18
|
-
import '../Icon/index.js';
|
|
19
|
-
|
|
20
|
-
var css_248z = "[data-gene-ui-version=\"2.16.4\"] .toaster-holder{max-width:38rem;padding:1.5rem;position:fixed;width:100%;z-index:500}[data-gene-ui-version=\"2.16.4\"] .toaster-holder>*+*{margin:2rem 0 0}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.left-top{left:0;top:var(--header-height,0)}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.left-bottom{bottom:0;left:0}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.right-top{right:0;top:var(--header-height,0)}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.right-bottom{bottom:0;right:0}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.bottom,[data-gene-ui-version=\"2.16.4\"] .toaster-holder.top{left:50%;transform:translate3d(-50%,0,0)}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.top{top:var(--header-height,0)}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.bottom{bottom:0}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.mobile-view{transform:none;width:100%}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.mobile-view:not(.top,.bottom){padding:0}[data-gene-ui-version=\"2.16.4\"] .toaster-holder.mobile-view.center:not(.top,.bottom){padding:0 1.5rem}[data-gene-ui-version=\"2.16.4\"] .toaster-holder:empty{pointer-events:none}";
|
|
21
|
-
styleInject(css_248z);
|
|
22
|
-
|
|
23
|
-
const toasterPositions = ['top', 'bottom', 'center', 'left-top', 'left-bottom', 'right-top', 'right-bottom'];
|
|
24
|
-
function Toaster(_ref) {
|
|
25
|
-
let {
|
|
26
|
-
defaultDuration,
|
|
27
|
-
toasterPosition,
|
|
28
|
-
notificationPosition
|
|
29
|
-
} = _ref;
|
|
30
|
-
const [messages, setMessages] = useState([]);
|
|
31
|
-
const [notifications, setNotifications] = useState([]);
|
|
32
|
-
const removeItem = useCallback((key, id) => {
|
|
33
|
-
const setState = key === 'messages' ? setMessages : setNotifications;
|
|
34
|
-
setState(prev => prev.filter(item => item.id !== id));
|
|
35
|
-
}, []);
|
|
36
|
-
const runRenderTask = useCallback((key, duration, option) => {
|
|
37
|
-
const timerId = setTimeout(() => {
|
|
38
|
-
removeItem(key, option.id);
|
|
39
|
-
}, duration || defaultDuration);
|
|
40
|
-
const setState = key === 'messages' ? setMessages : setNotifications;
|
|
41
|
-
setState(prev => [...prev, {
|
|
42
|
-
...option,
|
|
43
|
-
onClose: e => {
|
|
44
|
-
removeItem(key, option.id);
|
|
45
|
-
clearTimeout(timerId);
|
|
46
|
-
option.onClose && option.onClose(e);
|
|
47
|
-
}
|
|
48
|
-
}]);
|
|
49
|
-
}, [defaultDuration, removeItem]);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
Toaster.notify = options => {
|
|
52
|
-
const {
|
|
53
|
-
duration,
|
|
54
|
-
...rest
|
|
55
|
-
} = options;
|
|
56
|
-
const notification = {
|
|
57
|
-
...rest,
|
|
58
|
-
id: guid()
|
|
59
|
-
};
|
|
60
|
-
runRenderTask('notifications', duration, notification);
|
|
61
|
-
};
|
|
62
|
-
alertTypes.forEach(type => {
|
|
63
|
-
Toaster[type] = options => {
|
|
64
|
-
const {
|
|
65
|
-
duration,
|
|
66
|
-
...rest
|
|
67
|
-
} = options;
|
|
68
|
-
const message = {
|
|
69
|
-
...rest,
|
|
70
|
-
type,
|
|
71
|
-
id: guid()
|
|
72
|
-
};
|
|
73
|
-
runRenderTask('messages', duration, message);
|
|
74
|
-
};
|
|
75
|
-
});
|
|
76
|
-
}, [runRenderTask]);
|
|
77
|
-
const createPortal = (Comp, options, className, position) => /*#__PURE__*/React__default.createElement(Portal, {
|
|
78
|
-
isOpen: !!options.length,
|
|
79
|
-
className: classnames(className, position)
|
|
80
|
-
}, options.map(option => {
|
|
81
|
-
const {
|
|
82
|
-
Component,
|
|
83
|
-
id,
|
|
84
|
-
...rest
|
|
85
|
-
} = option;
|
|
86
|
-
return /*#__PURE__*/React__default.isValidElement(Component) ? /*#__PURE__*/React__default.createElement(Component, _extends({
|
|
87
|
-
key: id
|
|
88
|
-
}, rest)) : /*#__PURE__*/React__default.createElement(Comp, _extends({
|
|
89
|
-
key: id
|
|
90
|
-
}, rest));
|
|
91
|
-
}));
|
|
92
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, createPortal(Alert, messages, 'toaster-holder', toasterPosition), createPortal(Notification, notifications, 'toaster-holder', notificationPosition));
|
|
93
|
-
}
|
|
94
|
-
Toaster.propTypes = {
|
|
95
|
-
/**
|
|
96
|
-
* Determines how long should component be displayed
|
|
97
|
-
*/
|
|
98
|
-
defaultDuration: PropTypes.number,
|
|
99
|
-
/**
|
|
100
|
-
* Determines toaster position on window,
|
|
101
|
-
* On of ['top', 'bottom', 'center', 'left-top', 'left-bottom', 'right-top', 'right-bottom']
|
|
102
|
-
*/
|
|
103
|
-
toasterPosition: PropTypes.string,
|
|
104
|
-
/**
|
|
105
|
-
* Determines notification position on window,
|
|
106
|
-
* On of ['top', 'bottom', 'center', 'left-top', 'left-bottom', 'right-top', 'right-bottom']
|
|
107
|
-
*/
|
|
108
|
-
notificationPosition: PropTypes.string
|
|
109
|
-
};
|
|
110
|
-
Toaster.defaultProps = {
|
|
111
|
-
defaultDuration: 4000,
|
|
112
|
-
toasterPosition: 'right-top',
|
|
113
|
-
notificationPosition: 'right-top'
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export { Toaster as default, toasterPositions };
|