@geneui/components 2.11.2 → 2.12.1
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/{ActionableList.js → ActionableList/index.js} +83 -152
- package/{AdvancedSearch.js → AdvancedSearch/index.js} +291 -304
- package/Alert/index.js +97 -0
- package/Avatar/index.js +30 -0
- package/Badge/index.js +75 -0
- package/{Breadcrumb.js → Breadcrumb/index.js} +32 -31
- package/BusyLoader/index.js +68 -0
- package/Button/index.js +129 -0
- package/CHANGELOG.md +40 -0
- package/{Card.js → Card/index.js} +82 -94
- package/{CardList.js → CardList/index.js} +118 -165
- package/{CellMeasurerCache-b786dd93.js → CellMeasurerCache-bc2163c1.js} +2 -2
- package/{index-9164a86d.js → Charts/index.js} +17103 -30447
- package/{Checkbox.js → Checkbox/index.js} +37 -38
- package/{CheckboxGroup.js → CheckboxGroup/index.js} +41 -42
- package/{CheckboxGroupWithSearch.js → CheckboxGroupWithSearch/index.js} +64 -65
- package/{Collapse.js → Collapse/index.js} +28 -29
- package/{ColorPicker.js → ColorPicker/index.js} +16 -16
- package/ComboBox/index.js +525 -0
- package/Counter/index.js +310 -0
- package/{DateFilter.js → DateFilter/index.js} +46 -43
- package/{DatePicker.js → DatePicker/index.js} +106 -108
- package/{index-0199942c.js → DatePickerInput/index.js} +103 -89
- package/{Divider.js → Divider/index.js} +9 -10
- package/{Drawer.js → Drawer/index.js} +40 -41
- package/Dropdown/index.js +41 -0
- package/{Editor.js → Editor/index.js} +165 -164
- package/{Empty.js → Empty/index.js} +12 -13
- package/{ExtendedInput.js → ExtendedInput/index.js} +81 -71
- package/Form/index.js +86 -0
- package/{FormContainer.js → FormContainer/index.js} +25 -26
- package/FormableCheckbox/index.js +26 -0
- package/FormableDatePicker/index.js +42 -0
- package/FormableDropdown/index.js +48 -0
- package/FormableEditor/index.js +24 -0
- package/{FormableHOC-21051057.js → FormableHOC-55263162.js} +3 -3
- package/FormableMultiSelectDropdown/index.js +48 -0
- package/FormableNumberInput/index.js +32 -0
- package/FormableRadio/index.js +22 -0
- package/FormableSwitcher/index.js +22 -0
- package/FormableTextInput/index.js +32 -0
- package/FormableUploader/index.js +42 -0
- package/GeneUIProvider/index.js +282 -0
- package/{Grid.js → Grid/index.js} +27 -27
- package/Holder/index.js +261 -0
- package/{Icon.js → Icon/index.js} +9 -10
- package/Image/index.js +129 -0
- package/ImagePreview/index.js +481 -0
- package/{KeyValue.js → KeyValue/index.js} +11 -12
- package/LICENSE +21 -0
- package/Label/index.js +57 -0
- package/LinkButton/index.js +67 -0
- package/{Menu.js → Menu/index.js} +27 -28
- package/MobileNavigation/index.js +94 -0
- package/{MobilePopup.js → MobilePopup/index.js} +42 -41
- package/{Modal.js → Modal/index.js} +39 -40
- package/ModuleTitle/index.js +143 -0
- package/{NavigationMenu.js → NavigationMenu/index.js} +30 -29
- package/Notification/index.js +119 -0
- package/Option/index.js +184 -0
- package/Overlay/index.js +189 -0
- package/Overspread/index.js +287 -0
- package/{Pagination.js → Pagination/index.js} +35 -34
- package/Paper/index.js +96 -0
- package/{index-084588e9.js → Popover/index.js} +48 -58
- package/{index-5e96cb4d.js → PopoverV2/index.js} +57 -1006
- package/{Portal.js → Portal/index.js} +7 -8
- package/{Products.js → Products/index.js} +20 -21
- package/Profile/index.js +585 -0
- package/Progress/index.js +199 -0
- package/{QRCode.js → QRCode/index.js} +4 -6
- package/{Radio.js → Radio/index.js} +25 -26
- package/{RadioGroup.js → RadioGroup/index.js} +17 -18
- package/{index-00fe8887.js → Range/index.js} +29 -32
- package/RichEditor/index.js +13 -0
- package/{RichEditor-98accead.js → RichEditor-8b9c3afa.js} +18 -18
- package/{Scrollbar.js → Scrollbar/index.js} +15 -17
- package/{Search.js → Search/index.js} +25 -24
- package/SearchWithDropdown/index.js +138 -0
- package/Section/index.js +61 -0
- package/{SkeletonLoader.js → SkeletonLoader/index.js} +13 -14
- package/{Slider.js → Slider/index.js} +46 -43
- package/Status/index.js +103 -0
- package/Steps/index.js +313 -0
- package/{index-897d8240.js → SuggestionList/index.js} +15 -38
- package/{Switcher.js → Switcher/index.js} +30 -31
- package/Table/index.js +53 -0
- package/{TableCompositions.js → TableCompositions/index.js} +132 -168
- package/Tabs/index.js +235 -0
- package/Tag/index.js +102 -0
- package/{TextLink.js → TextLink/index.js} +3 -3
- package/{Textarea.js → Textarea/index.js} +66 -65
- package/{Time.js → Time/index.js} +13 -14
- package/TimePicker/index.js +556 -0
- package/Timeline/index.js +113 -0
- package/Title/index.js +65 -0
- package/{Toaster.js → Toaster/index.js} +19 -20
- package/{Tooltip.js → Tooltip/index.js} +27 -28
- package/{TransferList.js → TransferList/index.js} +44 -55
- package/{index-135b9d17.js → Uploader/index.js} +119 -116
- package/{ValidatableCheckbox.js → ValidatableCheckbox/index.js} +23 -24
- package/{ValidatableDatePicker.js → ValidatableDatePicker/index.js} +45 -42
- package/ValidatableDropdown/index.js +139 -0
- package/ValidatableElements/index.js +68 -0
- package/ValidatableMultiSelectDropdown/index.js +150 -0
- package/{ValidatableNumberInput.js → ValidatableNumberInput/index.js} +34 -33
- package/{ValidatableRadio.js → ValidatableRadio/index.js} +19 -20
- package/{ValidatableSwitcher.js → ValidatableSwitcher/index.js} +19 -20
- package/{ValidatableTextInput.js → ValidatableTextInput/index.js} +32 -31
- package/{ValidatableTimeInput.js → ValidatableTimeInput/index.js} +31 -30
- package/{ValidatableUploader.js → ValidatableUploader/index.js} +36 -34
- package/Widget/index.js +227 -0
- package/config-0ca92874.js +31 -0
- package/{configs-91c86664.js → configs-fed6ac34.js} +28 -1
- package/hooks/useBodyScroll.js +16 -0
- package/hooks/useClick.js +18 -0
- package/{useClickOutside-5183e396.js → hooks/useClickOutside.js} +1 -1
- package/hooks/useDebounceHook.js +16 -0
- package/{useDeviceType-dd51db38.js → hooks/useDeviceType.js} +4 -3
- package/hooks/useDidMount.js +15 -0
- package/{useEllipsisDetection-ef536015.js → hooks/useEllipsisDetection.js} +1 -1
- package/hooks/useForceUpdate.js +8 -0
- package/hooks/useImgDownload.js +18 -0
- package/{useKeyDown-38102ae7.js → hooks/useKeyDown.js} +1 -1
- package/hooks/useMount.js +13 -0
- package/hooks/useMutationObserver.js +21 -0
- package/hooks/usePrevious.js +10 -0
- package/hooks/useThrottle.js +16 -0
- package/hooks/useToggle.js +11 -0
- package/hooks/useUpdatableRef.js +14 -0
- package/hooks/useUpdate.js +10 -0
- package/{useWidth-9f4647f8.js → hooks/useWidth.js} +2 -2
- package/{useWindowSize-80369d76.js → hooks/useWindowSize.js} +1 -1
- package/index-45eafea6.js +90 -0
- package/index-583e0b30.js +4 -0
- package/{index-8c98317a.js → index-78d2ea5b.js} +678 -752
- package/{index-ac59cb10.js → index-a0e4e333.js} +6 -6
- package/{index-e8776f3d.js → index-b1e429a7.js} +1 -1
- package/index-bd525a3a.js +10054 -0
- package/index.d.ts +115 -0
- package/index.js +138 -113
- package/index.mobile.d.ts +16 -0
- package/jsx-runtime-57b40d9e.js +957 -0
- package/lib/atoms/Avatar/Avatar.d.ts +34 -0
- package/lib/atoms/Avatar/index.d.ts +1 -0
- package/lib/atoms/LinkButton/LinkButton.d.ts +46 -0
- package/lib/atoms/LinkButton/index.d.ts +1 -0
- package/{objectWithoutPropertiesLoose-299691d8.js → objectWithoutPropertiesLoose-d8a4a68c.js} +12 -12
- package/package.json +42 -22
- package/{rangeAndSlider-20599da4.js → rangeAndSlider-0301a458.js} +220 -375
- package/{react-beautiful-dnd.esm-38c37304.js → react-beautiful-dnd.esm-04c14563.js} +9 -9
- package/react-lifecycles-compat.es-6e1f3768.js +158 -0
- package/Alert.js +0 -98
- package/Avatar.js +0 -77
- package/Badge.js +0 -76
- package/BusyLoader.js +0 -69
- package/Button.js +0 -130
- package/Charts.js +0 -99
- package/ComboBox.js +0 -99
- package/Counter.js +0 -99
- package/DatePickerInput.js +0 -30
- package/Dropdown.js +0 -99
- package/Form.js +0 -116
- package/FormableCheckbox.js +0 -27
- package/FormableDatePicker.js +0 -39
- package/FormableDropdown.js +0 -105
- package/FormableEditor.js +0 -24
- package/FormableMultiSelectDropdown.js +0 -105
- package/FormableNumberInput.js +0 -31
- package/FormableRadio.js +0 -23
- package/FormableSwitcher.js +0 -23
- package/FormableTextInput.js +0 -31
- package/FormableUploader.js +0 -40
- package/GeneUIProvider.js +0 -256
- package/Holder.js +0 -99
- package/Image.js +0 -130
- package/ImagePreview.js +0 -99
- package/Label.js +0 -58
- package/LinkButton.js +0 -104
- package/MobileNavigation.js +0 -95
- package/ModuleTitle.js +0 -99
- package/Notification.js +0 -120
- package/Option.js +0 -186
- package/Overlay.js +0 -99
- package/Overspread.js +0 -343
- package/Paper.js +0 -97
- package/Popover.js +0 -20
- package/PopoverV2.js +0 -19
- package/Profile.js +0 -99
- package/Progress.js +0 -200
- package/Range.js +0 -14
- package/RichEditor.js +0 -13
- package/SearchWithDropdown.js +0 -195
- package/Section.js +0 -62
- package/Status.js +0 -104
- package/Steps.js +0 -312
- package/SuggestionList.js +0 -15
- package/Table.js +0 -102
- package/Tabs.js +0 -236
- package/Tag.js +0 -103
- package/TimePicker.js +0 -99
- package/Timeline.js +0 -114
- package/Title.js +0 -66
- package/Uploader.js +0 -32
- package/ValidatableDropdown.js +0 -99
- package/ValidatableElements.js +0 -99
- package/ValidatableMultiSelectDropdown.js +0 -99
- package/Widget.js +0 -99
- package/globalStyling-9c60a159.js +0 -4
- package/index-2030e31c.js +0 -4
- package/index-b7a33c58.js +0 -11
- package/index-e0af0caf.js +0 -1182
- package/useMount-6fef51a5.js +0 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useLayoutEffect, useEffect, useMemo as useMemo$1, useContext, useReducer, useRef, useState } from 'react';
|
|
2
|
-
import { a as _setPrototypeOf, b as _objectWithoutPropertiesLoose, c as _extends } from './objectWithoutPropertiesLoose-
|
|
3
|
-
import { r as reactIsExports$1, c as compose, b as bindActionCreators$1, a as createStore$1, d as applyMiddleware } from './index-
|
|
4
|
-
import
|
|
2
|
+
import { a as _setPrototypeOf, b as _objectWithoutPropertiesLoose, c as _extends } from './objectWithoutPropertiesLoose-d8a4a68c.js';
|
|
3
|
+
import { r as reactIsExports$1, c as compose, b as bindActionCreators$1, a as createStore$1, d as applyMiddleware } from './index-b1e429a7.js';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
import ReactDOM__default, { unstable_batchedUpdates } from 'react-dom';
|
|
6
6
|
|
|
7
7
|
function _inheritsLoose(subClass, superClass) {
|
|
@@ -203,13 +203,13 @@ function Provider(_ref) {
|
|
|
203
203
|
|
|
204
204
|
if (process.env.NODE_ENV !== 'production') {
|
|
205
205
|
Provider.propTypes = {
|
|
206
|
-
store:
|
|
207
|
-
subscribe:
|
|
208
|
-
dispatch:
|
|
209
|
-
getState:
|
|
206
|
+
store: PropTypes.shape({
|
|
207
|
+
subscribe: PropTypes.func.isRequired,
|
|
208
|
+
dispatch: PropTypes.func.isRequired,
|
|
209
|
+
getState: PropTypes.func.isRequired
|
|
210
210
|
}),
|
|
211
|
-
context:
|
|
212
|
-
children:
|
|
211
|
+
context: PropTypes.object,
|
|
212
|
+
children: PropTypes.any
|
|
213
213
|
};
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
function componentWillMount() {
|
|
9
|
+
// Call this.constructor.gDSFP to support sub-classes.
|
|
10
|
+
var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
|
|
11
|
+
if (state !== null && state !== undefined) {
|
|
12
|
+
this.setState(state);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function componentWillReceiveProps(nextProps) {
|
|
17
|
+
// Call this.constructor.gDSFP to support sub-classes.
|
|
18
|
+
// Use the setState() updater to ensure state isn't stale in certain edge cases.
|
|
19
|
+
function updater(prevState) {
|
|
20
|
+
var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
|
|
21
|
+
return state !== null && state !== undefined ? state : null;
|
|
22
|
+
}
|
|
23
|
+
// Binding "this" is important for shallow renderer support.
|
|
24
|
+
this.setState(updater.bind(this));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function componentWillUpdate(nextProps, nextState) {
|
|
28
|
+
try {
|
|
29
|
+
var prevProps = this.props;
|
|
30
|
+
var prevState = this.state;
|
|
31
|
+
this.props = nextProps;
|
|
32
|
+
this.state = nextState;
|
|
33
|
+
this.__reactInternalSnapshotFlag = true;
|
|
34
|
+
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
|
|
35
|
+
prevProps,
|
|
36
|
+
prevState
|
|
37
|
+
);
|
|
38
|
+
} finally {
|
|
39
|
+
this.props = prevProps;
|
|
40
|
+
this.state = prevState;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// React may warn about cWM/cWRP/cWU methods being deprecated.
|
|
45
|
+
// Add a flag to suppress these warnings for this special case.
|
|
46
|
+
componentWillMount.__suppressDeprecationWarning = true;
|
|
47
|
+
componentWillReceiveProps.__suppressDeprecationWarning = true;
|
|
48
|
+
componentWillUpdate.__suppressDeprecationWarning = true;
|
|
49
|
+
|
|
50
|
+
function polyfill(Component) {
|
|
51
|
+
var prototype = Component.prototype;
|
|
52
|
+
|
|
53
|
+
if (!prototype || !prototype.isReactComponent) {
|
|
54
|
+
throw new Error('Can only polyfill class components');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (
|
|
58
|
+
typeof Component.getDerivedStateFromProps !== 'function' &&
|
|
59
|
+
typeof prototype.getSnapshotBeforeUpdate !== 'function'
|
|
60
|
+
) {
|
|
61
|
+
return Component;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// If new component APIs are defined, "unsafe" lifecycles won't be called.
|
|
65
|
+
// Error if any of these lifecycles are present,
|
|
66
|
+
// Because they would work differently between older and newer (16.3+) versions of React.
|
|
67
|
+
var foundWillMountName = null;
|
|
68
|
+
var foundWillReceivePropsName = null;
|
|
69
|
+
var foundWillUpdateName = null;
|
|
70
|
+
if (typeof prototype.componentWillMount === 'function') {
|
|
71
|
+
foundWillMountName = 'componentWillMount';
|
|
72
|
+
} else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
|
|
73
|
+
foundWillMountName = 'UNSAFE_componentWillMount';
|
|
74
|
+
}
|
|
75
|
+
if (typeof prototype.componentWillReceiveProps === 'function') {
|
|
76
|
+
foundWillReceivePropsName = 'componentWillReceiveProps';
|
|
77
|
+
} else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
|
|
78
|
+
foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
|
|
79
|
+
}
|
|
80
|
+
if (typeof prototype.componentWillUpdate === 'function') {
|
|
81
|
+
foundWillUpdateName = 'componentWillUpdate';
|
|
82
|
+
} else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
|
|
83
|
+
foundWillUpdateName = 'UNSAFE_componentWillUpdate';
|
|
84
|
+
}
|
|
85
|
+
if (
|
|
86
|
+
foundWillMountName !== null ||
|
|
87
|
+
foundWillReceivePropsName !== null ||
|
|
88
|
+
foundWillUpdateName !== null
|
|
89
|
+
) {
|
|
90
|
+
var componentName = Component.displayName || Component.name;
|
|
91
|
+
var newApiName =
|
|
92
|
+
typeof Component.getDerivedStateFromProps === 'function'
|
|
93
|
+
? 'getDerivedStateFromProps()'
|
|
94
|
+
: 'getSnapshotBeforeUpdate()';
|
|
95
|
+
|
|
96
|
+
throw Error(
|
|
97
|
+
'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
|
|
98
|
+
componentName +
|
|
99
|
+
' uses ' +
|
|
100
|
+
newApiName +
|
|
101
|
+
' but also contains the following legacy lifecycles:' +
|
|
102
|
+
(foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
|
|
103
|
+
(foundWillReceivePropsName !== null
|
|
104
|
+
? '\n ' + foundWillReceivePropsName
|
|
105
|
+
: '') +
|
|
106
|
+
(foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
|
|
107
|
+
'\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
|
|
108
|
+
'https://fb.me/react-async-component-lifecycle-hooks'
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// React <= 16.2 does not support static getDerivedStateFromProps.
|
|
113
|
+
// As a workaround, use cWM and cWRP to invoke the new static lifecycle.
|
|
114
|
+
// Newer versions of React will ignore these lifecycles if gDSFP exists.
|
|
115
|
+
if (typeof Component.getDerivedStateFromProps === 'function') {
|
|
116
|
+
prototype.componentWillMount = componentWillMount;
|
|
117
|
+
prototype.componentWillReceiveProps = componentWillReceiveProps;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// React <= 16.2 does not support getSnapshotBeforeUpdate.
|
|
121
|
+
// As a workaround, use cWU to invoke the new lifecycle.
|
|
122
|
+
// Newer versions of React will ignore that lifecycle if gSBU exists.
|
|
123
|
+
if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
|
|
124
|
+
if (typeof prototype.componentDidUpdate !== 'function') {
|
|
125
|
+
throw new Error(
|
|
126
|
+
'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
prototype.componentWillUpdate = componentWillUpdate;
|
|
131
|
+
|
|
132
|
+
var componentDidUpdate = prototype.componentDidUpdate;
|
|
133
|
+
|
|
134
|
+
prototype.componentDidUpdate = function componentDidUpdatePolyfill(
|
|
135
|
+
prevProps,
|
|
136
|
+
prevState,
|
|
137
|
+
maybeSnapshot
|
|
138
|
+
) {
|
|
139
|
+
// 16.3+ will not execute our will-update method;
|
|
140
|
+
// It will pass a snapshot value to did-update though.
|
|
141
|
+
// Older versions will require our polyfilled will-update value.
|
|
142
|
+
// We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
|
|
143
|
+
// Because for <= 15.x versions this might be a "prevContext" object.
|
|
144
|
+
// We also can't just check "__reactInternalSnapshot",
|
|
145
|
+
// Because get-snapshot might return a falsy value.
|
|
146
|
+
// So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
|
|
147
|
+
var snapshot = this.__reactInternalSnapshotFlag
|
|
148
|
+
? this.__reactInternalSnapshot
|
|
149
|
+
: maybeSnapshot;
|
|
150
|
+
|
|
151
|
+
componentDidUpdate.call(this, prevProps, prevState, snapshot);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return Component;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export { polyfill as p };
|
package/Alert.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from './_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
-
import React__default from 'react';
|
|
3
|
-
import { p as propTypesExports } from './index-e0af0caf.js';
|
|
4
|
-
import { c as classnames } from './index-6ff23041.js';
|
|
5
|
-
import { s as screenTypes } from './configs-91c86664.js';
|
|
6
|
-
import './dateValidation-67caec66.js';
|
|
7
|
-
import 'react-dom';
|
|
8
|
-
import { u as useDeviceType } from './useDeviceType-dd51db38.js';
|
|
9
|
-
import Icon from './Icon.js';
|
|
10
|
-
import './globalStyling-9c60a159.js';
|
|
11
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
12
|
-
import './_commonjsHelpers-24198af3.js';
|
|
13
|
-
import './useWindowSize-80369d76.js';
|
|
14
|
-
|
|
15
|
-
var css_248z = "[data-gene-ui-version=\"1.0.0\"] .alert-holder{background:var(--background);border-radius:.6rem;width:100%;word-break:break-word}[data-gene-ui-version=\"1.0.0\"] .toaster-holder.top .alert-holder.mobile-view:first-child,[data-gene-ui-version=\"1.0.0\"] .toaster-holder.top .alert-holder.mobile-view:first-child .alert-box{border-top-left-radius:0;border-top-right-radius:0}[data-gene-ui-version=\"1.0.0\"] .toaster-holder.bottom .alert-holder.mobile-view:last-child,[data-gene-ui-version=\"1.0.0\"] .toaster-holder.bottom .alert-holder.mobile-view:last-child .alert-box{border-bottom-left-radius:0;border-bottom-right-radius:0}[data-gene-ui-version=\"1.0.0\"] .alert-box{background:rgba(var(--confirm-rgb),.1);border:1px solid var(--confirm);border-radius:.6rem;display:flex;min-height:4.2rem;padding:.8rem .7rem;width:100%}[data-gene-ui-version=\"1.0.0\"] .alert-box.type-info{--confirm:var(--hero);--confirm-hover:var(--hero-hover);--confirm-sc:var(--hero-sc);--confirm-rgb:var(--hero-rgb);--confirm-sc-rgb:var(--hero-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .alert-box.type-warning{--confirm:var(--warning);--confirm-hover:var(--warning-hover);--confirm-sc:var(--warning-sc);--confirm-rgb:var(--warning-rgb);--confirm-sc-rgb:var(--warning-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .alert-box.type-error{--confirm:var(--danger);--confirm-hover:var(--danger-hover);--confirm-sc:var(--danger-sc);--confirm-rgb:var(--danger-rgb);--confirm-sc-rgb:var(--danger-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .alert-box.type-note{--confirm:var(--note);--confirm-hover:var(--note-hover);--confirm-sc:var(--note-sc);--confirm-rgb:var(--note-rgb);--confirm-sc-rgb:var(--note-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .alert-box.type-message{--confirm:var(--message);--confirm-hover:var(--message-hover);--confirm-sc:var(--message-sc);--confirm-rgb:var(--message-rgb);--confirm-sc-rgb:var(--message-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .alert-holder.mobile-view .alert-box{border-bottom-color:rgba(var(--background-sc-rgb),.1);border-width:0 0 1px}[data-gene-ui-version=\"1.0.0\"] .toaster-holder:not(.top,.bottom,.center) .alert-holder.mobile-view .alert-box{border-radius:0}[data-gene-ui-version=\"1.0.0\"] .alert-box>li{flex-shrink:0;padding:0 .7rem}[data-gene-ui-version=\"1.0.0\"] .alert-box>li.ab-c-c{align-self:center;flex:auto;margin:.4rem 0}[data-gene-ui-version=\"1.0.0\"] .alert-box>li.ab-bc-icon-c{max-width:100%}[data-gene-ui-version=\"1.0.0\"] .alert-box>li a,[data-gene-ui-version=\"1.0.0\"] .alert-box>li.ab-bc-icon-c{color:var(--confirm)}[data-gene-ui-version=\"1.0.0\"] .alert-box .bc-icon-close{cursor:pointer}@media (hover:hover){[data-gene-ui-version=\"1.0.0\"] .alert-box .bc-icon-close:hover{color:var(--confirm)}}[data-gene-ui-version=\"1.0.0\"] .alert-box a{color:var(--hero);font-weight:600}[data-gene-ui-version=\"1.0.0\"] .alert-box-title{font:600 1.4rem/1.8rem var(--font-family)}[data-gene-ui-version=\"1.0.0\"] .alert-text{font:600 1.2rem/1.42 var(--font-family);margin:.8rem 0 0}";
|
|
16
|
-
styleInject(css_248z);
|
|
17
|
-
|
|
18
|
-
const alertTypes = ['success', 'info', 'warning', 'error', 'note', 'message'];
|
|
19
|
-
function Alert(_ref) {
|
|
20
|
-
let {
|
|
21
|
-
type,
|
|
22
|
-
title,
|
|
23
|
-
onClose,
|
|
24
|
-
message,
|
|
25
|
-
screenType,
|
|
26
|
-
iconProps,
|
|
27
|
-
swapIcon,
|
|
28
|
-
className,
|
|
29
|
-
...rest
|
|
30
|
-
} = _ref;
|
|
31
|
-
const {
|
|
32
|
-
isMobile
|
|
33
|
-
} = useDeviceType(screenType);
|
|
34
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
35
|
-
className: classnames('alert-holder', {
|
|
36
|
-
'mobile-view': isMobile
|
|
37
|
-
}, className)
|
|
38
|
-
}, rest), /*#__PURE__*/React__default.createElement("ul", {
|
|
39
|
-
className: classnames('alert-box', "type-".concat(type))
|
|
40
|
-
}, (swapIcon || iconProps) && /*#__PURE__*/React__default.createElement("li", {
|
|
41
|
-
className: "ab-bc-icon-c"
|
|
42
|
-
}, swapIcon || /*#__PURE__*/React__default.createElement(Icon, {
|
|
43
|
-
type: "bc-icon-".concat(type === 'warning' ? 'info' : type).concat(iconProps.isFilled ? '-fill' : '')
|
|
44
|
-
})), /*#__PURE__*/React__default.createElement("li", {
|
|
45
|
-
className: "ab-c-c"
|
|
46
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
47
|
-
className: "alert-box-title"
|
|
48
|
-
}, title), message && /*#__PURE__*/React__default.createElement("div", {
|
|
49
|
-
className: "alert-text"
|
|
50
|
-
}, message)), !!onClose && /*#__PURE__*/React__default.createElement("li", {
|
|
51
|
-
className: "ab-action-c",
|
|
52
|
-
onClick: onClose
|
|
53
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
54
|
-
type: "bc-icon-close"
|
|
55
|
-
}))));
|
|
56
|
-
}
|
|
57
|
-
Alert.propTypes = {
|
|
58
|
-
/**
|
|
59
|
-
* Alert type is for specifying information message to be delivered. Also a corresponding "Icon" atom will be displayed
|
|
60
|
-
*/
|
|
61
|
-
type: propTypesExports.oneOf(alertTypes),
|
|
62
|
-
/**
|
|
63
|
-
* Main field to describe alert information. Any valid React node
|
|
64
|
-
*/
|
|
65
|
-
title: propTypesExports.node.isRequired,
|
|
66
|
-
/**
|
|
67
|
-
* Additional classname
|
|
68
|
-
*/
|
|
69
|
-
className: propTypesExports.string,
|
|
70
|
-
/**
|
|
71
|
-
* Use this field for describing information more verbose. Any valid React node
|
|
72
|
-
*/
|
|
73
|
-
message: propTypesExports.node,
|
|
74
|
-
/**
|
|
75
|
-
* The switch between mobile and desktop version of Alert will be applied automatically, when the prop is not specified.
|
|
76
|
-
* When the prop is present it must be changed from outside.
|
|
77
|
-
*/
|
|
78
|
-
screenType: propTypesExports.oneOf(screenTypes),
|
|
79
|
-
/**
|
|
80
|
-
* When function is passed an "Icon" atom("type": "bc-icon-close") will be displayed((event: Event) => void).
|
|
81
|
-
*/
|
|
82
|
-
onClose: propTypesExports.func,
|
|
83
|
-
/**
|
|
84
|
-
* Same as "Icon" atom props
|
|
85
|
-
*/
|
|
86
|
-
iconProps: propTypesExports.shape({
|
|
87
|
-
...Icon.propTypes
|
|
88
|
-
}),
|
|
89
|
-
/**
|
|
90
|
-
* Use this prop for replace main "Icon". Note that when the prop is specified "type" prop will not work(will be overlooked).
|
|
91
|
-
*/
|
|
92
|
-
swapIcon: propTypesExports.node
|
|
93
|
-
};
|
|
94
|
-
Alert.defaultProps = {
|
|
95
|
-
type: 'info'
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export { alertTypes, Alert as default };
|
package/Avatar.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { p as propTypesExports } from './index-e0af0caf.js';
|
|
3
|
-
import { c as classnames } from './index-6ff23041.js';
|
|
4
|
-
import { g as getInitials, n as noop } from './index-ac59cb10.js';
|
|
5
|
-
import './globalStyling-9c60a159.js';
|
|
6
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
7
|
-
import './dateValidation-67caec66.js';
|
|
8
|
-
import './_commonjsHelpers-24198af3.js';
|
|
9
|
-
import 'react-dom';
|
|
10
|
-
|
|
11
|
-
var css_248z = "[data-gene-ui-version=\"1.0.0\"] .user-avatar-c{--size:2.6rem;background:var(--background-sc) no-repeat 50% 50%/cover;border-radius:.3rem;box-shadow:0 0 0 0 rgba(var(--background-sc-rgb),.2);color:var(--background);font:600 calc(var(--size)/2.3)/var(--size) var(--font-family);height:var(--size);text-align:center;transition:box-shadow .3s;width:var(--size)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.clickable{cursor:pointer}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.clickable:hover{box-shadow:0 0 0 .3rem rgba(var(--background-sc-rgb),.2)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c:not(.color-default){background:var(--background) no-repeat 50% 50%/cover;box-shadow:0 0 0 0 rgba(var(--background-rgb),.2);color:var(--background-sc)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c:not(.color-default).clickable:hover{box-shadow:0 0 0 .3rem rgba(var(--background-rgb),.2)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.color-green{--background:var(--confirm);--background-hover:var(--confirm-hover);--background-sc:var(--confirm-sc);--background-rgb:var(--confirm-rgb);--background-sc-rgb:var(--confirm-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.color-red{--background:var(--danger);--background-hover:var(--danger-hover);--background-sc:var(--danger-sc);--background-rgb:var(--danger-rgb);--background-sc-rgb:var(--danger-sc-rgb)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.shape-circle{border-radius:100%}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.text-small{font-size:calc(var(--size)/2.5)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c[class*=bc-icon-]{font-size:calc(var(--size)/2);line-height:var(--size)}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.size-small{--size:2.2rem}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.size-medium{--size:3.6rem}[data-gene-ui-version=\"1.0.0\"] .user-avatar-c.size-big{--size:4.6rem}";
|
|
12
|
-
styleInject(css_248z);
|
|
13
|
-
|
|
14
|
-
function Avatar(_ref) {
|
|
15
|
-
let {
|
|
16
|
-
src,
|
|
17
|
-
icon,
|
|
18
|
-
size,
|
|
19
|
-
color,
|
|
20
|
-
shape,
|
|
21
|
-
onClick,
|
|
22
|
-
children
|
|
23
|
-
} = _ref;
|
|
24
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
25
|
-
className: classnames('user-avatar-c', {
|
|
26
|
-
["size-".concat(size)]: size,
|
|
27
|
-
["color-".concat(color)]: color,
|
|
28
|
-
["shape-".concat(shape)]: shape,
|
|
29
|
-
[icon]: !src && icon,
|
|
30
|
-
'text-small': typeof children === 'string' && children.length > 1,
|
|
31
|
-
clickable: !!onClick
|
|
32
|
-
}),
|
|
33
|
-
style: {
|
|
34
|
-
backgroundImage: src ? "url(".concat(src, ")") : ''
|
|
35
|
-
},
|
|
36
|
-
onClick: onClick
|
|
37
|
-
}, !src && !icon && children && getInitials(children));
|
|
38
|
-
}
|
|
39
|
-
Avatar.propTypes = {
|
|
40
|
-
/**
|
|
41
|
-
* Background image source
|
|
42
|
-
*/
|
|
43
|
-
src: propTypesExports.string,
|
|
44
|
-
/**
|
|
45
|
-
* The property will show icon. This property will work when "src" is not specified.
|
|
46
|
-
*/
|
|
47
|
-
icon: propTypesExports.string,
|
|
48
|
-
/**
|
|
49
|
-
* The property will show first two letters in upper case. This will work when "src" or "icon" are not specified.
|
|
50
|
-
*/
|
|
51
|
-
children: propTypesExports.string,
|
|
52
|
-
/**
|
|
53
|
-
* Avatar size
|
|
54
|
-
*/
|
|
55
|
-
size: propTypesExports.oneOf(['small', 'default', 'medium', 'big']),
|
|
56
|
-
/**
|
|
57
|
-
* Avatar color
|
|
58
|
-
*/
|
|
59
|
-
color: propTypesExports.oneOf(['default', 'green', 'red']),
|
|
60
|
-
/**
|
|
61
|
-
* Avatar shape
|
|
62
|
-
*/
|
|
63
|
-
shape: propTypesExports.oneOf(['circle', 'square']),
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
* Handle click event on avatar component((event: Event) => void 0).
|
|
67
|
-
*/
|
|
68
|
-
onClick: propTypesExports.func
|
|
69
|
-
};
|
|
70
|
-
Avatar.defaultProps = {
|
|
71
|
-
onClick: noop,
|
|
72
|
-
size: 'default',
|
|
73
|
-
color: 'default',
|
|
74
|
-
shape: 'circle'
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { Avatar as default };
|
package/Badge.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from './_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
-
import React__default, { useMemo } from 'react';
|
|
3
|
-
import { p as propTypesExports } from './index-e0af0caf.js';
|
|
4
|
-
import { c as classnames } from './index-6ff23041.js';
|
|
5
|
-
import './globalStyling-9c60a159.js';
|
|
6
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
7
|
-
import { badgeConfig } from './configs.js';
|
|
8
|
-
|
|
9
|
-
var css_248z = "[data-gene-ui-version=\"1.0.0\"] .badge{max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;position:relative}[data-gene-ui-version=\"1.0.0\"] .badge__content{background:var(--danger);border-radius:3rem;color:var(--danger-sc);display:block;font:600 1rem/1.6rem var(--font-family);min-width:1.6rem;padding:0 .5rem;text-align:center}[data-gene-ui-version=\"1.0.0\"] .badge__content-children{position:absolute;top:-.8rem}html:not([dir=rtl]) .badge__content-children{right:-.8rem}html[dir=rtl] .badge__content-children{left:-.8rem}[data-gene-ui-version=\"1.0.0\"] .badge__content-dot{height:1rem;min-height:1rem;min-width:1rem;top:-.5rem;width:1rem}html:not([dir=rtl]) .badge__content-dot{right:-.5rem}html[dir=rtl] .badge__content-dot{left:-.5rem}[data-gene-ui-version=\"1.0.0\"] .badge__content-medium{line-height:1.8rem;min-height:1.8rem;min-width:1.8rem}[data-gene-ui-version=\"1.0.0\"] .badge__content-big{line-height:2.2rem;min-height:2.2rem;min-width:2.2rem}[data-gene-ui-version=\"1.0.0\"] .badge__content-huge{font-size:1.3rem;line-height:2.6rem;min-height:2.6rem;min-width:2.6rem}[data-gene-ui-version=\"1.0.0\"] .badge__content-big,[data-gene-ui-version=\"1.0.0\"] .badge__content-huge,[data-gene-ui-version=\"1.0.0\"] .badge__content-medium{top:-1rem}html:not([dir=rtl]) .badge__content-big,html:not([dir=rtl]) .badge__content-huge,html:not([dir=rtl]) .badge__content-medium{right:-1rem}html[dir=rtl] .badge__content-big,html[dir=rtl] .badge__content-huge,html[dir=rtl] .badge__content-medium{left:-1rem}[data-gene-ui-version=\"1.0.0\"] .badge__content-primary{background:var(--hero)}";
|
|
10
|
-
styleInject(css_248z);
|
|
11
|
-
|
|
12
|
-
const getShowValue = (count, maxCount) => {
|
|
13
|
-
if (count !== 0 && !count) return null;
|
|
14
|
-
if (!maxCount) return count;
|
|
15
|
-
return count > maxCount ? "".concat(maxCount, "+") : count;
|
|
16
|
-
};
|
|
17
|
-
function Badge(_ref) {
|
|
18
|
-
let {
|
|
19
|
-
children,
|
|
20
|
-
size,
|
|
21
|
-
color,
|
|
22
|
-
count,
|
|
23
|
-
dot,
|
|
24
|
-
maxCount,
|
|
25
|
-
className,
|
|
26
|
-
...restProps
|
|
27
|
-
} = _ref;
|
|
28
|
-
const show = useMemo(() => dot ? '' : getShowValue(count, maxCount), [dot, count, maxCount]);
|
|
29
|
-
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
30
|
-
className: "badge"
|
|
31
|
-
}, restProps), show !== null && /*#__PURE__*/React__default.createElement("span", {
|
|
32
|
-
className: classnames('badge__content', className, {
|
|
33
|
-
["badge__content-".concat(size)]: size,
|
|
34
|
-
["badge__content-".concat(color)]: color,
|
|
35
|
-
["badge__content-dot"]: dot,
|
|
36
|
-
["badge__content-children"]: children
|
|
37
|
-
})
|
|
38
|
-
}, show), children);
|
|
39
|
-
}
|
|
40
|
-
Badge.propTypes = {
|
|
41
|
-
/**
|
|
42
|
-
* Any valid React node
|
|
43
|
-
*/
|
|
44
|
-
children: propTypesExports.node,
|
|
45
|
-
/**
|
|
46
|
-
* Any custom class name
|
|
47
|
-
*/
|
|
48
|
-
className: propTypesExports.string,
|
|
49
|
-
/**
|
|
50
|
-
* Badge size
|
|
51
|
-
*/
|
|
52
|
-
size: propTypesExports.oneOf(badgeConfig.size),
|
|
53
|
-
/**
|
|
54
|
-
* Badge color
|
|
55
|
-
*/
|
|
56
|
-
color: propTypesExports.oneOf(badgeConfig.color),
|
|
57
|
-
/**
|
|
58
|
-
* Shows the specified number on the badge
|
|
59
|
-
*/
|
|
60
|
-
count: propTypesExports.number,
|
|
61
|
-
/**
|
|
62
|
-
* Set this property to have only dot instead of number
|
|
63
|
-
*/
|
|
64
|
-
dot: propTypesExports.bool,
|
|
65
|
-
/**
|
|
66
|
-
* When the "count" is greater than "maxCount" Badge will show "maxCount" value and "+"
|
|
67
|
-
*/
|
|
68
|
-
maxCount: propTypesExports.number
|
|
69
|
-
};
|
|
70
|
-
Badge.defaultProps = {
|
|
71
|
-
dot: false,
|
|
72
|
-
size: badgeConfig.size[0],
|
|
73
|
-
color: badgeConfig.color[0]
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export { Badge as default };
|
package/BusyLoader.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import { p as propTypesExports } from './index-e0af0caf.js';
|
|
3
|
-
import { c as classnames } from './index-6ff23041.js';
|
|
4
|
-
import Icon from './Icon.js';
|
|
5
|
-
import './globalStyling-9c60a159.js';
|
|
6
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
7
|
-
import './_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
8
|
-
|
|
9
|
-
var css_248z = "[data-gene-ui-version=\"1.0.0\"] .loader-holder{align-items:center;color:var(--hero);display:flex;flex-direction:column;margin:auto;position:relative;text-align:center}[data-gene-ui-version=\"1.0.0\"] .loader-holder.p-static{margin:6rem}[data-gene-ui-version=\"1.0.0\"] .loader-holder.p-absolute{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}[data-gene-ui-version=\"1.0.0\"] .loader-holder .s-medium{font-size:2.8rem}[data-gene-ui-version=\"1.0.0\"] .loader-holder .s-big{font-size:5.4rem}[data-gene-ui-version=\"1.0.0\"] .loader-text{font:600 1.6rem/2rem var(--font-family);margin:1rem 0 0}[data-gene-ui-version=\"1.0.0\"] .bubble-loader{animation:sk-rotate 2s linear infinite;height:6.6rem;position:relative;width:6.6rem}@keyframes sk-rotate{to{transform:rotate(1turn)}}[data-gene-ui-version=\"1.0.0\"] .bubble-loader .dot{animation:sk-bounce 2s ease-in-out infinite;background:var(--hero);border-radius:100%;height:60%;position:absolute;top:0;width:60%}@keyframes sk-bounce{0%,to{transform:scale(0)}50%{transform:scale(1)}}[data-gene-ui-version=\"1.0.0\"] .bubble-loader .dot2{animation-delay:-1s;bottom:0;top:auto}[data-gene-ui-version=\"1.0.0\"] .bar-loader{height:.6rem;left:0;overflow:hidden;position:fixed;top:calc(var(--header-height, .6rem) - .6rem);width:100%}[data-gene-ui-version=\"1.0.0\"] .bar-loader:before{animation:bar-loader .8s linear infinite;background:linear-gradient(270deg,#7eb8ff 30%,#8d14e6 50%,#7eb8ff 70%) no-repeat 50% 50%/100vw .6rem;content:\"\";display:block;height:100%;left:50%;max-width:0;opacity:0;overflow:hidden;position:absolute;top:0;transform:translateX(-50%);width:100%}@keyframes bar-loader{0%,to{opacity:0}10%,90%{opacity:1}0%{max-width:0}to{max-width:100%}}";
|
|
10
|
-
styleInject(css_248z);
|
|
11
|
-
|
|
12
|
-
function BubbleLoader() {
|
|
13
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
14
|
-
className: "bubble-loader"
|
|
15
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
16
|
-
className: "dot dot1"
|
|
17
|
-
}), /*#__PURE__*/React__default.createElement("div", {
|
|
18
|
-
className: "dot dot2"
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
function BusyLoader(props) {
|
|
22
|
-
const {
|
|
23
|
-
type,
|
|
24
|
-
isBusy,
|
|
25
|
-
children,
|
|
26
|
-
className,
|
|
27
|
-
loadingText,
|
|
28
|
-
spinnerSize
|
|
29
|
-
} = props;
|
|
30
|
-
return type === 'bar' ? /*#__PURE__*/React__default.createElement("div", {
|
|
31
|
-
className: "bar-loader"
|
|
32
|
-
}) : isBusy ? /*#__PURE__*/React__default.createElement("div", {
|
|
33
|
-
className: classnames('loader-holder', className)
|
|
34
|
-
}, type === 'spinner' ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
35
|
-
type: "bc-icon-loader s-".concat(spinnerSize)
|
|
36
|
-
}) : /*#__PURE__*/React__default.createElement(BubbleLoader, null), loadingText && /*#__PURE__*/React__default.createElement("div", {
|
|
37
|
-
className: "loader-text"
|
|
38
|
-
}, loadingText)) : children;
|
|
39
|
-
}
|
|
40
|
-
BusyLoader.propTypes = {
|
|
41
|
-
/**
|
|
42
|
-
* Show loader
|
|
43
|
-
*/
|
|
44
|
-
isBusy: propTypesExports.bool,
|
|
45
|
-
/**
|
|
46
|
-
* Any valid React node. Renders when "isBusy" is set to false
|
|
47
|
-
*/
|
|
48
|
-
children: propTypesExports.node,
|
|
49
|
-
/**
|
|
50
|
-
* Show some text when loading
|
|
51
|
-
*/
|
|
52
|
-
loadingText: propTypesExports.string,
|
|
53
|
-
/**
|
|
54
|
-
* Loader available type/style
|
|
55
|
-
*/
|
|
56
|
-
type: propTypesExports.oneOf(['spinner', 'bubbles', 'bar']),
|
|
57
|
-
/**
|
|
58
|
-
* Loader size
|
|
59
|
-
*/
|
|
60
|
-
spinnerSize: propTypesExports.oneOf(['small', 'medium', 'big'])
|
|
61
|
-
};
|
|
62
|
-
BusyLoader.defaultProps = {
|
|
63
|
-
isBusy: true,
|
|
64
|
-
children: null,
|
|
65
|
-
type: 'spinner',
|
|
66
|
-
spinnerSize: 'small'
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export { BusyLoader as default };
|
package/Button.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { _ as _extends } from './_rollupPluginBabelHelpers-e8fb2e5c.js';
|
|
2
|
-
import React__default, { forwardRef } from 'react';
|
|
3
|
-
import { p as propTypesExports } from './index-e0af0caf.js';
|
|
4
|
-
import { c as classnames } from './index-6ff23041.js';
|
|
5
|
-
import Icon from './Icon.js';
|
|
6
|
-
import './globalStyling-9c60a159.js';
|
|
7
|
-
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
8
|
-
|
|
9
|
-
var css_248z = "[data-gene-ui-version=\"1.0.0\"] .btn{--size:3.6rem;align-items:center;border:1px solid #0000;border-radius:var(--button-external-border-radius,var(--button-external-size,var(--size)));color:inherit;cursor:pointer;display:flex;font:600 1.4rem/2rem var(--font-family);justify-content:center;min-height:var(--button-external-size,var(--size));min-width:var(--button-external-size,var(--size));position:relative;transition:color .3s,background .3s,opacity .2s;-webkit-user-select:none;user-select:none}[data-gene-ui-version=\"1.0.0\"] .btn:focus-visible{border-radius:var(--button-external-border-radius,var(--button-external-size,var(--size)));outline:.2rem var(--hero) solid}[data-gene-ui-version=\"1.0.0\"] .btn:disabled{opacity:.5;pointer-events:none}[data-gene-ui-version=\"1.0.0\"] .btn.s-medium{--size:3.2rem;font-size:1.2rem}[data-gene-ui-version=\"1.0.0\"] .btn.s-big{--size:4.2rem}[data-gene-ui-version=\"1.0.0\"] .btn.cr-smooth{border-radius:var(--button-external-border-radius,.4rem)}[data-gene-ui-version=\"1.0.0\"] .btn>*+*{margin:0 0 0 .4rem}html[dir=rtl] .btn>*+*{margin:0 .4rem 0 0}[data-gene-ui-version=\"1.0.0\"] .btn.id-end{flex-direction:row-reverse}[data-gene-ui-version=\"1.0.0\"] .btn.id-end>*+*{margin:0 .7rem 0 0}html[dir=rtl] .btn.id-end>*+*{margin:0 0 0 .7rem}[data-gene-ui-version=\"1.0.0\"] .btn:not(.c-icon){padding:0 2rem}[data-gene-ui-version=\"1.0.0\"] .btn:not(.c-icon).f-content-size{padding:0 1.3rem}[data-gene-ui-version=\"1.0.0\"] .btn:not(.c-icon).f-default{min-width:10rem}[data-gene-ui-version=\"1.0.0\"] .btn:not(.c-icon).f-full-width{width:100%}[data-gene-ui-version=\"1.0.0\"] .btn:not(.c-icon).loading-padding{padding:0 .6rem}[data-gene-ui-version=\"1.0.0\"] .btn.c-confirm{--hero:var(--confirm);--hero-sc:var(--confirm-sc);--hero-hover:var(--confirm-hover)}[data-gene-ui-version=\"1.0.0\"] .btn.c-danger{--hero:var(--danger);--hero-sc:var(--danger-sc);--hero-hover:var(--danger-hover)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-outline{border-color:var(--hero);color:var(--hero)}@media (hover:hover){[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-outline:hover{background:var(--hero);color:var(--hero-sc)}}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-outline:active{background:var(--hero);color:var(--hero-sc)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-minimal:not(.c-default){color:var(--hero)}@media (hover:hover){[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-minimal:hover{background:rgba(var(--background-sc-rgb),.03)}}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-minimal.active{background:rgba(var(--background-sc-rgb),.03)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-grayscale:not(:disabled){background:rgba(var(--background-sc-rgb),.01)}@media (hover:hover){[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-grayscale:not(:disabled):hover{background:rgba(var(--background-sc-rgb),.03)}}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-grayscale:not(:disabled).active{background:rgba(var(--background-sc-rgb),.03)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-grayscale:not(.c-default){color:var(--hero)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-clean:not(.c-default){color:rgba(var(--background-sc-rgb),.6)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-clean:not(:disabled){background:rgba(var(--hero-rgb),.1);color:var(--hero)}@media (hover:hover){[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-clean:not(:disabled):hover{background:var(--hero);color:var(--hero-sc)}}[data-gene-ui-version=\"1.0.0\"] .btn:not(.active).a-clean:not(:disabled).active{background:var(--hero);color:var(--hero-sc)}[data-gene-ui-version=\"1.0.0\"] .btn:not(.a-grayscale).with-shadow{box-shadow:0 .2rem .4rem 0 #0000001a}[data-gene-ui-version=\"1.0.0\"] .btn.a-grayscale:not(:disabled){box-shadow:0 1px 0 0 #00000029}[data-gene-ui-version=\"1.0.0\"] .btn.a-default,[data-gene-ui-version=\"1.0.0\"] .btn.active{background:var(--hero);color:var(--hero-sc)}@media (hover:hover){[data-gene-ui-version=\"1.0.0\"] .btn.a-default:hover,[data-gene-ui-version=\"1.0.0\"] .btn.active:hover{background:var(--hero-hover)}}[data-gene-ui-version=\"1.0.0\"] .btn.loading-state>:not(.btn-loader-holder){color:#0000!important}[data-gene-ui-version=\"1.0.0\"] .btn .btn-loader-holder{left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%)}";
|
|
10
|
-
styleInject(css_248z);
|
|
11
|
-
|
|
12
|
-
const Button = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
13
|
-
let {
|
|
14
|
-
children,
|
|
15
|
-
appearance,
|
|
16
|
-
size,
|
|
17
|
-
flexibility,
|
|
18
|
-
color,
|
|
19
|
-
itemsDirection,
|
|
20
|
-
cornerRadius,
|
|
21
|
-
icon,
|
|
22
|
-
active,
|
|
23
|
-
className,
|
|
24
|
-
withShadow,
|
|
25
|
-
loading,
|
|
26
|
-
ariaLabel,
|
|
27
|
-
...restProps
|
|
28
|
-
} = _ref;
|
|
29
|
-
const noChildren = !children && children !== 0;
|
|
30
|
-
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
31
|
-
className: classnames('btn', className, "a-".concat(appearance), "s-".concat(size), "f-".concat(flexibility), "c-".concat(color), "id-".concat(itemsDirection), "cr-".concat(cornerRadius), {
|
|
32
|
-
active,
|
|
33
|
-
'c-icon': !!icon && noChildren,
|
|
34
|
-
'with-shadow': withShadow,
|
|
35
|
-
'loading-padding': !noChildren && !icon && loading
|
|
36
|
-
}),
|
|
37
|
-
ref: ref
|
|
38
|
-
}, ariaLabel ? {
|
|
39
|
-
'aria-label': ariaLabel
|
|
40
|
-
} : {}, restProps), icon && (loading ? /*#__PURE__*/React__default.createElement(Icon, {
|
|
41
|
-
type: "bc-icon-loader"
|
|
42
|
-
}) : /*#__PURE__*/React__default.createElement(Icon, {
|
|
43
|
-
type: icon
|
|
44
|
-
})), !noChildren && (!icon && loading ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Icon, {
|
|
45
|
-
type: "bc-icon-loader"
|
|
46
|
-
}), /*#__PURE__*/React__default.createElement("span", null, children)) : /*#__PURE__*/React__default.createElement("span", {
|
|
47
|
-
className: "ellipsis-text"
|
|
48
|
-
}, children)), loading && noChildren && /*#__PURE__*/React__default.createElement("div", {
|
|
49
|
-
className: "btn-loader-holder"
|
|
50
|
-
}, /*#__PURE__*/React__default.createElement(Icon, {
|
|
51
|
-
type: "bc-icon-loader"
|
|
52
|
-
})));
|
|
53
|
-
});
|
|
54
|
-
const ButtonConfig = {
|
|
55
|
-
appearance: ['default', 'outline', 'minimal', 'grayscale', 'clean'],
|
|
56
|
-
size: ['default', 'medium', 'big'],
|
|
57
|
-
color: ['primary', 'confirm', 'danger', 'default'],
|
|
58
|
-
flexibility: ['default', 'content-size', 'full-width'],
|
|
59
|
-
itemsDirection: ['start', 'end'],
|
|
60
|
-
cornerRadius: ['round', 'smooth']
|
|
61
|
-
};
|
|
62
|
-
Button.propTypes = {
|
|
63
|
-
/**
|
|
64
|
-
* Any valid React node
|
|
65
|
-
*/
|
|
66
|
-
children: propTypesExports.node,
|
|
67
|
-
/**
|
|
68
|
-
* The way how the Button should be displayed
|
|
69
|
-
*/
|
|
70
|
-
appearance: propTypesExports.oneOf(ButtonConfig.appearance),
|
|
71
|
-
/**
|
|
72
|
-
* Button size
|
|
73
|
-
*/
|
|
74
|
-
size: propTypesExports.oneOf(ButtonConfig.size),
|
|
75
|
-
/**
|
|
76
|
-
* How to display inscription in relation to it's parent in Button
|
|
77
|
-
*/
|
|
78
|
-
flexibility: propTypesExports.oneOf(ButtonConfig.flexibility),
|
|
79
|
-
/**
|
|
80
|
-
* Button color
|
|
81
|
-
*/
|
|
82
|
-
color: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.oneOf(ButtonConfig.color)]),
|
|
83
|
-
/**
|
|
84
|
-
* Button children direction either from the start, or from the end
|
|
85
|
-
*/
|
|
86
|
-
itemsDirection: propTypesExports.oneOf(ButtonConfig.itemsDirection),
|
|
87
|
-
/**
|
|
88
|
-
* Button corner radius
|
|
89
|
-
*/
|
|
90
|
-
cornerRadius: propTypesExports.oneOf(ButtonConfig.cornerRadius),
|
|
91
|
-
/**
|
|
92
|
-
* The property will add an "Icon" as Button child. The valid values can be found in "Icon" atom
|
|
93
|
-
*/
|
|
94
|
-
icon: propTypesExports.string,
|
|
95
|
-
/**
|
|
96
|
-
* Button disabled state
|
|
97
|
-
*/
|
|
98
|
-
disabled: propTypesExports.bool,
|
|
99
|
-
/**
|
|
100
|
-
* Button active state
|
|
101
|
-
*/
|
|
102
|
-
active: propTypesExports.bool,
|
|
103
|
-
/**
|
|
104
|
-
* Adding shadow to button
|
|
105
|
-
*/
|
|
106
|
-
withShadow: propTypesExports.bool,
|
|
107
|
-
/**
|
|
108
|
-
* Button additianl className
|
|
109
|
-
*/
|
|
110
|
-
className: propTypesExports.string,
|
|
111
|
-
/**
|
|
112
|
-
* Button text transforms to spinner
|
|
113
|
-
*/
|
|
114
|
-
loading: propTypesExports.bool,
|
|
115
|
-
/**
|
|
116
|
-
* aria-label for button.
|
|
117
|
-
*/
|
|
118
|
-
ariaLabel: propTypesExports.string
|
|
119
|
-
};
|
|
120
|
-
Button.defaultProps = {
|
|
121
|
-
appearance: ButtonConfig.appearance[0],
|
|
122
|
-
size: ButtonConfig.size[0],
|
|
123
|
-
flexibility: ButtonConfig.flexibility[0],
|
|
124
|
-
color: ButtonConfig.color[0],
|
|
125
|
-
itemsDirection: ButtonConfig.itemsDirection[0],
|
|
126
|
-
cornerRadius: ButtonConfig.cornerRadius[0]
|
|
127
|
-
};
|
|
128
|
-
Button.displayName = 'Button';
|
|
129
|
-
|
|
130
|
-
export { Button as default };
|