@via-profit/ui-kit 0.1.0-rc.72 → 0.1.0-rc.74
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 +5 -3
- package/Autocomplete/AutocompleteContainer.js +23 -21
- package/Autocomplete/AutocompleteItem.d.ts +8 -0
- package/Autocomplete/AutocompleteItem.js +44 -0
- package/Autocomplete/index.d.ts +1 -2
- package/Autocomplete/index.js +1 -3
- package/Calendar/CalendarWeekDayLabel.d.ts +1 -1
- package/Highlighted/index.d.ts +5 -0
- package/Highlighted/index.js +5 -3
- package/Menu/MenuContainer.js +7 -6
- package/Menu/MenuItem.d.ts +13 -0
- package/Menu/MenuItem.js +9 -2
- package/PhoneField/templates.js +4 -4
- package/Typography/Base.d.ts +1 -1
- package/Typography/Blockquote.d.ts +1 -1
- package/Typography/List.d.ts +3 -3
- package/Typography/U.d.ts +1 -1
- package/package.json +2 -2
|
@@ -31,11 +31,13 @@ export interface AutocompleteProps<T, Multiple extends boolean | undefined = und
|
|
|
31
31
|
*/
|
|
32
32
|
readonly isLoading?: boolean;
|
|
33
33
|
/**
|
|
34
|
-
* Should the autocomplete element be cleared when blur and if no element is selected
|
|
34
|
+
* Should the autocomplete element be cleared when blur and if no element is selected\
|
|
35
|
+
* **Default:** `true`
|
|
35
36
|
*/
|
|
36
|
-
readonly
|
|
37
|
+
readonly clearOnBlur?: boolean;
|
|
37
38
|
/**
|
|
38
|
-
* Show clear button if clearable is true
|
|
39
|
+
* Show clear button if clearable is true\
|
|
40
|
+
* **Default:** `true`
|
|
39
41
|
*/
|
|
40
42
|
readonly clearable?: boolean;
|
|
41
43
|
/**
|
|
@@ -46,7 +46,7 @@ const context_1 = __importStar(require("./context"));
|
|
|
46
46
|
const IconClear_1 = __importDefault(require("./IconClear"));
|
|
47
47
|
const ClickOutside_1 = require("../ClickOutside");
|
|
48
48
|
const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
49
|
-
const { items, value, multiple, isOpen = false, isLoading = false,
|
|
49
|
+
const { items, value, multiple, isOpen = false, isLoading = false, clearOnBlur = true, anchorPos = 'auto-start-end', openOnFocus = true, requiredAsterisk, startIcon, fullWidth, placeholder, label, error, errorText, inputRef, filterItems, children, onChange, selectedItemToString, clearable = true, onInputChange, getOptionSelected, onRequestOpen = () => undefined, onRequestClose = () => undefined, overrides } = props, nativeInputProps = __rest(props, ["items", "value", "multiple", "isOpen", "isLoading", "clearOnBlur", "anchorPos", "openOnFocus", "requiredAsterisk", "startIcon", "fullWidth", "placeholder", "label", "error", "errorText", "inputRef", "filterItems", "children", "onChange", "selectedItemToString", "clearable", "onInputChange", "getOptionSelected", "onRequestOpen", "onRequestClose", "overrides"]);
|
|
50
50
|
const menuRef = react_1.default.useRef(null);
|
|
51
51
|
const fieldInputRef = react_1.default.useRef(null);
|
|
52
52
|
const isFocusedRef = react_1.default.useRef(false);
|
|
@@ -168,13 +168,11 @@ const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
|
168
168
|
}, [filteredItems]);
|
|
169
169
|
react_1.default.useEffect(() => {
|
|
170
170
|
if (currentOpen !== isOpen || currentLoading !== isLoading) {
|
|
171
|
-
// console.debug('Use effect 1', { currentOpen: isOpen, currentLoading: isLoading });
|
|
172
171
|
dispatch((0, context_1.actionSetPartial)({ currentOpen: isOpen, currentLoading: isLoading }));
|
|
173
172
|
}
|
|
174
173
|
}, [isOpen, isLoading, dispatch, currentOpen, currentLoading]);
|
|
175
174
|
react_1.default.useEffect(() => {
|
|
176
175
|
if (JSON.stringify(items) !== JSON.stringify(itemsRef.current)) {
|
|
177
|
-
// console.debug('Use effect 2', { filteredItems: applyFilterForItems(inputValue, items) });
|
|
178
176
|
itemsRef.current = items;
|
|
179
177
|
dispatch((0, context_1.actionSetPartial)({ filteredItems: applyFilterForItems(inputValue, items) }));
|
|
180
178
|
}
|
|
@@ -191,15 +189,34 @@ const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
|
191
189
|
}
|
|
192
190
|
parentElem = parentElem.parentNode;
|
|
193
191
|
}
|
|
192
|
+
// Click outside
|
|
194
193
|
if (needToClose) {
|
|
195
|
-
|
|
194
|
+
if (clearOnBlur) {
|
|
195
|
+
dispatch((0, context_1.actionSetPartial)({
|
|
196
|
+
inputValue: currentValue === null
|
|
197
|
+
? ''
|
|
198
|
+
: selectedItemToString(currentValue),
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
if (isOpen) {
|
|
202
|
+
onRequestClose(event);
|
|
203
|
+
}
|
|
196
204
|
}
|
|
197
205
|
};
|
|
198
206
|
window.document.addEventListener(ClickOutside_1.mouseEventMap.onMouseDown, mouseDownEvent);
|
|
199
207
|
return () => {
|
|
200
208
|
window.document.removeEventListener(ClickOutside_1.mouseEventMap.onMouseDown, mouseDownEvent);
|
|
201
209
|
};
|
|
202
|
-
}, [
|
|
210
|
+
}, [
|
|
211
|
+
onRequestClose,
|
|
212
|
+
anchorElement,
|
|
213
|
+
isOpen,
|
|
214
|
+
clearOnBlur,
|
|
215
|
+
dispatch,
|
|
216
|
+
value,
|
|
217
|
+
selectedItemToString,
|
|
218
|
+
currentValue,
|
|
219
|
+
]);
|
|
203
220
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
204
221
|
react_1.default.useMemo(() => (react_1.default.createElement(overridesMap.TextField, Object.assign({ placeholder: placeholder, label: label, error: error, requiredAsterisk: requiredAsterisk, errorText: errorText, fullWidth: fullWidth, startIcon: startIcon, isLoading: currentLoading, endIcon: clearable ? (react_1.default.createElement(Button_1.default, { iconOnly: true, type: "button", onClick: () => (currentLoading ? 'undefined' : clear()) }, currentLoading ? react_1.default.createElement(Spinner_1.default, null) : react_1.default.createElement(IconClear_1.default, null))) : undefined }, nativeInputProps, { onKeyDown: event => {
|
|
205
222
|
inputKeydownEvent(event);
|
|
@@ -284,18 +301,7 @@ const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
|
284
301
|
if (typeof onChange === 'function') {
|
|
285
302
|
onChange(item);
|
|
286
303
|
}
|
|
287
|
-
}, closeOnSelect: multiple ? false : true,
|
|
288
|
-
if (clearIfNotSelected) {
|
|
289
|
-
dispatch((0, context_1.actionSetPartial)({
|
|
290
|
-
inputValue: value !== null
|
|
291
|
-
? selectedItemToString(value)
|
|
292
|
-
: '',
|
|
293
|
-
}));
|
|
294
|
-
}
|
|
295
|
-
if ((evt === null || evt === void 0 ? void 0 : evt.target) !== anchorElement) {
|
|
296
|
-
onRequestClose(evt);
|
|
297
|
-
}
|
|
298
|
-
} }, ({ index, item }, itemProps) => children({ index, item: item, inputValue }, itemProps))), [
|
|
304
|
+
}, onRequestClose: onRequestClose, closeOnSelect: multiple ? false : true }, ({ index, item }, itemProps) => children({ index, item: item, inputValue }, itemProps))), [
|
|
299
305
|
anchorPos,
|
|
300
306
|
multiple,
|
|
301
307
|
filteredItems,
|
|
@@ -304,10 +310,6 @@ const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
|
304
310
|
anchorElement,
|
|
305
311
|
getOptionSelected,
|
|
306
312
|
onChange,
|
|
307
|
-
clearIfNotSelected,
|
|
308
|
-
dispatch,
|
|
309
|
-
value,
|
|
310
|
-
selectedItemToString,
|
|
311
313
|
onRequestClose,
|
|
312
314
|
children,
|
|
313
315
|
inputValue,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItemProps } from '../Menu/MenuItem';
|
|
3
|
+
export interface AutocompleteItemProps extends MenuItemProps {
|
|
4
|
+
readonly variant?: 'standard' | 'virtual';
|
|
5
|
+
readonly startIcon?: JSX.Element;
|
|
6
|
+
}
|
|
7
|
+
export declare const AutocompleteItem: React.ForwardRefExoticComponent<AutocompleteItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default AutocompleteItem;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AutocompleteItem = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
20
|
+
const react_2 = require("@emotion/react");
|
|
21
|
+
const MenuItem_1 = __importDefault(require("../Menu/MenuItem"));
|
|
22
|
+
const StyeldMenuItem = (0, styled_1.default)(MenuItem_1.default, {
|
|
23
|
+
shouldForwardProp: p => !['$vatiant'].includes(p),
|
|
24
|
+
}) `
|
|
25
|
+
${({ $variant, theme }) => $variant === 'virtual' &&
|
|
26
|
+
(0, react_2.css) `
|
|
27
|
+
background-color: ${theme.color.accentPrimary.alpha(0.1).toString()};
|
|
28
|
+
border-color: ${theme.color.accentPrimary.toString()};
|
|
29
|
+
color: ${theme.color.textPrimary.toString()};
|
|
30
|
+
border-style: dashed;
|
|
31
|
+
border-width: 0.02em;
|
|
32
|
+
|
|
33
|
+
:hover {
|
|
34
|
+
background-color: ${theme.color.accentPrimary.toString()};
|
|
35
|
+
color: ${theme.color.accentPrimaryContrast.toString()};
|
|
36
|
+
}
|
|
37
|
+
`}
|
|
38
|
+
`;
|
|
39
|
+
const AutocompleteItemWithRef = (props, ref) => {
|
|
40
|
+
const { variant = 'standard', children } = props, restMenuItemProps = __rest(props, ["variant", "children"]);
|
|
41
|
+
return (react_1.default.createElement(StyeldMenuItem, Object.assign({}, restMenuItemProps, { "$variant": variant, ref: ref }), children));
|
|
42
|
+
};
|
|
43
|
+
exports.AutocompleteItem = react_1.default.forwardRef(AutocompleteItemWithRef);
|
|
44
|
+
exports.default = exports.AutocompleteItem;
|
package/Autocomplete/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import AutocompleteItem from '../Menu/MenuItem';
|
|
3
2
|
import { AutocompleteProps, AutocompleteRef } from './AutocompleteContainer';
|
|
4
3
|
export * from './AutocompleteContainer';
|
|
5
|
-
export
|
|
4
|
+
export * from './AutocompleteItem';
|
|
6
5
|
declare const _default: <T, Multiple extends boolean | undefined = undefined>(props: AutocompleteProps<T, Multiple> & {
|
|
7
6
|
ref?: React.Ref<AutocompleteRef> | undefined;
|
|
8
7
|
}) => JSX.Element;
|
package/Autocomplete/index.js
CHANGED
|
@@ -28,13 +28,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.AutocompleteItem = void 0;
|
|
32
31
|
const react_1 = __importDefault(require("react"));
|
|
33
|
-
const MenuItem_1 = __importDefault(require("../Menu/MenuItem"));
|
|
34
|
-
exports.AutocompleteItem = MenuItem_1.default;
|
|
35
32
|
const AutocompleteContainer_1 = __importDefault(require("./AutocompleteContainer"));
|
|
36
33
|
const context_1 = require("./context");
|
|
37
34
|
__exportStar(require("./AutocompleteContainer"), exports);
|
|
35
|
+
__exportStar(require("./AutocompleteItem"), exports);
|
|
38
36
|
const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
39
37
|
const { children, items, isOpen, multiple, selectedItemToString, value } = props, restProps = __rest(props, ["children", "items", "isOpen", "multiple", "selectedItemToString", "value"]);
|
|
40
38
|
return (react_1.default.createElement(context_1.ContextProvider, { initialState: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: React.NamedExoticComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: React.ElementType<any> | undefined;
|
|
4
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
5
5
|
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>>;
|
|
6
6
|
export default _default;
|
package/Highlighted/index.d.ts
CHANGED
|
@@ -28,6 +28,11 @@ export interface HighlightedProps extends React.HTMLAttributes<HTMLSpanElement>
|
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
30
|
readonly caseSensitive?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Disable highlighting and show the plain text\
|
|
33
|
+
* **Default:** `false`
|
|
34
|
+
*/
|
|
35
|
+
readonly disabledHighlighting?: boolean;
|
|
31
36
|
/**
|
|
32
37
|
* Overridable components map
|
|
33
38
|
*/
|
package/Highlighted/index.js
CHANGED
|
@@ -26,7 +26,7 @@ exports.escapeRegex = escapeRegex;
|
|
|
26
26
|
* The component allows you to highlight text matches in a string
|
|
27
27
|
*/
|
|
28
28
|
const Highlighted = (props, ref) => {
|
|
29
|
-
const { text, highlight, overrides, caseSensitive = false } = props, nativeProps = __rest(props, ["text", "highlight", "overrides", "caseSensitive"]);
|
|
29
|
+
const { text, highlight, overrides, disabledHighlighting = false, caseSensitive = false } = props, nativeProps = __rest(props, ["text", "highlight", "overrides", "disabledHighlighting", "caseSensitive"]);
|
|
30
30
|
const patterns = react_1.default.useMemo(() => (typeof highlight === 'string' ? [highlight] : highlight)
|
|
31
31
|
.filter(h => h.trim() !== '')
|
|
32
32
|
.map(exports.escapeRegex), [highlight]);
|
|
@@ -37,8 +37,10 @@ const Highlighted = (props, ref) => {
|
|
|
37
37
|
Text: (overrides === null || overrides === void 0 ? void 0 : overrides.Text) || HighlightedText_1.default,
|
|
38
38
|
}), [overrides]);
|
|
39
39
|
return (react_1.default.createElement(overridesMap.Container, Object.assign({}, nativeProps, { ref: ref }),
|
|
40
|
-
|
|
41
|
-
patterns.length
|
|
40
|
+
disabledHighlighting && react_1.default.createElement(overridesMap.Text, null, text),
|
|
41
|
+
!disabledHighlighting && patterns.length === 0 && (react_1.default.createElement(overridesMap.Text, null, text)),
|
|
42
|
+
!disabledHighlighting &&
|
|
43
|
+
patterns.length > 0 &&
|
|
42
44
|
text
|
|
43
45
|
.split(regex)
|
|
44
46
|
.map((part, i) => regex.test(part) ? (react_1.default.createElement(overridesMap.Mark, { key: i }, part)) : (react_1.default.createElement(overridesMap.Text, { key: i }, part)))));
|
package/Menu/MenuContainer.js
CHANGED
|
@@ -61,10 +61,8 @@ const MenuContainer = react_1.default.forwardRef((props, ref) => {
|
|
|
61
61
|
}
|
|
62
62
|
return [...idx];
|
|
63
63
|
}, [getOptionSelected, items, multiple, value]);
|
|
64
|
-
// const [currentAnchorPos, setCurrentAnchorPos] = React.useState(anchorPos);
|
|
65
|
-
const [menuIsOpen, setMenuOpen] = react_1.default.useState(Boolean(isOpen));
|
|
66
64
|
const [currentAnchorElement, setAnchorElement] = react_1.default.useState(anchorElement);
|
|
67
|
-
const isOpenRef = react_1.default.useRef(
|
|
65
|
+
const isOpenRef = react_1.default.useRef(isOpen);
|
|
68
66
|
const menuListRef = react_1.default.useRef(null);
|
|
69
67
|
const menuPopperRef = react_1.default.useRef(null);
|
|
70
68
|
const { dispatch, state: { selectedIndexes, markedIndex, hoveredIndex }, } = (0, context_1.default)();
|
|
@@ -291,14 +289,17 @@ const MenuContainer = react_1.default.forwardRef((props, ref) => {
|
|
|
291
289
|
return () => {
|
|
292
290
|
window.document.removeEventListener('resize', windowResizeEvent);
|
|
293
291
|
};
|
|
294
|
-
}, [
|
|
292
|
+
}, [isOpen, onRequestClose, anchorElement, closeOutsideClick]);
|
|
295
293
|
/**
|
|
296
294
|
* Toggle menu open
|
|
297
295
|
*/
|
|
298
296
|
react_1.default.useEffect(() => {
|
|
299
297
|
if (isOpenRef.current !== isOpen) {
|
|
300
298
|
isOpenRef.current = Boolean(isOpen);
|
|
301
|
-
setMenuOpen(Boolean(isOpen));
|
|
299
|
+
// setMenuOpen(Boolean(isOpen));
|
|
300
|
+
if (!isOpen) {
|
|
301
|
+
onRequestClose();
|
|
302
|
+
}
|
|
302
303
|
if (isOpen) {
|
|
303
304
|
scrollToFirstSelected();
|
|
304
305
|
if (autofocus) {
|
|
@@ -314,7 +315,7 @@ const MenuContainer = react_1.default.forwardRef((props, ref) => {
|
|
|
314
315
|
dispatch((0, context_1.actionSetmenuState)({ markedIndex: -1, hoveredIndex: -1 }));
|
|
315
316
|
}
|
|
316
317
|
}
|
|
317
|
-
}, [getSelectedIndexes, scrollToFirstSelected, isOpen, autofocus, dispatch]);
|
|
318
|
+
}, [getSelectedIndexes, scrollToFirstSelected, isOpen, autofocus, dispatch, onRequestClose]);
|
|
318
319
|
/**
|
|
319
320
|
* Mark selected items by values
|
|
320
321
|
*/
|
package/Menu/MenuItem.d.ts
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type MenuItemProps = React.HTMLAttributes<HTMLDivElement> & MenuItemCommonProps;
|
|
3
3
|
export type MenuItemCommonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Selected flag
|
|
6
|
+
*/
|
|
4
7
|
readonly selected: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Hovered flag
|
|
10
|
+
*/
|
|
5
11
|
readonly hovered: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* React key
|
|
14
|
+
*/
|
|
6
15
|
readonly key: React.Key;
|
|
7
16
|
readonly onMouseEnter: React.MouseEventHandler<HTMLDivElement>;
|
|
8
17
|
readonly onMouseLeave: React.MouseEventHandler<HTMLDivElement>;
|
|
9
18
|
readonly onClick: React.MouseEventHandler<HTMLDivElement>;
|
|
19
|
+
/**
|
|
20
|
+
* Icon or another JSX element placed before button label
|
|
21
|
+
*/
|
|
22
|
+
readonly startIcon?: JSX.Element;
|
|
10
23
|
};
|
|
11
24
|
declare const MenuItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & MenuItemCommonProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
25
|
export default MenuItem;
|
package/Menu/MenuItem.js
CHANGED
|
@@ -20,6 +20,8 @@ const react_2 = require("@emotion/react");
|
|
|
20
20
|
const InnerContainer = styled_1.default.div `
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
user-select: none;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
23
25
|
padding: 0.4em 0.8em;
|
|
24
26
|
transition: all 240ms ease-out;
|
|
25
27
|
border-radius: ${({ theme }) => theme.shape.radiusFactor}em;
|
|
@@ -48,9 +50,14 @@ const InnerContainer = styled_1.default.div `
|
|
|
48
50
|
}
|
|
49
51
|
`}
|
|
50
52
|
`;
|
|
53
|
+
const ItemIconWrapper = styled_1.default.span `
|
|
54
|
+
margin-right: 0.5em;
|
|
55
|
+
`;
|
|
51
56
|
const MenuItem = react_1.default.forwardRef((props, ref) => {
|
|
52
|
-
const { children, selected, hovered, onMouseEnter, onMouseLeave, onClick } = props, nativeProps = __rest(props, ["children", "selected", "hovered", "onMouseEnter", "onMouseLeave", "onClick"]);
|
|
53
|
-
return (react_1.default.createElement(InnerContainer, Object.assign({}, nativeProps, { ref: ref, onMouseLeave: onMouseLeave, onMouseEnter: onMouseEnter, onClick: onClick, selected: selected, hovered: hovered }),
|
|
57
|
+
const { children, selected, hovered, onMouseEnter, onMouseLeave, onClick, startIcon } = props, nativeProps = __rest(props, ["children", "selected", "hovered", "onMouseEnter", "onMouseLeave", "onClick", "startIcon"]);
|
|
58
|
+
return (react_1.default.createElement(InnerContainer, Object.assign({}, nativeProps, { ref: ref, onMouseLeave: onMouseLeave, onMouseEnter: onMouseEnter, onClick: onClick, selected: selected, hovered: hovered }),
|
|
59
|
+
typeof startIcon !== 'undefined' && startIcon !== null && (react_1.default.createElement(ItemIconWrapper, null, startIcon)),
|
|
60
|
+
children));
|
|
54
61
|
});
|
|
55
62
|
MenuItem.displayName = 'MenuItem';
|
|
56
63
|
exports.default = MenuItem;
|
package/PhoneField/templates.js
CHANGED
|
@@ -15,8 +15,8 @@ const US_1 = __importDefault(require("../CountryFlags/US"));
|
|
|
15
15
|
const IL_1 = __importDefault(require("../CountryFlags/IL"));
|
|
16
16
|
exports.templates = [
|
|
17
17
|
// Russian template
|
|
18
|
-
['RU', react_1.default.createElement(RU_1.default, { key: "ru-1" }), '7', '+x (xxx) xxx-xx-xx', '+7 (987) 654-32-10', /^\+$/],
|
|
19
|
-
['RU', react_1.default.createElement(RU_1.default, { key: "ru-2" }), '7', '8 (xxx) xxx-xx-xx', '8 (987) 654-32-10', /^8[^1]{0,}/],
|
|
18
|
+
['RU', react_1.default.createElement(RU_1.default, { key: "ru-1" }), '7', '+x (xxx) xxx-xx-xx', '+7 (987) 654-32-10', /^\+$/], // must be at first (Default RU)
|
|
19
|
+
['RU', react_1.default.createElement(RU_1.default, { key: "ru-2" }), '7', '8 (xxx) xxx-xx-xx', '8 (987) 654-32-10', /^8[^1]{0,}/], // 8912...
|
|
20
20
|
[
|
|
21
21
|
'RU',
|
|
22
22
|
react_1.default.createElement(RU_1.default, { key: "ru-3" }),
|
|
@@ -24,7 +24,7 @@ exports.templates = [
|
|
|
24
24
|
'+7 (xxx) xxx-xx-xx',
|
|
25
25
|
'+7 (987) 654-32-10',
|
|
26
26
|
/^\+{0,1}7([0-5]|[8-9])[0-9][0-9]/,
|
|
27
|
-
],
|
|
27
|
+
], // +79...
|
|
28
28
|
// Other fucking countries
|
|
29
29
|
['BY', react_1.default.createElement(BY_1.default, { key: "by" }), '375', '+375 (xx) xxx-xx-xx', '+375 (98) 765-43-21', /^\+{0,1}375/],
|
|
30
30
|
['KZ', react_1.default.createElement(KZ_1.default, { key: "kz-1" }), '7', '+997 (xx) xxx-xx-xx', '+997 (98) 765-43-21', /^\+{0,1}997/],
|
|
@@ -35,7 +35,7 @@ exports.templates = [
|
|
|
35
35
|
'+7 (xxx) xxx-xx-xx',
|
|
36
36
|
'+7 (600) 765-43-21',
|
|
37
37
|
/^\+{0,1}7[6-7][0-9][0-9]/,
|
|
38
|
-
],
|
|
38
|
+
], // +7600 - +7700
|
|
39
39
|
['UA', react_1.default.createElement(UA_1.default, { key: "ua" }), '380', '+380 (xx) xxx-xxxx', '+380 (98) 765-4321', /^\+{0,1}380/],
|
|
40
40
|
['JP', react_1.default.createElement(JP_1.default, { key: "jp" }), '81', '+81 (xx) xxx-xxxx', '+81 (98) 765-4321', /^\+{0,1}81/],
|
|
41
41
|
['US', react_1.default.createElement(US_1.default, { key: "us" }), '1', '+1 xxx xxx-xx-xx', '+1 987 654-32-10', /^\+{0,1}1/],
|
package/Typography/Base.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
declare const Base: import("@emotion/styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any> | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
10
10
|
export default Base;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const Blockquote: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>, {}>;
|
|
6
6
|
export default Blockquote;
|
package/Typography/List.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Ul: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
|
|
6
6
|
export declare const Ol: import("@emotion/styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
-
as?: import("react").ElementType<any> | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, {}>;
|
|
10
10
|
export declare const Li: import("@emotion/styled").StyledComponent<{
|
|
11
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
-
as?: import("react").ElementType<any> | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
13
|
}, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
|
|
14
14
|
export default Ul;
|
package/Typography/U.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
declare const U: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: import("react").ElementType<any> | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
5
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, {}>;
|
|
6
6
|
export default U;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@via-profit/ui-kit",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.74",
|
|
4
4
|
"description": "UI Kit",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"shebang-loader": "^0.0.1",
|
|
89
89
|
"terser-webpack-plugin": "^5.3.9",
|
|
90
90
|
"ts-node": "^10.9.2",
|
|
91
|
-
"type-fest": "^4.
|
|
91
|
+
"type-fest": "^4.9.0",
|
|
92
92
|
"typescript": "^5.3.3",
|
|
93
93
|
"url-loader": "^4.1.1",
|
|
94
94
|
"webpack": "^5.89.0",
|