@via-profit/ui-kit 0.1.0-rc.1 → 0.1.0-rc.2
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/package.json +5 -4
- package/CHANGELOG.md +0 -0
- package/CONTRIBUTING.md +0 -0
- package/dist/Autocomplete/index.d.ts +0 -46
- package/dist/Autocomplete/index.js +0 -187
- package/dist/Autocomplete/popper-options.d.ts +0 -4
- package/dist/Autocomplete/popper-options.js +0 -33
- package/dist/Button/ButtonAccent.d.ts +0 -10
- package/dist/Button/ButtonAccent.js +0 -48
- package/dist/Button/ButtonBase.d.ts +0 -4
- package/dist/Button/ButtonBase.js +0 -38
- package/dist/Button/ButtonStandard.d.ts +0 -19
- package/dist/Button/ButtonStandard.js +0 -50
- package/dist/Button/index.d.ts +0 -9
- package/dist/Button/index.js +0 -27
- package/dist/Calendar/CalendarBottomBar.d.ts +0 -4
- package/dist/Calendar/CalendarBottomBar.js +0 -28
- package/dist/Calendar/CalendarCell.d.ts +0 -8
- package/dist/Calendar/CalendarCell.js +0 -61
- package/dist/Calendar/CalendarDateContainer.d.ts +0 -6
- package/dist/Calendar/CalendarDateContainer.js +0 -13
- package/dist/Calendar/CalendarEmptyCell.d.ts +0 -4
- package/dist/Calendar/CalendarEmptyCell.js +0 -29
- package/dist/Calendar/CalendarMonthControl.d.ts +0 -6
- package/dist/Calendar/CalendarMonthControl.js +0 -49
- package/dist/Calendar/CalendarPaper.d.ts +0 -6
- package/dist/Calendar/CalendarPaper.js +0 -20
- package/dist/Calendar/CalendarTopBar.d.ts +0 -4
- package/dist/Calendar/CalendarTopBar.js +0 -30
- package/dist/Calendar/CalendarWeekDayLabel.d.ts +0 -6
- package/dist/Calendar/CalendarWeekDayLabel.js +0 -17
- package/dist/Calendar/CalendarWeekDaysBar.d.ts +0 -10
- package/dist/Calendar/CalendarWeekDaysBar.js +0 -32
- package/dist/Calendar/CalendarWeekRow.d.ts +0 -6
- package/dist/Calendar/CalendarWeekRow.js +0 -14
- package/dist/Calendar/IconChevronLeft.d.ts +0 -3
- package/dist/Calendar/IconChevronLeft.js +0 -9
- package/dist/Calendar/IconChevronRight.d.ts +0 -3
- package/dist/Calendar/IconChevronRight.js +0 -9
- package/dist/Calendar/index.d.ts +0 -18
- package/dist/Calendar/index.js +0 -166
- package/dist/Calendar/use-calendar.d.ts +0 -50
- package/dist/Calendar/use-calendar.js +0 -197
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -8
- package/dist/ErrorBoundary/index.d.ts +0 -19
- package/dist/ErrorBoundary/index.js +0 -78
- package/dist/Image/index.d.ts +0 -7
- package/dist/Image/index.js +0 -45
- package/dist/MaskedField/index.d.ts +0 -33
- package/dist/MaskedField/index.js +0 -63
- package/dist/MaskedField/templates.d.ts +0 -11
- package/dist/MaskedField/templates.js +0 -81
- package/dist/MaskedField/useMasked.d.ts +0 -18
- package/dist/MaskedField/useMasked.js +0 -96
- package/dist/Menu/MenuItem.d.ts +0 -10
- package/dist/Menu/MenuItem.js +0 -47
- package/dist/Menu/MenuItemInner.d.ts +0 -7
- package/dist/Menu/MenuItemInner.js +0 -48
- package/dist/Menu/MenuWrapper.d.ts +0 -10
- package/dist/Menu/MenuWrapper.js +0 -77
- package/dist/Menu/index.d.ts +0 -196
- package/dist/Menu/index.js +0 -452
- package/dist/Menu/popper-options.d.ts +0 -4
- package/dist/Menu/popper-options.js +0 -33
- package/dist/Menu/reducer.d.ts +0 -14
- package/dist/Menu/reducer.js +0 -19
- package/dist/Modal/CloseIcon.d.ts +0 -3
- package/dist/Modal/CloseIcon.js +0 -37
- package/dist/Modal/ModalConfirmBox.d.ts +0 -9
- package/dist/Modal/ModalConfirmBox.js +0 -148
- package/dist/Modal/ModalDialog.d.ts +0 -7
- package/dist/Modal/ModalDialog.js +0 -99
- package/dist/Modal/ModalDrawer.d.ts +0 -11
- package/dist/Modal/ModalDrawer.js +0 -150
- package/dist/Modal/ModalMessageBox.d.ts +0 -8
- package/dist/Modal/ModalMessageBox.js +0 -147
- package/dist/Modal/index.d.ts +0 -12
- package/dist/Modal/index.js +0 -54
- package/dist/NoSSR/index.d.ts +0 -7
- package/dist/NoSSR/index.js +0 -15
- package/dist/PhoneField/CountryFlag.d.ts +0 -6
- package/dist/PhoneField/CountryFlag.js +0 -52
- package/dist/PhoneField/flags/BYFlag.d.ts +0 -3
- package/dist/PhoneField/flags/BYFlag.js +0 -44
- package/dist/PhoneField/flags/JPFlag.d.ts +0 -3
- package/dist/PhoneField/flags/JPFlag.js +0 -34
- package/dist/PhoneField/flags/KZFlag.d.ts +0 -3
- package/dist/PhoneField/flags/KZFlag.js +0 -45
- package/dist/PhoneField/flags/RUFlag.d.ts +0 -3
- package/dist/PhoneField/flags/RUFlag.js +0 -32
- package/dist/PhoneField/flags/UAFlag.d.ts +0 -3
- package/dist/PhoneField/flags/UAFlag.js +0 -31
- package/dist/PhoneField/flags/USFlag.d.ts +0 -3
- package/dist/PhoneField/flags/USFlag.js +0 -34
- package/dist/PhoneField/flags/UnknownFlag.d.ts +0 -3
- package/dist/PhoneField/flags/UnknownFlag.js +0 -34
- package/dist/PhoneField/index.d.ts +0 -49
- package/dist/PhoneField/index.js +0 -82
- package/dist/PhoneField/templates.d.ts +0 -3
- package/dist/PhoneField/templates.js +0 -18
- package/dist/PhoneField/usePhoneUtils.d.ts +0 -65
- package/dist/PhoneField/usePhoneUtils.js +0 -157
- package/dist/SelectBox/IconChevronDown.d.ts +0 -3
- package/dist/SelectBox/IconChevronDown.js +0 -9
- package/dist/SelectBox/SelectButton.d.ts +0 -10
- package/dist/SelectBox/SelectButton.js +0 -80
- package/dist/SelectBox/index.d.ts +0 -40
- package/dist/SelectBox/index.js +0 -188
- package/dist/SelectBox/popper-options.d.ts +0 -4
- package/dist/SelectBox/popper-options.js +0 -33
- package/dist/TextField/TextFieldContainer.d.ts +0 -7
- package/dist/TextField/TextFieldContainer.js +0 -52
- package/dist/TextField/TextFieldErrorText.d.ts +0 -8
- package/dist/TextField/TextFieldErrorText.js +0 -75
- package/dist/TextField/TextFieldIconWrapper.d.ts +0 -8
- package/dist/TextField/TextFieldIconWrapper.js +0 -73
- package/dist/TextField/TextFieldInput.d.ts +0 -7
- package/dist/TextField/TextFieldInput.js +0 -60
- package/dist/TextField/TextFieldLabel.d.ts +0 -7
- package/dist/TextField/TextFieldLabel.js +0 -50
- package/dist/TextField/TextFieldLabelAsterisk.d.ts +0 -7
- package/dist/TextField/TextFieldLabelAsterisk.js +0 -51
- package/dist/TextField/TextFieldWrapper.d.ts +0 -14
- package/dist/TextField/TextFieldWrapper.js +0 -76
- package/dist/TextField/index.d.ts +0 -14
- package/dist/TextField/index.js +0 -93
- package/dist/ThemeProvider/createTheme.d.ts +0 -36
- package/dist/ThemeProvider/createTheme.js +0 -34
- package/dist/ThemeProvider/index.d.ts +0 -8
- package/dist/ThemeProvider/index.js +0 -12
- package/dist/Typography/Base.d.ts +0 -6
- package/dist/Typography/Base.js +0 -11
- package/dist/Typography/Blockquote.d.ts +0 -6
- package/dist/Typography/Blockquote.js +0 -23
- package/dist/Typography/Del.d.ts +0 -6
- package/dist/Typography/Del.js +0 -10
- package/dist/Typography/Em.d.ts +0 -6
- package/dist/Typography/Em.js +0 -10
- package/dist/Typography/H1.d.ts +0 -6
- package/dist/Typography/H1.js +0 -11
- package/dist/Typography/H2.d.ts +0 -6
- package/dist/Typography/H2.js +0 -11
- package/dist/Typography/H3.d.ts +0 -6
- package/dist/Typography/H3.js +0 -11
- package/dist/Typography/H4.d.ts +0 -6
- package/dist/Typography/H4.js +0 -11
- package/dist/Typography/H5.d.ts +0 -6
- package/dist/Typography/H5.js +0 -11
- package/dist/Typography/List.d.ts +0 -14
- package/dist/Typography/List.js +0 -17
- package/dist/Typography/Paragraph.d.ts +0 -6
- package/dist/Typography/Paragraph.js +0 -11
- package/dist/Typography/SectionDescription.d.ts +0 -8
- package/dist/Typography/SectionDescription.js +0 -17
- package/dist/Typography/SectionTitle.d.ts +0 -8
- package/dist/Typography/SectionTitle.js +0 -31
- package/dist/Typography/Span.d.ts +0 -6
- package/dist/Typography/Span.js +0 -10
- package/dist/Typography/Strong.d.ts +0 -6
- package/dist/Typography/Strong.js +0 -10
- package/dist/Typography/U.d.ts +0 -6
- package/dist/Typography/U.js +0 -10
- package/dist/color/Color.d.ts +0 -44
- package/dist/color/Color.js +0 -346
- package/dist/color/index.d.ts +0 -3
- package/dist/color/index.js +0 -22
- package/dist/index.d.ts +0 -4
- /package/{dist/index.js → index.js} +0 -0
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@via-profit/ui-kit",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.2",
|
|
4
4
|
"description": "UI Kit",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"files": ["dist"],
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git@github.com:via-profit/ui-kit.git"
|
|
@@ -13,9 +14,9 @@
|
|
|
13
14
|
"author": "Via Profit",
|
|
14
15
|
"license": "MIT",
|
|
15
16
|
"scripts": {
|
|
16
|
-
"build": "tsc",
|
|
17
17
|
"lint": "eslint --fix .",
|
|
18
|
-
"
|
|
18
|
+
"build": "node ./scripts/build.js",
|
|
19
|
+
"publish:package": "bash ./scripts/pub.sh"
|
|
19
20
|
},
|
|
20
21
|
"publishConfig": {
|
|
21
22
|
"access": "public"
|
package/CHANGELOG.md
DELETED
|
File without changes
|
package/CONTRIBUTING.md
DELETED
|
File without changes
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MenuRef, MenuProps, Value } from '../Menu';
|
|
3
|
-
export type AutocompleteProps<T, Multiple extends boolean | undefined = undefined> = AutocompleteMenuProps<T, Multiple>;
|
|
4
|
-
export type AutocompleteContainerRef = HTMLDivElement;
|
|
5
|
-
type AutocompleteMenuProps<T, Multiple extends boolean | undefined = undefined> = Pick<MenuProps<T, Multiple>, 'items' | 'value' | 'estimatedItemSize' | 'endThreshold' | 'overscanCount' | 'getOptionSelected' | 'onEndReached' | 'onSelectItem' | 'renderItem' | 'multiple' | 'zIndex' | 'onRequestClose' | 'isOpen'> & {
|
|
6
|
-
readonly containerRef?: React.Ref<AutocompleteContainerRef>;
|
|
7
|
-
readonly itemToString: ItemToString<T, Multiple>;
|
|
8
|
-
readonly renderInput: (params: RenderInputProps<T, Multiple>) => React.ReactNode;
|
|
9
|
-
readonly onRequestOpen: (event?: FocusEvent | KeyboardEvent | MouseEvent | React.FocusEvent | React.KeyboardEvent | React.MouseEvent) => void;
|
|
10
|
-
readonly onInputChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
11
|
-
readonly filterItems?: (items: readonly T[], data: {
|
|
12
|
-
readonly query: string;
|
|
13
|
-
readonly inputValue: string;
|
|
14
|
-
}) => readonly T[];
|
|
15
|
-
};
|
|
16
|
-
export type ItemToString<T, Multiple> = Multiple extends undefined | false ? (item: T) => string : undefined;
|
|
17
|
-
export type RenderInputProps<T, Multiple extends boolean | undefined = undefined> = {
|
|
18
|
-
readonly selected: Value<T, Multiple> | null;
|
|
19
|
-
readonly value: string;
|
|
20
|
-
readonly inputRef: React.Ref<HTMLInputElement>;
|
|
21
|
-
readonly onClick: React.MouseEventHandler<HTMLInputElement>;
|
|
22
|
-
readonly onFocus: React.FocusEventHandler<HTMLInputElement>;
|
|
23
|
-
readonly onBlur: React.FocusEventHandler<HTMLInputElement>;
|
|
24
|
-
readonly onKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
25
|
-
readonly onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
26
|
-
};
|
|
27
|
-
export type AutocompleteRef<T> = Pick<MenuRef<T>, 'scrollToItem' | 'scrollTo' | 'scrollToFirstSelected' | 'selectItem' | 'highlightIndex' | 'hightlightPrevItem' | 'hightlightNextItem' | 'hightlightFirstItem' | 'hightlightLastItem' | 'selectHightlightedItem' | 'updatePopper'> & {
|
|
28
|
-
readonly clear: () => void;
|
|
29
|
-
readonly focus: () => void;
|
|
30
|
-
readonly blur: () => void;
|
|
31
|
-
readonly clearInput: () => void;
|
|
32
|
-
};
|
|
33
|
-
declare const _default: <T, Multiple extends boolean | undefined = undefined>(props: Pick<MenuProps<T, Multiple>, "zIndex" | "value" | "isOpen" | "estimatedItemSize" | "overscanCount" | "items" | "endThreshold" | "multiple" | "getOptionSelected" | "onEndReached" | "onSelectItem" | "renderItem" | "onRequestClose"> & {
|
|
34
|
-
readonly containerRef?: React.Ref<HTMLDivElement> | undefined;
|
|
35
|
-
readonly itemToString: ItemToString<T, Multiple>;
|
|
36
|
-
readonly renderInput: (params: RenderInputProps<T, Multiple>) => React.ReactNode;
|
|
37
|
-
readonly onRequestOpen: (event?: MouseEvent | KeyboardEvent | FocusEvent | React.FocusEvent<Element, Element> | React.KeyboardEvent<Element> | React.MouseEvent<Element, MouseEvent> | undefined) => void;
|
|
38
|
-
readonly onInputChange?: React.ChangeEventHandler<HTMLInputElement> | undefined;
|
|
39
|
-
readonly filterItems?: ((items: readonly T[], data: {
|
|
40
|
-
readonly query: string;
|
|
41
|
-
readonly inputValue: string;
|
|
42
|
-
}) => readonly T[]) | undefined;
|
|
43
|
-
} & {
|
|
44
|
-
ref?: React.Ref<AutocompleteRef<T>> | undefined;
|
|
45
|
-
}) => JSX.Element;
|
|
46
|
-
export default _default;
|
|
@@ -1,187 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const Menu_1 = __importDefault(require("../Menu"));
|
|
8
|
-
const popper_options_1 = __importDefault(require("./popper-options"));
|
|
9
|
-
const Autocomplete = react_1.default.forwardRef((props, ref) => {
|
|
10
|
-
const { items, value, estimatedItemSize, endThreshold, overscanCount, zIndex, isOpen, multiple, itemToString, containerRef, filterItems, renderInput, getOptionSelected, onEndReached, onSelectItem, renderItem, onRequestClose, onRequestOpen, onInputChange, } = props;
|
|
11
|
-
const [inputValue, setInputValue] = react_1.default.useState('');
|
|
12
|
-
const menuRef = react_1.default.useRef(null);
|
|
13
|
-
const isFocusedRef = react_1.default.useRef(false);
|
|
14
|
-
const [currentOpen, setCurrentOpen] = react_1.default.useState(isOpen);
|
|
15
|
-
const [currentValue, setCurrentValue] = react_1.default.useState(value);
|
|
16
|
-
const [anchorElement, setAnchorElement] = react_1.default.useState(null);
|
|
17
|
-
const [filteredItems, setFilteredItems] = react_1.default.useState(items);
|
|
18
|
-
/**
|
|
19
|
-
* API
|
|
20
|
-
*/
|
|
21
|
-
react_1.default.useImperativeHandle(ref, () => ({
|
|
22
|
-
highlightIndex: (index) => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.highlightIndex(index); },
|
|
23
|
-
hightlightPrevItem: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.hightlightPrevItem(); },
|
|
24
|
-
hightlightNextItem: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.hightlightNextItem(); },
|
|
25
|
-
hightlightFirstItem: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.hightlightFirstItem(); },
|
|
26
|
-
hightlightLastItem: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.hightlightLastItem(); },
|
|
27
|
-
selectHightlightedItem: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.selectHightlightedItem(); },
|
|
28
|
-
updatePopper: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.updatePopper(); },
|
|
29
|
-
scrollToFirstSelected: () => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.scrollToFirstSelected(); },
|
|
30
|
-
selectItem: (index) => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.selectItem(index); },
|
|
31
|
-
scrollTo: (scrollOffset) => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo(scrollOffset); },
|
|
32
|
-
scrollToItem: (index, align) => { var _a; return (_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.scrollToItem(index, align); },
|
|
33
|
-
clear: () => {
|
|
34
|
-
setCurrentValue(null);
|
|
35
|
-
setInputValue('');
|
|
36
|
-
anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.focus();
|
|
37
|
-
setFilteredItems(items);
|
|
38
|
-
},
|
|
39
|
-
focus: () => anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.focus(),
|
|
40
|
-
blur: () => anchorElement === null || anchorElement === void 0 ? void 0 : anchorElement.blur(),
|
|
41
|
-
clearInput: () => setInputValue(''),
|
|
42
|
-
}), [anchorElement, items]);
|
|
43
|
-
const inputKeydownEvent = react_1.default.useCallback((event) => {
|
|
44
|
-
var _a, _b, _c, _d, _e;
|
|
45
|
-
if (!isFocusedRef.current) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
switch (event.code) {
|
|
49
|
-
case 'Enter':
|
|
50
|
-
case 'NumpadEnter':
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
(_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.selectHightlightedItem();
|
|
53
|
-
break;
|
|
54
|
-
case 'ArrowUp':
|
|
55
|
-
{
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
(_b = menuRef.current) === null || _b === void 0 ? void 0 : _b.hightlightPrevItem();
|
|
58
|
-
}
|
|
59
|
-
break;
|
|
60
|
-
case 'ArrowDown':
|
|
61
|
-
{
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
(_c = menuRef.current) === null || _c === void 0 ? void 0 : _c.hightlightNextItem();
|
|
64
|
-
if (!currentOpen) {
|
|
65
|
-
onRequestOpen(event);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
case 'Home':
|
|
70
|
-
{
|
|
71
|
-
event.preventDefault();
|
|
72
|
-
(_d = menuRef.current) === null || _d === void 0 ? void 0 : _d.hightlightFirstItem();
|
|
73
|
-
}
|
|
74
|
-
break;
|
|
75
|
-
case 'End':
|
|
76
|
-
{
|
|
77
|
-
event.preventDefault();
|
|
78
|
-
(_e = menuRef.current) === null || _e === void 0 ? void 0 : _e.hightlightLastItem();
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
case 'PageUp':
|
|
82
|
-
case 'PageDown':
|
|
83
|
-
event.preventDefault();
|
|
84
|
-
break;
|
|
85
|
-
case 'Escape':
|
|
86
|
-
case 'Tab':
|
|
87
|
-
onRequestClose(event);
|
|
88
|
-
break;
|
|
89
|
-
default:
|
|
90
|
-
if (!currentOpen) {
|
|
91
|
-
onRequestOpen(event);
|
|
92
|
-
}
|
|
93
|
-
// do nothing
|
|
94
|
-
break;
|
|
95
|
-
}
|
|
96
|
-
}, [currentOpen, onRequestClose, onRequestOpen]);
|
|
97
|
-
const onSelectItemF = react_1.default.useCallback(selected => {
|
|
98
|
-
setCurrentValue(selected);
|
|
99
|
-
if (typeof onSelectItem === 'function') {
|
|
100
|
-
if (!Array.isArray(selected) && typeof itemToString === 'function') {
|
|
101
|
-
setInputValue(itemToString(selected));
|
|
102
|
-
}
|
|
103
|
-
onSelectItem(selected);
|
|
104
|
-
}
|
|
105
|
-
}, [itemToString, onSelectItem]);
|
|
106
|
-
react_1.default.useEffect(() => {
|
|
107
|
-
if (value === null) {
|
|
108
|
-
setCurrentValue(null);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (multiple) {
|
|
112
|
-
if (Array.isArray(value)) {
|
|
113
|
-
setCurrentValue(value);
|
|
114
|
-
}
|
|
115
|
-
if (!Array.isArray(value)) {
|
|
116
|
-
setCurrentValue([value]);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (!multiple) {
|
|
120
|
-
if (Array.isArray(value)) {
|
|
121
|
-
setCurrentValue(value[0]);
|
|
122
|
-
}
|
|
123
|
-
if (!Array.isArray(value)) {
|
|
124
|
-
setCurrentValue(value);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}, [value, multiple]);
|
|
128
|
-
react_1.default.useEffect(() => {
|
|
129
|
-
setCurrentOpen(isOpen);
|
|
130
|
-
}, [isOpen]);
|
|
131
|
-
const renderInputOnChange = react_1.default.useCallback(event => {
|
|
132
|
-
setInputValue(event.currentTarget.value);
|
|
133
|
-
if (typeof onInputChange === 'function') {
|
|
134
|
-
onInputChange(event);
|
|
135
|
-
}
|
|
136
|
-
const query = event.currentTarget.value.toLowerCase().trim();
|
|
137
|
-
// Apply filter
|
|
138
|
-
const newItems = typeof filterItems !== 'function' || query.length === 0
|
|
139
|
-
? items
|
|
140
|
-
: filterItems(items, { query, inputValue });
|
|
141
|
-
setFilteredItems(newItems);
|
|
142
|
-
}, [inputValue, items, onInputChange, filterItems]);
|
|
143
|
-
react_1.default.useEffect(() => {
|
|
144
|
-
var _a;
|
|
145
|
-
if (filteredItems.length === 1) {
|
|
146
|
-
(_a = menuRef.current) === null || _a === void 0 ? void 0 : _a.highlightIndex(0);
|
|
147
|
-
}
|
|
148
|
-
}, [filteredItems]);
|
|
149
|
-
const inputElement = react_1.default.useMemo(() => {
|
|
150
|
-
const elem = renderInput({
|
|
151
|
-
inputRef: setAnchorElement,
|
|
152
|
-
value: inputValue,
|
|
153
|
-
selected: currentValue,
|
|
154
|
-
onBlur: () => {
|
|
155
|
-
isFocusedRef.current = false;
|
|
156
|
-
},
|
|
157
|
-
onFocus: event => {
|
|
158
|
-
isFocusedRef.current = true;
|
|
159
|
-
onRequestOpen(event);
|
|
160
|
-
},
|
|
161
|
-
onKeyDown: inputKeydownEvent,
|
|
162
|
-
onChange: renderInputOnChange,
|
|
163
|
-
onClick: event => {
|
|
164
|
-
if (isFocusedRef.current) {
|
|
165
|
-
onRequestOpen(event);
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
return elem;
|
|
170
|
-
}, [
|
|
171
|
-
inputKeydownEvent,
|
|
172
|
-
inputValue,
|
|
173
|
-
onRequestOpen,
|
|
174
|
-
renderInput,
|
|
175
|
-
renderInputOnChange,
|
|
176
|
-
currentValue,
|
|
177
|
-
]);
|
|
178
|
-
return (react_1.default.createElement("div", { ref: containerRef },
|
|
179
|
-
inputElement,
|
|
180
|
-
react_1.default.createElement(Menu_1.default, { ref: menuRef, items: filteredItems, value: currentValue, isOpen: currentOpen && filteredItems.length > 0, autofocus: false, anchorElement: anchorElement, estimatedItemSize: estimatedItemSize, endThreshold: endThreshold, overscanCount: overscanCount, getOptionSelected: getOptionSelected, onEndReached: onEndReached, onSelectItem: onSelectItemF, renderItem: renderItem, multiple: multiple, zIndex: zIndex, closeOutsideClick: true, popperOptions: popper_options_1.default, onRequestClose: evt => {
|
|
181
|
-
if ((evt === null || evt === void 0 ? void 0 : evt.target) !== anchorElement) {
|
|
182
|
-
onRequestClose(evt);
|
|
183
|
-
}
|
|
184
|
-
} })));
|
|
185
|
-
});
|
|
186
|
-
Autocomplete.displayName = 'Autocomplete';
|
|
187
|
-
exports.default = Autocomplete;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.popperOptions = void 0;
|
|
4
|
-
exports.popperOptions = {
|
|
5
|
-
placement: 'bottom-start',
|
|
6
|
-
modifiers: [
|
|
7
|
-
{
|
|
8
|
-
name: 'offset',
|
|
9
|
-
options: {
|
|
10
|
-
offset: [0, 8],
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: 'flip',
|
|
15
|
-
enabled: true,
|
|
16
|
-
options: {
|
|
17
|
-
altBoundary: true,
|
|
18
|
-
padding: 8,
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'preventOverflow',
|
|
23
|
-
enabled: true,
|
|
24
|
-
options: {
|
|
25
|
-
altAxis: true,
|
|
26
|
-
altBoundary: true,
|
|
27
|
-
tether: true,
|
|
28
|
-
padding: 8,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
};
|
|
33
|
-
exports.default = exports.popperOptions;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type ButtonAccentProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
-
readonly startIcon?: JSX.Element;
|
|
4
|
-
readonly endIcon?: JSX.Element;
|
|
5
|
-
};
|
|
6
|
-
declare const _default: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
7
|
-
readonly startIcon?: JSX.Element | undefined;
|
|
8
|
-
readonly endIcon?: JSX.Element | undefined;
|
|
9
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
-
export default _default;
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
-
const ButtonBase_1 = __importDefault(require("./ButtonBase"));
|
|
20
|
-
const Button = (0, styled_1.default)(ButtonBase_1.default) `
|
|
21
|
-
color: ${({ theme }) => theme.colors.accentPrimaryContrast().toString()};
|
|
22
|
-
background-color: ${({ theme }) => theme.colors.accentPrimary().toString()};
|
|
23
|
-
box-shadow: 0 2px 12px
|
|
24
|
-
${({ theme }) => theme.colors.accentPrimary().darken(0.6).alpha(0.3).toString()};
|
|
25
|
-
&:hover {
|
|
26
|
-
background-color: ${({ theme }) => theme.colors.accentPrimary().darken(0.1).toString()};
|
|
27
|
-
}
|
|
28
|
-
&:active {
|
|
29
|
-
background-color: ${({ theme }) => theme.colors.accentPrimary().darken(0.2).toString()};
|
|
30
|
-
}
|
|
31
|
-
&:focus-visible {
|
|
32
|
-
outline: 2px solid ${({ theme }) => theme.colors.accentPrimary().darken(0.3).toString()};
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
const StartIconWrapper = styled_1.default.span `
|
|
36
|
-
margin-right: 0.8em;
|
|
37
|
-
`;
|
|
38
|
-
const EndIconWrapper = styled_1.default.span `
|
|
39
|
-
margin-left: 0.8em;
|
|
40
|
-
`;
|
|
41
|
-
const ButtonAccent = (props, ref) => {
|
|
42
|
-
const { children, startIcon, endIcon } = props, otherProps = __rest(props, ["children", "startIcon", "endIcon"]);
|
|
43
|
-
return (react_1.default.createElement(Button, Object.assign({}, otherProps, { ref: ref }),
|
|
44
|
-
typeof startIcon !== 'undefined' && startIcon !== null && (react_1.default.createElement(StartIconWrapper, null, startIcon)),
|
|
45
|
-
children,
|
|
46
|
-
typeof endIcon !== 'undefined' && endIcon !== null && (react_1.default.createElement(EndIconWrapper, null, endIcon))));
|
|
47
|
-
};
|
|
48
|
-
exports.default = react_1.default.forwardRef(ButtonAccent);
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
-
const Button = styled_1.default.button `
|
|
20
|
-
border-radius: ${({ theme }) => theme.shape.radiusFactor * 2}em;
|
|
21
|
-
padding: 0.8em 1em;
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
font-size: 1em;
|
|
24
|
-
border: 0;
|
|
25
|
-
outline: transparent;
|
|
26
|
-
transition: all 180ms ease-out 0s;
|
|
27
|
-
background: none;
|
|
28
|
-
color: currentColor;
|
|
29
|
-
`;
|
|
30
|
-
const ButtonText = styled_1.default.span `
|
|
31
|
-
font-size: 0.86em;
|
|
32
|
-
`;
|
|
33
|
-
const ButtonBase = (props, ref) => {
|
|
34
|
-
const { children } = props, otherProps = __rest(props, ["children"]);
|
|
35
|
-
return (react_1.default.createElement(Button, Object.assign({}, otherProps, { ref: ref }),
|
|
36
|
-
react_1.default.createElement(ButtonText, null, children)));
|
|
37
|
-
};
|
|
38
|
-
exports.default = react_1.default.forwardRef(ButtonBase);
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Standard
|
|
4
|
-
*/
|
|
5
|
-
export type ButtonStandardProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
-
/**
|
|
7
|
-
* Starticon
|
|
8
|
-
*/
|
|
9
|
-
readonly startIcon?: JSX.Element;
|
|
10
|
-
readonly endIcon?: JSX.Element;
|
|
11
|
-
};
|
|
12
|
-
declare const _default: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
13
|
-
/**
|
|
14
|
-
* Starticon
|
|
15
|
-
*/
|
|
16
|
-
readonly startIcon?: JSX.Element | undefined;
|
|
17
|
-
readonly endIcon?: JSX.Element | undefined;
|
|
18
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
19
|
-
export default _default;
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
-
const ButtonBase_1 = __importDefault(require("./ButtonBase"));
|
|
20
|
-
const Button = (0, styled_1.default)(ButtonBase_1.default) `
|
|
21
|
-
color: ${({ theme }) => theme.colors.textPrimary().toString()};
|
|
22
|
-
background-color: ${({ theme }) => theme.isDark
|
|
23
|
-
? theme.colors.backgroundPrimary().lighten(20).toString()
|
|
24
|
-
: theme.colors.backgroundPrimary().toString()};
|
|
25
|
-
box-shadow: 0 2px 12px
|
|
26
|
-
${({ theme }) => theme.colors.backgroundPrimary().darken(40).alpha(0.6).toString()};
|
|
27
|
-
&:hover {
|
|
28
|
-
background-color: ${({ theme }) => theme.colors.backgroundPrimary().darken(20).toString()};
|
|
29
|
-
}
|
|
30
|
-
&:active {
|
|
31
|
-
background-color: ${({ theme }) => theme.colors.backgroundPrimary().darken(40).toString()};
|
|
32
|
-
}
|
|
33
|
-
&:focus-visible {
|
|
34
|
-
outline: 2px solid ${({ theme }) => theme.colors.accentPrimary().toString()};
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
const StartIconWrapper = styled_1.default.span `
|
|
38
|
-
margin-right: 0.8em;
|
|
39
|
-
`;
|
|
40
|
-
const EndIconWrapper = styled_1.default.span `
|
|
41
|
-
margin-left: 0.8em;
|
|
42
|
-
`;
|
|
43
|
-
const ButtonStandard = (props, ref) => {
|
|
44
|
-
const { children, startIcon, endIcon } = props, otherProps = __rest(props, ["children", "startIcon", "endIcon"]);
|
|
45
|
-
return (react_1.default.createElement(Button, Object.assign({}, otherProps, { ref: ref }),
|
|
46
|
-
typeof startIcon !== 'undefined' && startIcon !== null && (react_1.default.createElement(StartIconWrapper, null, startIcon)),
|
|
47
|
-
children,
|
|
48
|
-
typeof endIcon !== 'undefined' && endIcon !== null && (react_1.default.createElement(EndIconWrapper, null, endIcon))));
|
|
49
|
-
};
|
|
50
|
-
exports.default = react_1.default.forwardRef(ButtonStandard);
|
package/dist/Button/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ButtonStandardProps } from './ButtonStandard';
|
|
3
|
-
import { ButtonAccentProps } from './ButtonAccent';
|
|
4
|
-
interface BaseProps {
|
|
5
|
-
readonly variant?: 'standard' | 'accent';
|
|
6
|
-
}
|
|
7
|
-
export type ButtonProps = (ButtonStandardProps | ButtonAccentProps) & BaseProps;
|
|
8
|
-
declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
-
export default _default;
|
package/dist/Button/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const ButtonStandard_1 = __importDefault(require("./ButtonStandard"));
|
|
19
|
-
const ButtonAccent_1 = __importDefault(require("./ButtonAccent"));
|
|
20
|
-
const Button = (props, ref) => {
|
|
21
|
-
const { variant } = props, buttonProps = __rest(props, ["variant"]);
|
|
22
|
-
if (variant === 'accent') {
|
|
23
|
-
return react_1.default.createElement(ButtonAccent_1.default, Object.assign({}, buttonProps, { ref: ref }));
|
|
24
|
-
}
|
|
25
|
-
return react_1.default.createElement(ButtonStandard_1.default, Object.assign({}, buttonProps, { ref: ref }));
|
|
26
|
-
};
|
|
27
|
-
exports.default = react_1.default.forwardRef(Button);
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
-
const Container = styled_1.default.div `
|
|
20
|
-
display: flex;
|
|
21
|
-
justify-content: space-between;
|
|
22
|
-
align-items: center;
|
|
23
|
-
`;
|
|
24
|
-
const CalendarBottomBar = (props, ref) => {
|
|
25
|
-
const { children } = props, restProps = __rest(props, ["children"]);
|
|
26
|
-
return (react_1.default.createElement(Container, Object.assign({}, restProps, { ref: ref }), children));
|
|
27
|
-
};
|
|
28
|
-
exports.default = react_1.default.forwardRef(CalendarBottomBar);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface CalendarCellProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
-
readonly isToday?: boolean;
|
|
4
|
-
readonly isSelected?: boolean;
|
|
5
|
-
readonly isDisabled?: boolean;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<CalendarCellProps & React.RefAttributes<HTMLButtonElement>>>;
|
|
8
|
-
export default _default;
|
|
@@ -1,61 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
18
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
-
const Btn = styled_1.default.button `
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
font-size: 0.8em;
|
|
24
|
-
width: 3em;
|
|
25
|
-
height: 3em;
|
|
26
|
-
margin: 0;
|
|
27
|
-
min-width: 0;
|
|
28
|
-
outline: none;
|
|
29
|
-
cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')};
|
|
30
|
-
border: 1px solid transparent;
|
|
31
|
-
background-color: ${({ theme, $isSelected }) => $isSelected
|
|
32
|
-
? theme.colors.accentPrimary().toString()
|
|
33
|
-
: theme.colors.backgroundPrimary().toString()};
|
|
34
|
-
border-radius: ${({ theme }) => theme.shape.radiusFactor * 3}em;
|
|
35
|
-
color: ${({ $isToday, theme, $isSelected, $isDisabled }) => {
|
|
36
|
-
if ($isDisabled) {
|
|
37
|
-
return theme.colors.textSecondary().toString();
|
|
38
|
-
}
|
|
39
|
-
if ($isSelected) {
|
|
40
|
-
return theme.colors.accentPrimaryContrast().toString();
|
|
41
|
-
}
|
|
42
|
-
if ($isToday) {
|
|
43
|
-
return theme.colors.accentPrimary().toString();
|
|
44
|
-
}
|
|
45
|
-
return theme.colors.textPrimary().toString();
|
|
46
|
-
}};
|
|
47
|
-
&:hover {
|
|
48
|
-
background-color: ${({ theme, $isSelected }) => $isSelected
|
|
49
|
-
? theme.colors.accentPrimary().darken(0.1).toString()
|
|
50
|
-
: theme.colors.backgroundPrimary().darken(0.1).toString()};
|
|
51
|
-
}
|
|
52
|
-
&:focus-visible {
|
|
53
|
-
border-color: ${({ theme, $isDisabled }) => $isDisabled ? 'transparent' : theme.colors.accentPrimary().toString()};
|
|
54
|
-
}
|
|
55
|
-
opacity: ${({ $isDisabled }) => ($isDisabled ? 0.4 : 1)};
|
|
56
|
-
`;
|
|
57
|
-
const CalendarCell = (props, ref) => {
|
|
58
|
-
const { isToday, children, isSelected, isDisabled } = props, restProps = __rest(props, ["isToday", "children", "isSelected", "isDisabled"]);
|
|
59
|
-
return (react_1.default.createElement(Btn, Object.assign({ type: "button" }, restProps, { ref: ref, tabIndex: isDisabled ? -1 : restProps.tabIndex, "$isToday": Boolean(isToday), "$isSelected": Boolean(isSelected), "$isDisabled": Boolean(isDisabled) }), children));
|
|
60
|
-
};
|
|
61
|
-
exports.default = react_1.default.memo(react_1.default.forwardRef(CalendarCell));
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const _default: React.NamedExoticComponent<{
|
|
3
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
-
as?: React.ElementType<any> | undefined;
|
|
5
|
-
} & React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement>>;
|
|
6
|
-
export default _default;
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const CalendarDateContainer = styled_1.default.div `
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
justify-content: stretch;
|
|
12
|
-
`;
|
|
13
|
-
exports.default = react_1.default.memo(CalendarDateContainer);
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type CalendarEmptyCellProps = React.HTMLAttributes<HTMLButtonElement>;
|
|
3
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<CalendarEmptyCellProps & React.RefAttributes<HTMLButtonElement>>>;
|
|
4
|
-
export default _default;
|