@via-profit/ui-kit 0.2.1-alpha.1 → 0.2.1-alpha.3
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/Autocomplete/AutocompleteContainer.d.ts +33 -6
- package/Autocomplete/AutocompleteContainer.js +28 -24
- package/Autocomplete/AutocompleteItem.d.ts +1 -1
- package/Autocomplete/AutocompleteTextField.d.ts +3 -0
- package/Autocomplete/AutocompleteTextField.js +63 -1
- package/Autocomplete/OverrideMenuList.d.ts +4 -0
- package/Autocomplete/OverrideMenuList.js +39 -0
- package/Autocomplete/context.d.ts +9 -1
- package/Autocomplete/context.js +15 -1
- package/Autocomplete/index.js +9 -10
- package/Autocomplete2/Autocomplete2.d.ts +12 -0
- package/Autocomplete2/Autocomplete2.js +83 -0
- package/Autocomplete2/Autocomplete2TextField.d.ts +7 -0
- package/Autocomplete2/Autocomplete2TextField.js +39 -0
- package/Autocomplete2/index.d.ts +2 -0
- package/Autocomplete2/index.js +7 -0
- package/Avatar/index.js +1 -1
- package/Badge/BadgeDeleteButton.js +6 -6
- package/Badge/BadgeOutlined.js +2 -2
- package/Badge/BadgeStandard.js +1 -1
- package/Button/ButtonOutlined.js +1 -1
- package/Button/ButtonPlain.js +1 -1
- package/Button/ButtonStandard.js +4 -11
- package/Calendar/CalendarCell.js +6 -2
- package/Calendar/CalendarComponent.d.ts +226 -0
- package/Calendar/CalendarComponent.js +572 -0
- package/Calendar/CalendarControlButton.js +16 -9
- package/Calendar/CalendarDayBadge.js +1 -1
- package/Calendar/CalendarEmptyCell.d.ts +2 -2
- package/Calendar/CalendarEmptyCell.js +8 -3
- package/Calendar/CalendarHeading.js +2 -1
- package/Calendar/CalendarSubheading.js +3 -2
- package/Calendar/CalendarWeekDayCell.d.ts +10 -0
- package/Calendar/CalendarWeekDayCell.js +32 -0
- package/Calendar/CalendarWeekDayWeekNumber.d.ts +7 -0
- package/Calendar/CalendarWeekDayWeekNumber.js +38 -0
- package/Calendar/CalendarWeekRow.d.ts +2 -2
- package/Calendar/CalendarWeekRow.js +2 -1
- package/Calendar/CalendarWeekRowButton.d.ts +13 -0
- package/Calendar/CalendarWeekRowButton.js +31 -0
- package/Calendar/CalendarYearsSelector.d.ts +39 -1
- package/Calendar/CalendarYearsSelector.js +52 -16
- package/Calendar/IconChevronDown.d.ts +3 -0
- package/Calendar/IconChevronDown.js +31 -0
- package/Calendar/index.d.ts +7 -224
- package/Calendar/index.js +19 -281
- package/Calendar/use-calendar.d.ts +1 -1
- package/Color/Color.d.ts +138 -0
- package/Color/Color.js +324 -0
- package/Color/ColorGenerator.d.ts +29 -0
- package/Color/ColorGenerator.js +141 -0
- package/Color/ColorParser.d.ts +20 -0
- package/Color/ColorParser.js +284 -0
- package/Color/index.d.ts +4 -122
- package/Color/index.js +18 -473
- package/DatePicker/index.d.ts +2 -17
- package/DatePicker/index.js +47 -61
- package/DatePicker/useDatePickerFormat.js +5 -5
- package/ErrorBoundary/Fallback.d.ts +3 -0
- package/ErrorBoundary/Fallback.js +51 -0
- package/ErrorBoundary/RenderError.d.ts +6 -0
- package/ErrorBoundary/RenderError.js +80 -0
- package/ErrorBoundary/index.d.ts +7 -11
- package/ErrorBoundary/index.js +4 -51
- package/LoadingIndicator/Spinner.d.ts +5 -3
- package/LoadingIndicator/Spinner.js +61 -32
- package/LoadingIndicator/index.d.ts +3 -3
- package/LoadingIndicator/index.js +15 -2
- package/MaskedField/index.d.ts +1 -1
- package/MaskedField/index.js +11 -10
- package/Menu/AutoHeightWrapper.d.ts +6 -0
- package/Menu/AutoHeightWrapper.js +43 -0
- package/Menu/MeasuredItem.d.ts +10 -0
- package/Menu/MeasuredItem.js +51 -0
- package/Menu/MenuContainer.d.ts +51 -18
- package/Menu/MenuContainer.js +18 -11
- package/Menu/MenuItem.d.ts +24 -7
- package/Menu/MenuItem.js +13 -6
- package/Menu/MenuList.d.ts +4 -2
- package/Menu/MenuList.js +26 -6
- package/Menu/VirtualizedItem.d.ts +22 -0
- package/Menu/VirtualizedItem.js +69 -0
- package/Menu/VirtualizedList.d.ts +18 -0
- package/Menu/VirtualizedList.js +28 -0
- package/Menu/VirtualizedListComponent.d.ts +20 -0
- package/Menu/VirtualizedListComponent.js +305 -0
- package/Menu/index.d.ts +3 -1
- package/Menu/index.js +2 -0
- package/Popper/Popper.d.ts +7 -80
- package/Popper/Popper.js +26 -12
- package/Popper/PopperContainer.js +1 -1
- package/Popper/usePopprer.d.ts +88 -3
- package/Popper/usePopprer.js +240 -65
- package/Selectbox/SelectboxButton.d.ts +5 -0
- package/Selectbox/SelectboxButton.js +48 -8
- package/Selectbox/SelectboxButtonWrapper.d.ts +2 -0
- package/Selectbox/SelectboxButtonWrapper.js +1 -17
- package/Selectbox/SelectboxMenu.d.ts +12 -0
- package/Selectbox/SelectboxMenu.js +50 -0
- package/Selectbox/index.d.ts +5 -5
- package/Selectbox/index.js +115 -97
- package/Surface/index.js +1 -1
- package/Swiper/Swiper.d.ts +44 -0
- package/Swiper/Swiper.js +139 -0
- package/Swiper/SwiperContainer.d.ts +7 -0
- package/Swiper/SwiperContainer.js +14 -0
- package/Swiper/SwiperSlide.d.ts +7 -0
- package/Swiper/SwiperSlide.js +55 -0
- package/Swiper/SwiperTrack.d.ts +14 -0
- package/Swiper/SwiperTrack.js +58 -0
- package/Swiper/SwiperWrapper.d.ts +14 -0
- package/Swiper/SwiperWrapper.js +60 -0
- package/Swiper/index.d.ts +7 -0
- package/Swiper/index.js +26 -0
- package/Switch/SwitchDot.js +1 -1
- package/Switch/SwitchTrack.js +1 -1
- package/TextField/TextFieldContainer.d.ts +2 -2
- package/TextField/TextFieldContainer.js +5 -3
- package/TextField/TextFieldErrorText.d.ts +2 -2
- package/TextField/TextFieldErrorText.js +5 -4
- package/TextField/TextFieldIconWrapper.d.ts +3 -3
- package/TextField/TextFieldIconWrapper.js +5 -3
- package/TextField/TextFieldInput.d.ts +2 -2
- package/TextField/TextFieldInput.js +6 -4
- package/TextField/TextFieldInputWrapper.d.ts +2 -2
- package/TextField/TextFieldInputWrapper.js +5 -3
- package/TextField/TextFieldLabel.d.ts +2 -2
- package/TextField/TextFieldLabel.js +5 -3
- package/TextField/TextFieldLabelAsterisk.d.ts +2 -2
- package/TextField/TextFieldLabelAsterisk.js +5 -3
- package/TextField/index.d.ts +8 -1
- package/TextField/index.js +49 -22
- package/ThemeProvider/createTheme.js +2 -2
- package/package.json +1 -1
- package/Calendar/reducer.d.ts +0 -17
- package/Calendar/reducer.js +0 -50
- /package/Calendar/{IconChevronRight.d.ts → CalendarIconNext.d.ts} +0 -0
- /package/Calendar/{IconChevronRight.js → CalendarIconNext.js} +0 -0
package/Selectbox/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { GetOptionSelected, OnRequestClose, Value } from '../Menu';
|
|
3
|
+
import type { MenuItemCommonProps } from '../Menu/MenuItem';
|
|
3
4
|
import SelectboxItem from '../Menu/MenuItem';
|
|
4
5
|
import { SelectboxButtonProps } from './SelectboxButton';
|
|
5
6
|
import { SelectboxChevronIconProps } from './SelectboxChevronIcon';
|
|
6
|
-
import
|
|
7
|
-
import type { MenuItemCommonProps } from '../Menu/MenuItem';
|
|
7
|
+
import { AnchorPos } from '../Popper';
|
|
8
8
|
import { TextFieldLabelProps } from '../TextField/TextFieldLabel';
|
|
9
9
|
import { TextFieldLabelAsteriskProps } from '../TextField/TextFieldLabelAsterisk';
|
|
10
10
|
import { TextFieldErrorTextProps } from '../TextField/TextFieldErrorText';
|
|
11
11
|
import { SelectboxButtonWrapperProps } from './SelectboxButtonWrapper';
|
|
12
12
|
import { SelectboxContainerProps } from './SelectboxContainer';
|
|
13
13
|
export { SelectboxItem };
|
|
14
|
-
export interface SelectboxProps<T, Multiple extends boolean | undefined = undefined> extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange' | 'children'> {
|
|
14
|
+
export interface SelectboxProps<T, Multiple extends boolean | undefined = undefined> extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange' | 'children'> {
|
|
15
15
|
/**
|
|
16
16
|
* Array of values
|
|
17
17
|
*/
|
package/Selectbox/index.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
26
|
var t = {};
|
|
4
27
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -15,8 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
38
|
};
|
|
16
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
40
|
exports.SelectboxItem = void 0;
|
|
18
|
-
const
|
|
19
|
-
const Menu_1 = __importDefault(require("../Menu"));
|
|
41
|
+
const React = __importStar(require("react"));
|
|
20
42
|
const MenuItem_1 = __importDefault(require("../Menu/MenuItem"));
|
|
21
43
|
exports.SelectboxItem = MenuItem_1.default;
|
|
22
44
|
const SelectboxButton_1 = __importDefault(require("./SelectboxButton"));
|
|
@@ -28,112 +50,108 @@ const TextFieldLabelAsterisk_1 = __importDefault(require("../TextField/TextField
|
|
|
28
50
|
const TextFieldErrorText_1 = __importDefault(require("../TextField/TextFieldErrorText"));
|
|
29
51
|
const SelectboxButtonWrapper_1 = __importDefault(require("./SelectboxButtonWrapper"));
|
|
30
52
|
const SelectboxContainer_1 = __importDefault(require("./SelectboxContainer"));
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
53
|
+
const SelectboxMenu_1 = __importDefault(require("./SelectboxMenu"));
|
|
54
|
+
const DEFAULT_OVERRIDES = {
|
|
55
|
+
Button: SelectboxButton_1.default,
|
|
56
|
+
Icon: SelectboxChevronIcon_1.default,
|
|
57
|
+
Label: TextFieldLabel_1.default,
|
|
58
|
+
Asterisk: TextFieldLabelAsterisk_1.default,
|
|
59
|
+
ErrorText: TextFieldErrorText_1.default,
|
|
60
|
+
ButtonWrapper: SelectboxButtonWrapper_1.default,
|
|
61
|
+
Container: SelectboxContainer_1.default,
|
|
62
|
+
};
|
|
63
|
+
const generateGuid = () => {
|
|
64
|
+
const u = Date.now().toString(16) + Math.random().toString(16) + '0'.repeat(16);
|
|
65
|
+
return [
|
|
66
|
+
u.substring(0, 8),
|
|
67
|
+
u.substring(8, 12),
|
|
68
|
+
'4000-8' + u.substring(13, 16),
|
|
69
|
+
u.substring(16, 28),
|
|
70
|
+
].join('-');
|
|
71
|
+
};
|
|
72
|
+
const Selectbox = React.forwardRef((props, ref) => {
|
|
73
|
+
const { items, value, multiple, isOpen = false, isLoading = false, anchorPos = 'bottom-fill', fullWidth = false, children, onChange, selectedItemToString, getOptionSelected, onRequestOpen = () => undefined, onRequestClose = () => undefined, overrides, id, label, onFocus, requiredAsterisk, error, errorText, notSetLabel = 'Not set' } = props, nativeButtonProps = __rest(props, ["items", "value", "multiple", "isOpen", "isLoading", "anchorPos", "fullWidth", "children", "onChange", "selectedItemToString", "getOptionSelected", "onRequestOpen", "onRequestClose", "overrides", "id", "label", "onFocus", "requiredAsterisk", "error", "errorText", "notSetLabel"]);
|
|
74
|
+
const menuRef = React.useRef(null);
|
|
75
|
+
const [actualPlacement, setActualPlacement] = React.useState(anchorPos);
|
|
76
|
+
const [anchorElement, setAnchorElement] = React.useState(null);
|
|
77
|
+
const overridesMap = React.useMemo(() => (Object.assign(Object.assign({}, DEFAULT_OVERRIDES), overrides)), [overrides]);
|
|
78
|
+
const inputID = React.useMemo(() => {
|
|
79
|
+
if (typeof id === 'string') {
|
|
80
|
+
return id;
|
|
81
|
+
}
|
|
82
|
+
return generateGuid();
|
|
83
|
+
}, [id]);
|
|
84
|
+
React.useEffect(() => {
|
|
45
85
|
if (isOpen && menuRef.current) {
|
|
46
86
|
menuRef.current.scrollToFirstSelected();
|
|
47
87
|
}
|
|
48
88
|
}, [isOpen]);
|
|
49
|
-
|
|
50
|
-
const mouseDownEvent = (event) => {
|
|
51
|
-
var _a;
|
|
52
|
-
let parentElem = event.target;
|
|
53
|
-
let needToClose = true;
|
|
54
|
-
while (parentElem && 'parentNode' in parentElem) {
|
|
55
|
-
if (parentElem === anchorElement || parentElem === ((_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.getListElement())) {
|
|
56
|
-
needToClose = false;
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
parentElem = parentElem.parentNode;
|
|
60
|
-
}
|
|
61
|
-
if (needToClose) {
|
|
62
|
-
onRequestClose(event);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
window.document.addEventListener(ClickOutside_1.mouseEventMap.onMouseDown, mouseDownEvent);
|
|
66
|
-
return () => {
|
|
67
|
-
window.document.removeEventListener(ClickOutside_1.mouseEventMap.onMouseDown, mouseDownEvent);
|
|
68
|
-
};
|
|
69
|
-
}, [onRequestClose, anchorElement]);
|
|
70
|
-
const renderValueAsString = react_1.default.useCallback(() => {
|
|
89
|
+
const renderValueAsString = React.useCallback(() => {
|
|
71
90
|
if ((!multiple && !value) || (multiple && value.length === 0)) {
|
|
72
91
|
return notSetLabel;
|
|
73
92
|
}
|
|
74
93
|
return selectedItemToString(value);
|
|
75
94
|
}, [multiple, selectedItemToString, value, notSetLabel]);
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
95
|
+
const handleButtonClick = React.useCallback((event) => {
|
|
96
|
+
var _a;
|
|
97
|
+
if (isOpen) {
|
|
98
|
+
onRequestClose(event);
|
|
79
99
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
100
|
+
else {
|
|
101
|
+
onRequestOpen(event);
|
|
102
|
+
}
|
|
103
|
+
(_a = nativeButtonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(nativeButtonProps, event);
|
|
104
|
+
}, [isOpen, nativeButtonProps, onRequestClose, onRequestOpen]);
|
|
105
|
+
const setRefs = React.useCallback((el) => {
|
|
106
|
+
if (anchorElement !== el) {
|
|
107
|
+
setAnchorElement(el);
|
|
108
|
+
}
|
|
109
|
+
if (typeof ref === 'function') {
|
|
110
|
+
ref(el);
|
|
111
|
+
}
|
|
112
|
+
else if (ref) {
|
|
113
|
+
ref.current = el;
|
|
114
|
+
}
|
|
115
|
+
}, [anchorElement, ref]);
|
|
116
|
+
const handleMouseDown = React.useCallback((event) => {
|
|
117
|
+
var _a;
|
|
118
|
+
let parentElem = event.target;
|
|
119
|
+
let needToClose = true;
|
|
120
|
+
while (parentElem && 'parentNode' in parentElem) {
|
|
121
|
+
if (parentElem === anchorElement || parentElem === ((_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.getListElement())) {
|
|
122
|
+
needToClose = false;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
parentElem = parentElem.parentNode;
|
|
126
|
+
}
|
|
127
|
+
if (needToClose) {
|
|
128
|
+
onRequestClose(event);
|
|
129
|
+
}
|
|
130
|
+
}, [onRequestClose, anchorElement]);
|
|
131
|
+
React.useEffect(() => {
|
|
132
|
+
window.document.addEventListener(ClickOutside_1.mouseEventMap.onMouseDown, handleMouseDown);
|
|
133
|
+
return () => {
|
|
134
|
+
window.document.removeEventListener(ClickOutside_1.mouseEventMap.onMouseDown, handleMouseDown);
|
|
135
|
+
};
|
|
136
|
+
}, [handleMouseDown]);
|
|
137
|
+
const buttonProps = React.useMemo(() => (Object.assign({ fullWidth,
|
|
138
|
+
error,
|
|
139
|
+
isOpen, anchorPos: actualPlacement, endIcon: isLoading ? React.createElement(Spinner_1.default, null) : React.createElement(overridesMap.Icon, { isOpen: isOpen }) }, nativeButtonProps)), [fullWidth, error, isOpen, actualPlacement, isLoading, overridesMap, nativeButtonProps]);
|
|
140
|
+
const labelProps = React.useMemo(() => ({
|
|
141
|
+
htmlFor: inputID,
|
|
142
|
+
error,
|
|
143
|
+
}), [inputID, error]);
|
|
144
|
+
if (!(items === null || items === void 0 ? void 0 : items.length) && !isLoading) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
return (React.createElement(overridesMap.Container, null,
|
|
148
|
+
label != null && (React.createElement(overridesMap.Label, Object.assign({}, labelProps),
|
|
91
149
|
label,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
onRequestOpen(event);
|
|
100
|
-
}
|
|
101
|
-
if (typeof nativeButtonProps.onClick === 'function') {
|
|
102
|
-
nativeButtonProps.onClick(event);
|
|
103
|
-
}
|
|
104
|
-
} }, nativeButtonProps, { ref: el => {
|
|
105
|
-
if (anchorElement !== el) {
|
|
106
|
-
setAnchorElement(el);
|
|
107
|
-
}
|
|
108
|
-
if (typeof ref === 'function') {
|
|
109
|
-
ref(el);
|
|
110
|
-
}
|
|
111
|
-
if (ref && typeof ref === 'object') {
|
|
112
|
-
ref.current = el;
|
|
113
|
-
}
|
|
114
|
-
} }), renderValueAsString())),
|
|
115
|
-
react_1.default.createElement(overridesMap.ErrorText, { error: error }, errorText),
|
|
116
|
-
react_1.default.useMemo(() => (react_1.default.createElement(Menu_1.default, { ref: menuRef, anchorPos: anchorPos, multiple: multiple, items: items, value: value, isOpen: isOpen && items.length > 0, autofocus: true, anchorElement: anchorElement, closeOutsideClick: false, getOptionSelected: getOptionSelected, onSelectItem: item => {
|
|
117
|
-
if (typeof onChange === 'function') {
|
|
118
|
-
onChange(item);
|
|
119
|
-
}
|
|
120
|
-
}, closeOnSelect: !multiple, onRequestClose: evt => {
|
|
121
|
-
if ((evt === null || evt === void 0 ? void 0 : evt.target) !== anchorElement) {
|
|
122
|
-
onRequestClose(evt);
|
|
123
|
-
anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.focus();
|
|
124
|
-
}
|
|
125
|
-
} }, ({ index, item }, itemProps) => children({ index, item: item }, itemProps))), [
|
|
126
|
-
items,
|
|
127
|
-
anchorPos,
|
|
128
|
-
multiple,
|
|
129
|
-
value,
|
|
130
|
-
isOpen,
|
|
131
|
-
getOptionSelected,
|
|
132
|
-
onChange,
|
|
133
|
-
onRequestClose,
|
|
134
|
-
children,
|
|
135
|
-
anchorElement,
|
|
136
|
-
])));
|
|
150
|
+
requiredAsterisk != null && (React.createElement(overridesMap.Asterisk, null, typeof requiredAsterisk === 'boolean' ? '*' : requiredAsterisk)))),
|
|
151
|
+
React.createElement(overridesMap.ButtonWrapper, { fullWidth: fullWidth, error: error, isOpen: isOpen },
|
|
152
|
+
React.createElement(overridesMap.Button, Object.assign({}, buttonProps, { onClick: handleButtonClick, ref: setRefs }), renderValueAsString())),
|
|
153
|
+
React.createElement(overridesMap.ErrorText, { error: error }, errorText),
|
|
154
|
+
React.createElement(SelectboxMenu_1.default, { actualPlacement: actualPlacement, multiple: multiple, items: items, value: value, isOpen: isOpen, anchorElement: anchorElement, getOptionSelected: getOptionSelected, onChange: onChange, onRequestClose: onRequestClose, onAnchorPosChanged: setActualPlacement, ref: menuRef }, children)));
|
|
137
155
|
});
|
|
138
156
|
Selectbox.displayName = 'Selectbox';
|
|
139
157
|
exports.default = Selectbox;
|
package/Surface/index.js
CHANGED
|
@@ -56,7 +56,7 @@ const Surface = (props, ref) => {
|
|
|
56
56
|
Footer: (overrides === null || overrides === void 0 ? void 0 : overrides.Footer) || SurfaceFooter_1.default,
|
|
57
57
|
}), [overrides]);
|
|
58
58
|
if (!hasHeader && hasSubheader) {
|
|
59
|
-
console.warn(
|
|
59
|
+
console.warn('[@via-profit/ui-kit] Surface component. If you use a subheader, then you should add a header');
|
|
60
60
|
}
|
|
61
61
|
return (React.createElement(overridesMap.Container, Object.assign({}, nativeProps, { inline: inline, noPadding: noPadding, rounded: rounded, ref: ref }),
|
|
62
62
|
hasHeader && (React.createElement(overridesMap.Header, { noPadding: noPadding, rounded: rounded }, header)),
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SwiperContainerProps } from './SwiperContainer';
|
|
3
|
+
import { SwiperWrapperProps } from './SwiperWrapper';
|
|
4
|
+
import { SwiperTrackProps } from './SwiperTrack';
|
|
5
|
+
export type SwiperRef = {
|
|
6
|
+
next: () => void;
|
|
7
|
+
prev: () => void;
|
|
8
|
+
goToIndex: (index: number) => void;
|
|
9
|
+
};
|
|
10
|
+
export interface SwiperOverrides {
|
|
11
|
+
/**
|
|
12
|
+
* Swiper main container
|
|
13
|
+
*/
|
|
14
|
+
readonly Container?: React.ComponentType<SwiperContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
/**
|
|
16
|
+
* Swiper wrapper
|
|
17
|
+
*/
|
|
18
|
+
readonly Wrapper?: React.ComponentType<SwiperWrapperProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
/**
|
|
20
|
+
* Swiper slides track
|
|
21
|
+
*/
|
|
22
|
+
readonly Track?: React.ComponentType<SwiperTrackProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
}
|
|
24
|
+
export type SwiperProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
25
|
+
readonly dragThreshold?: number;
|
|
26
|
+
readonly snap?: boolean;
|
|
27
|
+
readonly draggable?: boolean;
|
|
28
|
+
readonly initialIndex?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Overridable components map
|
|
31
|
+
*/
|
|
32
|
+
readonly overrides?: SwiperOverrides;
|
|
33
|
+
};
|
|
34
|
+
export declare const Swiper: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
35
|
+
readonly dragThreshold?: number | undefined;
|
|
36
|
+
readonly snap?: boolean | undefined;
|
|
37
|
+
readonly draggable?: boolean | undefined;
|
|
38
|
+
readonly initialIndex?: number | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Overridable components map
|
|
41
|
+
*/
|
|
42
|
+
readonly overrides?: SwiperOverrides | undefined;
|
|
43
|
+
} & React.RefAttributes<SwiperRef>>;
|
|
44
|
+
export default Swiper;
|
package/Swiper/Swiper.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Swiper = void 0;
|
|
41
|
+
const React = __importStar(require("react"));
|
|
42
|
+
const SwiperContainer_1 = __importDefault(require("./SwiperContainer"));
|
|
43
|
+
const SwiperWrapper_1 = __importDefault(require("./SwiperWrapper"));
|
|
44
|
+
const SwiperTrack_1 = __importDefault(require("./SwiperTrack"));
|
|
45
|
+
exports.Swiper = React.forwardRef((props, ref) => {
|
|
46
|
+
const { children, dragThreshold = 120, snap = true, draggable = true, overrides, initialIndex = 0 } = props, restProps = __rest(props, ["children", "dragThreshold", "snap", "draggable", "overrides", "initialIndex"]);
|
|
47
|
+
const slides = React.Children.toArray(children);
|
|
48
|
+
const total = slides.length;
|
|
49
|
+
const [index, setIndex] = React.useState(initialIndex);
|
|
50
|
+
const [offset, setOffset] = React.useState(0);
|
|
51
|
+
const [isDragging, setIsDragging] = React.useState(false);
|
|
52
|
+
const dragging = React.useRef(false);
|
|
53
|
+
const startX = React.useRef(0);
|
|
54
|
+
const lastX = React.useRef(0);
|
|
55
|
+
const lastTime = React.useRef(0);
|
|
56
|
+
const velocity = React.useRef(0);
|
|
57
|
+
const width = React.useRef(0);
|
|
58
|
+
const wrapperRef = React.useRef(null);
|
|
59
|
+
const onPointerDown = React.useCallback((e) => {
|
|
60
|
+
if (!wrapperRef.current || !draggable) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
width.current = wrapperRef.current.offsetWidth;
|
|
64
|
+
dragging.current = true;
|
|
65
|
+
setIsDragging(true);
|
|
66
|
+
startX.current = e.clientX;
|
|
67
|
+
lastX.current = e.clientX;
|
|
68
|
+
lastTime.current = performance.now();
|
|
69
|
+
velocity.current = 0;
|
|
70
|
+
e.target.setPointerCapture(e.pointerId);
|
|
71
|
+
}, [draggable]);
|
|
72
|
+
const onPointerMove = React.useCallback((e) => {
|
|
73
|
+
if (!dragging.current) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const now = performance.now();
|
|
77
|
+
const dx = e.clientX - lastX.current;
|
|
78
|
+
const dt = now - lastTime.current;
|
|
79
|
+
if (dt > 0) {
|
|
80
|
+
velocity.current = dx / dt;
|
|
81
|
+
}
|
|
82
|
+
lastX.current = e.clientX;
|
|
83
|
+
lastTime.current = now;
|
|
84
|
+
let delta = lastX.current - startX.current;
|
|
85
|
+
if (index === 0 && delta > 0) {
|
|
86
|
+
delta *= 0.3;
|
|
87
|
+
}
|
|
88
|
+
if (index === total - 1 && delta < 0) {
|
|
89
|
+
delta *= 0.3;
|
|
90
|
+
}
|
|
91
|
+
setOffset(delta);
|
|
92
|
+
}, [index, total]);
|
|
93
|
+
const onPointerUp = React.useCallback((e) => {
|
|
94
|
+
if (!dragging.current) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const delta = lastX.current - startX.current;
|
|
98
|
+
const v = Math.abs(velocity.current);
|
|
99
|
+
const velocityFactor = Math.min(v * 250, 0.65);
|
|
100
|
+
const threshold = Math.max(20, Math.min(dragThreshold * (1 - velocityFactor), dragThreshold));
|
|
101
|
+
let next = index;
|
|
102
|
+
if (Math.abs(delta) > threshold) {
|
|
103
|
+
next = delta < 0 ? index + 1 : index - 1;
|
|
104
|
+
}
|
|
105
|
+
next = Math.max(0, Math.min(total - 1, next));
|
|
106
|
+
if (snap) {
|
|
107
|
+
setIndex(next);
|
|
108
|
+
setOffset(0);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
setIndex(next);
|
|
112
|
+
}
|
|
113
|
+
dragging.current = false;
|
|
114
|
+
setIsDragging(false);
|
|
115
|
+
e.target.releasePointerCapture(e.pointerId);
|
|
116
|
+
}, [dragThreshold, index, snap, total]);
|
|
117
|
+
const next = React.useCallback(() => {
|
|
118
|
+
setIndex(i => Math.min(total - 1, i + 1));
|
|
119
|
+
}, [total]);
|
|
120
|
+
const prev = React.useCallback(() => {
|
|
121
|
+
setIndex(i => Math.max(0, i - 1));
|
|
122
|
+
}, []);
|
|
123
|
+
const goToIndex = React.useCallback((i) => {
|
|
124
|
+
setIndex(Math.max(0, Math.min(total - 1, i)));
|
|
125
|
+
}, [total]);
|
|
126
|
+
React.useImperativeHandle(ref, () => ({ next, prev, goToIndex }), [next, prev, goToIndex]);
|
|
127
|
+
const overridesMap = React.useMemo(() => ({
|
|
128
|
+
Container: (overrides === null || overrides === void 0 ? void 0 : overrides.Container) || SwiperContainer_1.default,
|
|
129
|
+
Track: (overrides === null || overrides === void 0 ? void 0 : overrides.Track) || SwiperTrack_1.default,
|
|
130
|
+
Wrapper: (overrides === null || overrides === void 0 ? void 0 : overrides.Wrapper) || SwiperWrapper_1.default,
|
|
131
|
+
}), [overrides]);
|
|
132
|
+
return (React.createElement(overridesMap.Container, Object.assign({}, restProps),
|
|
133
|
+
React.createElement(overridesMap.Wrapper, { ref: wrapperRef, draggable: draggable, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp },
|
|
134
|
+
React.createElement(overridesMap.Track, { dragging: isDragging, index: index, offset: offset }, slides.map((slide, i) => (
|
|
135
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
136
|
+
React.createElement(React.Fragment, { key: i }, slide)))))));
|
|
137
|
+
});
|
|
138
|
+
exports.Swiper.displayName = 'Swiper';
|
|
139
|
+
exports.default = exports.Swiper;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type SwiperContainerProps = React.HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
export declare const SwiperContainer: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
6
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export default SwiperContainer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SwiperContainer = void 0;
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
exports.SwiperContainer = styled_1.default.div `
|
|
9
|
+
width: 100%;
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
position: relative;
|
|
13
|
+
`;
|
|
14
|
+
exports.default = exports.SwiperContainer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type SwiperSlideProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly children: React.ReactNode | readonly React.ReactNode[];
|
|
4
|
+
};
|
|
5
|
+
export declare const SwiperSlide: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
readonly children: React.ReactNode | readonly React.ReactNode[];
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.SwiperSlide = void 0;
|
|
41
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
42
|
+
const React = __importStar(require("react"));
|
|
43
|
+
const StyledSlide = styled_1.default.div `
|
|
44
|
+
flex: 0 0 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
`;
|
|
51
|
+
exports.SwiperSlide = React.forwardRef((props, ref) => {
|
|
52
|
+
const { children } = props, restProps = __rest(props, ["children"]);
|
|
53
|
+
return (React.createElement(StyledSlide, Object.assign({}, restProps, { ref: ref }), children));
|
|
54
|
+
});
|
|
55
|
+
exports.SwiperSlide.displayName = 'SwiperSlide';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type SwiperTrackProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly children: React.ReactNode;
|
|
4
|
+
readonly index: number;
|
|
5
|
+
readonly offset: number;
|
|
6
|
+
readonly dragging: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const SwiperTrack: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
readonly children: React.ReactNode;
|
|
10
|
+
readonly index: number;
|
|
11
|
+
readonly offset: number;
|
|
12
|
+
readonly dragging: boolean;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export default SwiperTrack;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.SwiperTrack = void 0;
|
|
41
|
+
const React = __importStar(require("react"));
|
|
42
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
43
|
+
const StyledTrack = styled_1.default.div `
|
|
44
|
+
display: flex;
|
|
45
|
+
height: 100%;
|
|
46
|
+
transition: ${p => (p.$dragging ? 'none' : 'transform 0.3s ease')};
|
|
47
|
+
will-change: transform;
|
|
48
|
+
transform: ${({ $index, $offset }) => {
|
|
49
|
+
const trackX = `translateX(calc(${-($index * 100)}% + ${$offset}px))`;
|
|
50
|
+
return trackX;
|
|
51
|
+
}};
|
|
52
|
+
`;
|
|
53
|
+
exports.SwiperTrack = React.forwardRef((props, ref) => {
|
|
54
|
+
const { children, index, offset, dragging } = props, restProps = __rest(props, ["children", "index", "offset", "dragging"]);
|
|
55
|
+
return (React.createElement(StyledTrack, Object.assign({ "$dragging": dragging, "$index": index, "$offset": offset }, restProps, { ref: ref }), children));
|
|
56
|
+
});
|
|
57
|
+
exports.SwiperTrack.displayName = 'SwiperTrack';
|
|
58
|
+
exports.default = exports.SwiperTrack;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type SwiperWrapperProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly draggable: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const StyledWrapper: import("@emotion/styled").StyledComponent<{
|
|
6
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
7
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
$draggable: boolean;
|
|
10
|
+
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
+
declare const SwiperWrapper: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
+
readonly draggable: boolean;
|
|
13
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
export default SwiperWrapper;
|