@wavv/ui 2.2.2-alpha.4 → 2.2.2-alpha.6
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/build/assets/icons/CaretDown.js +18 -0
- package/build/assets/icons/CaretUp.js +18 -0
- package/build/assets/icons/Checkbox.js +15 -0
- package/build/assets/icons/CheckboxOff.js +15 -0
- package/build/assets/icons/CheckboxPartial.js +15 -0
- package/build/assets/icons/Dialpad.js +18 -0
- package/build/assets/icons/Exclamation.js +25 -0
- package/build/assets/icons/Phone.js +13 -0
- package/build/assets/icons/PhoneAdd.js +21 -0
- package/build/assets/icons/PhoneBlocked.js +22 -0
- package/build/assets/icons/PhoneCallback.js +21 -0
- package/build/assets/icons/PhoneEnd.js +28 -0
- package/build/assets/icons/PhoneForward.js +22 -0
- package/build/assets/icons/PhoneHistory.js +21 -0
- package/build/assets/icons/PhoneHold.js +22 -0
- package/build/assets/icons/PhoneIncoming.js +22 -0
- package/build/assets/icons/PhoneMissed.js +22 -0
- package/build/assets/icons/PhoneTalk.js +22 -0
- package/build/assets/icons/PhoneTransfer.js +21 -0
- package/build/assets/icons/RadioButton.js +22 -0
- package/build/assets/icons/RadioButtonOff.js +15 -0
- package/build/assets/icons/Record.js +18 -0
- package/build/assets/icons/Screenshot.js +39 -0
- package/build/assets/icons/ShieldWavv.js +30 -0
- package/build/assets/icons/Spotify.js +15 -0
- package/build/assets/icons/SubArrow.js +16 -0
- package/build/assets/icons/ToggleOff.js +15 -0
- package/build/assets/icons/ToggleOn.js +15 -0
- package/build/assets/icons/TransferCancel.js +60 -0
- package/build/components/Accordion/Accordion.js +26 -0
- package/build/components/Accordion/Header.js +86 -0
- package/build/components/Accordion/Item.js +25 -0
- package/build/components/Accordion/Panel.js +64 -0
- package/build/components/Accordion/index.js +2 -0
- package/build/components/Audio.js +248 -0
- package/build/components/BarChart.js +123 -0
- package/build/components/Button/Button.js +258 -0
- package/build/components/Button/ButtonLoader.js +20 -0
- package/build/components/Button/ButtonTypes.js +0 -0
- package/build/components/Button/Group.js +58 -0
- package/build/components/Button/index.js +2 -0
- package/build/components/Calendar.js +49 -0
- package/build/components/CalendarParts/CalendarContainerStyles.js +15 -0
- package/build/components/CalendarParts/CalendarContent.js +138 -0
- package/build/components/CalendarParts/CalendarHeader.js +146 -0
- package/build/components/CalendarParts/useMinMax.js +23 -0
- package/build/components/CalendarParts/utils.js +6 -0
- package/build/components/ChartHelpers.js +121 -0
- package/build/components/Checkbox.js +85 -0
- package/build/components/Code/Code.js +117 -0
- package/build/components/Code/Copy.js +50 -0
- package/build/components/Code/Endpoint.js +82 -0
- package/build/components/Code/index.js +3 -0
- package/build/components/ComboBox.js +190 -0
- package/build/components/CommandMenu/CommandItem.js +32 -0
- package/build/components/CommandMenu/CommandMenu.js +136 -0
- package/build/components/CommandMenu/CommandOptions.js +24 -0
- package/build/components/CommandMenu/CommandSection.js +19 -0
- package/build/components/CommandMenu/index.js +2 -0
- package/build/components/DateRangeSelect.js +359 -0
- package/build/components/DocTable.js +32 -0
- package/build/components/Dot.js +60 -0
- package/build/components/DraftEditor.js +188 -0
- package/build/components/Dropdown.js +130 -0
- package/build/components/DropdownMenu.js +131 -0
- package/build/components/DropdownMenuParts/Menu.js +6 -0
- package/build/components/DropdownMenuParts/MenuItem.js +54 -0
- package/build/components/DropdownMenuParts/MenuOptions.js +47 -0
- package/build/components/DropdownMenuParts/MenuSection.js +14 -0
- package/build/components/DropdownSelect.js +171 -0
- package/build/components/DynamicIcon.js +49 -0
- package/build/components/Editor/Editor.js +356 -0
- package/build/components/Editor/EditorStyles.js +259 -0
- package/build/components/Editor/MergeFieldExtension.js +110 -0
- package/build/components/Editor/RichTextToolbar.js +515 -0
- package/build/components/Editor/editorUtils.js +213 -0
- package/build/components/Editor/index.js +3 -0
- package/build/components/Ellipsis.js +22 -0
- package/build/components/Focusable.js +20 -0
- package/build/components/Form.js +68 -0
- package/build/components/FormControl.js +72 -0
- package/build/components/Grid.js +53 -0
- package/build/components/Icon/Icon.js +89 -0
- package/build/components/Icon/customIcons.js +48 -0
- package/build/components/Icon/icons.js +145 -0
- package/build/components/Icon/index.js +3 -0
- package/build/components/ImageViewer.js +142 -0
- package/build/components/InlineCode.js +10 -0
- package/build/components/InputHelpers.js +106 -0
- package/build/components/Inputs/DatePicker.js +111 -0
- package/build/components/Inputs/DateRangePicker.js +166 -0
- package/build/components/Inputs/InlineInput.js +71 -0
- package/build/components/Inputs/NumberInput.js +117 -0
- package/build/components/Inputs/PhoneInput.js +96 -0
- package/build/components/Inputs/SearchInput.js +84 -0
- package/build/components/Inputs/TextArea.js +164 -0
- package/build/components/Inputs/TextInput.js +74 -0
- package/build/components/Inputs/TimeInput.js +74 -0
- package/build/components/Inputs/helpers/AriaButton.js +19 -0
- package/build/components/Inputs/helpers/DateSegment.js +22 -0
- package/build/components/Inputs/helpers/Description.js +11 -0
- package/build/components/Inputs/helpers/ErrorMessage.js +11 -0
- package/build/components/Inputs/helpers/Input.js +6 -0
- package/build/components/Inputs/helpers/InputContainerStyles.js +78 -0
- package/build/components/Inputs/helpers/InputMessage.js +30 -0
- package/build/components/Inputs/helpers/InputStyles.js +43 -0
- package/build/components/Inputs/helpers/Label.js +42 -0
- package/build/components/Inputs/helpers/LabelWrapper.js +14 -0
- package/build/components/Inputs/helpers/PickerToggle.js +7 -0
- package/build/components/Inputs/helpers/TextArea.js +8 -0
- package/build/components/Inputs/helpers/filterPastedText.js +9 -0
- package/build/components/Inputs/helpers/handlePaste.js +12 -0
- package/build/components/Inputs/helpers/isAcceptable.js +7 -0
- package/build/components/Inputs/helpers/useDynamicWidth.js +39 -0
- package/build/components/Inputs/helpers/useInputFocus.js +19 -0
- package/build/components/Label.js +42 -0
- package/build/components/LineChart.js +80 -0
- package/build/components/ListBoxParts/GridListItem.js +34 -0
- package/build/components/ListBoxParts/ListBoxItem.js +32 -0
- package/build/components/ListBoxParts/ListOptions.js +45 -0
- package/build/components/ListHelpers/GridListHeader.js +14 -0
- package/build/components/ListHelpers/GridListSection.js +14 -0
- package/build/components/ListHelpers/ItemHeaderBody.js +36 -0
- package/build/components/ListHelpers/ListHeader.js +14 -0
- package/build/components/ListHelpers/ListItemStyles.js +52 -0
- package/build/components/ListHelpers/ListRootStyles.js +14 -0
- package/build/components/ListHelpers/ListSection.js +14 -0
- package/build/components/ListHelpers/ListStyles.js +29 -0
- package/build/components/Menu.js +159 -0
- package/build/components/Message.js +107 -0
- package/build/components/MessageHr.js +32 -0
- package/build/components/Modal.js +212 -0
- package/build/components/MotionPopover.js +39 -0
- package/build/components/MultiSelect/MultiSelect.js +263 -0
- package/build/components/MultiSelect/SearchDropdown.js +155 -0
- package/build/components/MultiSelect/index.js +2 -0
- package/build/components/OptionHelpers/Container.js +34 -0
- package/build/components/OptionHelpers/Item.js +59 -0
- package/build/components/OptionHelpers/types.js +0 -0
- package/build/components/Pagination.js +121 -0
- package/build/components/PieChart.js +40 -0
- package/build/components/Popover.js +40 -0
- package/build/components/PortalScope.js +8 -0
- package/build/components/Progress/CirclePercent.js +56 -0
- package/build/components/Progress/Progress.js +59 -0
- package/build/components/Progress/index.js +3 -0
- package/build/components/Radio.js +45 -0
- package/build/components/RangeCalendar.js +60 -0
- package/build/components/Select.js +162 -0
- package/build/components/Slider.js +50 -0
- package/build/components/Spinner.js +70 -0
- package/build/components/Table/Body.js +49 -0
- package/build/components/Table/Cell.js +63 -0
- package/build/components/Table/Check.js +35 -0
- package/build/components/Table/Column.js +129 -0
- package/build/components/Table/ColumnSort.js +26 -0
- package/build/components/Table/Header.js +64 -0
- package/build/components/Table/Resizer.js +25 -0
- package/build/components/Table/Row.js +84 -0
- package/build/components/Table/SortCaret.js +24 -0
- package/build/components/Table/Table.js +88 -0
- package/build/components/Table/contentStyles.js +20 -0
- package/build/components/Table/context.js +4 -0
- package/build/components/Table/index.js +2 -0
- package/build/components/Table/types.js +0 -0
- package/build/components/Tabs.js +151 -0
- package/build/components/Tag.js +71 -0
- package/build/components/Toggle.js +59 -0
- package/build/components/ToggleButton/ToggleButton.js +104 -0
- package/build/components/ToggleButton/ToggleButtonGroup.js +36 -0
- package/build/components/ToggleButton/context.js +8 -0
- package/build/components/ToggleButton/index.js +3 -0
- package/build/components/Tooltip.js +136 -0
- package/build/components/TransferList.js +234 -0
- package/build/components/Tree/Tree.js +69 -0
- package/build/components/Tree/TreeContext.js +3 -0
- package/build/components/Tree/TreeItem.js +93 -0
- package/build/components/Tree/index.js +2 -0
- package/build/components/UnstyledButton.js +8 -0
- package/build/components/Waveform.js +243 -0
- package/build/components/draftUtils.js +193 -0
- package/build/components/helpers/getIcon.js +28 -0
- package/build/components/helpers/getPopPosition.js +20 -0
- package/build/components/helpers/isPropAllowed.js +3 -0
- package/build/components/helpers/mergePadding.js +47 -0
- package/build/components/helpers/styledProps.js +34 -0
- package/build/components/typeDefs/elementTypes.js +0 -0
- package/build/components/typeDefs/inputTypes.js +0 -0
- package/build/components/typeDefs/selectionTypes.js +0 -0
- package/build/components/typeDefs/tagTypes.js +0 -0
- package/build/components/types.js +0 -0
- package/build/global-styles/GlobalStorybookStyles.js +108 -0
- package/build/global-styles/ResetStyles.js +33 -0
- package/build/global-styles/ScrollbarStyles.js +26 -0
- package/build/global-styles/ToastStyles.js +66 -0
- package/build/global-styles/index.js +4 -0
- package/build/hooks/index.js +9 -0
- package/build/hooks/useConfirm.js +91 -0
- package/build/hooks/useControlledOpenState.js +22 -0
- package/build/hooks/useCopy.js +28 -0
- package/build/hooks/useElementObserver.js +6 -0
- package/build/hooks/useEventListener.js +19 -0
- package/build/hooks/useOnClickOutside.js +21 -0
- package/build/hooks/usePrevious.js +12 -0
- package/build/hooks/useSelectAll.js +60 -0
- package/build/hooks/useWindowSize.js +25 -0
- package/build/index.js +79 -12348
- package/build/theme/ThemeTypes.js +0 -0
- package/build/theme/common/button.js +33 -0
- package/build/theme/common/common.js +38 -0
- package/build/theme/common/index.js +4 -0
- package/build/theme/core/colors.js +77 -0
- package/build/theme/core/dark/dark.js +457 -0
- package/build/theme/core/dark/darkScale.js +36 -0
- package/build/theme/core/light/light.js +456 -0
- package/build/theme/core/light/lightScale.js +35 -0
- package/build/theme/eighties/colors.js +78 -0
- package/build/theme/eighties/dark/dark.js +457 -0
- package/build/theme/eighties/dark/darkScale.js +36 -0
- package/build/theme/eighties/light/light.js +456 -0
- package/build/theme/eighties/light/lightScale.js +35 -0
- package/build/theme/index.js +28 -0
- package/build/utils/chunk.js +13 -0
- package/build/utils/copyToClipboard.js +29 -0
- package/build/utils/flattenListOptions.js +4 -0
- package/build/utils/formatDate.js +55 -0
- package/build/utils/index.js +6 -0
- package/build/utils/numberWithCommas.js +3 -0
- package/build/utils/range.js +11 -0
- package/package.json +6 -2
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
const icons = {
|
|
2
|
+
'activity-history': 'id-card',
|
|
3
|
+
add: 'plus',
|
|
4
|
+
'add-circle': 'circle-plus',
|
|
5
|
+
'add-person': 'user-round-plus',
|
|
6
|
+
'arrow-down': 'arrow-down',
|
|
7
|
+
'arrow-left': 'arrow-left',
|
|
8
|
+
'arrow-right': 'arrow-right',
|
|
9
|
+
'arrow-up': 'arrow-up',
|
|
10
|
+
attachment: 'paperclip',
|
|
11
|
+
auto: 'refresh-ccw-dot',
|
|
12
|
+
bell: 'bell',
|
|
13
|
+
'bell-dot': 'bell-dot',
|
|
14
|
+
blockquote: 'text-quote',
|
|
15
|
+
bold: 'bold',
|
|
16
|
+
bot: 'bot',
|
|
17
|
+
bug: 'bug',
|
|
18
|
+
bulb: 'lightbulb',
|
|
19
|
+
calendar: 'calendar-days',
|
|
20
|
+
camera: 'camera',
|
|
21
|
+
card: 'credit-card',
|
|
22
|
+
check: 'check',
|
|
23
|
+
'check-badge': 'badge-check',
|
|
24
|
+
'check-circle': 'circle-check',
|
|
25
|
+
'chevron-down': 'chevron-down',
|
|
26
|
+
'chevron-left': 'chevron-left',
|
|
27
|
+
'chevron-right': 'chevron-right',
|
|
28
|
+
'chevron-up': 'chevron-up',
|
|
29
|
+
circle: 'circle',
|
|
30
|
+
clapperboard: 'clapperboard',
|
|
31
|
+
close: 'x',
|
|
32
|
+
'close-circle': 'circle-x',
|
|
33
|
+
copy: 'copy',
|
|
34
|
+
'copy-check': 'copy-check',
|
|
35
|
+
'copy-plus': 'copy-plus',
|
|
36
|
+
cycle: 'refresh-cw',
|
|
37
|
+
dash: 'minus',
|
|
38
|
+
devices: 'monitor-smartphone',
|
|
39
|
+
'double-arrow-left': 'chevrons-left',
|
|
40
|
+
'double-arrow-right': 'chevrons-right',
|
|
41
|
+
download: 'download',
|
|
42
|
+
drag: 'grip-vertical',
|
|
43
|
+
edit: 'pencil',
|
|
44
|
+
'emoji-happy': 'smile',
|
|
45
|
+
'emoji-neutral': 'meh',
|
|
46
|
+
'emoji-sad': 'frown',
|
|
47
|
+
'eye-off': 'eye-off',
|
|
48
|
+
'eye-on': 'eye',
|
|
49
|
+
facebook: 'facebook',
|
|
50
|
+
filter: 'list-filter',
|
|
51
|
+
flag: 'flag',
|
|
52
|
+
flask: 'flask-conical',
|
|
53
|
+
funnel: 'funnel',
|
|
54
|
+
globe: 'globe',
|
|
55
|
+
group: 'users',
|
|
56
|
+
hash: 'hash',
|
|
57
|
+
heading: 'heading',
|
|
58
|
+
'heading-1': 'heading-1',
|
|
59
|
+
'heading-2': 'heading-2',
|
|
60
|
+
'heading-3': 'heading-3',
|
|
61
|
+
'heading-4': 'heading-4',
|
|
62
|
+
'heading-5': 'heading-5',
|
|
63
|
+
'heading-6': 'heading-6',
|
|
64
|
+
headset: 'headset',
|
|
65
|
+
hearing: 'ear',
|
|
66
|
+
heart: 'heart',
|
|
67
|
+
help: 'circle-question-mark',
|
|
68
|
+
highlight: 'highlighter',
|
|
69
|
+
home: 'house',
|
|
70
|
+
hourglass: 'hourglass',
|
|
71
|
+
info: 'info',
|
|
72
|
+
instagram: 'instagram',
|
|
73
|
+
italic: 'italic',
|
|
74
|
+
join: 'log-in',
|
|
75
|
+
'kebab-menu': 'ellipsis-vertical',
|
|
76
|
+
kanban: 'kanban',
|
|
77
|
+
'layout-dashboard': 'layout-dashboard',
|
|
78
|
+
link: 'link',
|
|
79
|
+
linkedin: 'linkedin',
|
|
80
|
+
'list-bullet': 'list',
|
|
81
|
+
'list-checks': 'list-checks',
|
|
82
|
+
'list-ordered': 'list-ordered',
|
|
83
|
+
'list-task': 'list-todo',
|
|
84
|
+
loading: 'loader',
|
|
85
|
+
'local-area': 'map-pinned',
|
|
86
|
+
location: 'map-pin',
|
|
87
|
+
logout: 'log-out',
|
|
88
|
+
maximize: 'maximize-2',
|
|
89
|
+
menu: 'menu',
|
|
90
|
+
merge: 'merge',
|
|
91
|
+
'merge-field': 'braces',
|
|
92
|
+
message: 'message-square-more',
|
|
93
|
+
mic: 'mic',
|
|
94
|
+
'mic-off': 'mic-off',
|
|
95
|
+
minimize: 'minimize-2',
|
|
96
|
+
mobile: 'smartphone',
|
|
97
|
+
'not-allowed': 'ban',
|
|
98
|
+
notes: 'notebook-pen',
|
|
99
|
+
open: 'external-link',
|
|
100
|
+
paragraph: 'pilcrow',
|
|
101
|
+
pause: 'pause',
|
|
102
|
+
'pause-circle': 'circle-pause',
|
|
103
|
+
person: 'user-round',
|
|
104
|
+
play: 'play',
|
|
105
|
+
'play-circle': 'circle-play',
|
|
106
|
+
priority: 'arrow-up-wide-narrow',
|
|
107
|
+
'profile-user': 'circle-user-round',
|
|
108
|
+
redo: 'redo',
|
|
109
|
+
refresh: 'rotate-cw',
|
|
110
|
+
rocket: 'rocket',
|
|
111
|
+
schedule: 'clock',
|
|
112
|
+
search: 'search',
|
|
113
|
+
settings: 'settings',
|
|
114
|
+
share: 'share-2',
|
|
115
|
+
'share-arrow': 'share',
|
|
116
|
+
shield: 'shield',
|
|
117
|
+
'shield-check': 'shield-check',
|
|
118
|
+
'shield-health': 'shield-plus',
|
|
119
|
+
'shield-slash': 'shield-off',
|
|
120
|
+
sort: 'arrow-down-wide-narrow',
|
|
121
|
+
'sort-arrows': 'chevrons-up-down',
|
|
122
|
+
'square-stack': 'square-stack',
|
|
123
|
+
stack: 'layers-2',
|
|
124
|
+
star: 'star',
|
|
125
|
+
stars: 'sparkles',
|
|
126
|
+
stats: 'chart-column',
|
|
127
|
+
stop: 'square',
|
|
128
|
+
'stop-circle': 'circle-stop',
|
|
129
|
+
strikethrough: 'strikethrough',
|
|
130
|
+
template: 'file-text',
|
|
131
|
+
transfer: 'arrow-right-left',
|
|
132
|
+
trash: 'trash-2',
|
|
133
|
+
trophy: 'trophy',
|
|
134
|
+
underline: 'underline',
|
|
135
|
+
undo: 'undo',
|
|
136
|
+
upload: 'upload',
|
|
137
|
+
video: 'video',
|
|
138
|
+
voicemail: 'voicemail',
|
|
139
|
+
'vol-on': 'volume-2',
|
|
140
|
+
warning: 'triangle-alert',
|
|
141
|
+
'warning-circle': 'circle-alert',
|
|
142
|
+
youtube: 'youtube'
|
|
143
|
+
};
|
|
144
|
+
const Icon_icons = icons;
|
|
145
|
+
export { Icon_icons as default };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useOnClickOutside } from "../hooks/index.js";
|
|
5
|
+
import Icon from "./Icon/index.js";
|
|
6
|
+
const ImageViewer_ImageViewer = ({ visible, close, images, startIndex, alt, maxWidth, maxHeight, opacity, ...rest })=>{
|
|
7
|
+
const [currentIndex, setCurrentIndex] = useState(startIndex);
|
|
8
|
+
const exclusions = [
|
|
9
|
+
'#viewer-prev',
|
|
10
|
+
'#viewer-next',
|
|
11
|
+
'#viewer-prev *',
|
|
12
|
+
'#viewer-next *'
|
|
13
|
+
];
|
|
14
|
+
const imageRef = useOnClickOutside(close, visible, exclusions);
|
|
15
|
+
useEffect(()=>{
|
|
16
|
+
setCurrentIndex(startIndex);
|
|
17
|
+
}, [
|
|
18
|
+
startIndex
|
|
19
|
+
]);
|
|
20
|
+
const handlePrev = ()=>currentIndex > 0 ? setCurrentIndex(currentIndex - 1) : setCurrentIndex(images.length - 1);
|
|
21
|
+
const handleNext = ()=>currentIndex < images.length - 1 ? setCurrentIndex(currentIndex + 1) : setCurrentIndex(0);
|
|
22
|
+
const handleKeyPress = (event)=>{
|
|
23
|
+
const { key } = event;
|
|
24
|
+
switch(key){
|
|
25
|
+
case 'ArrowLeft':
|
|
26
|
+
case 'ArrowDown':
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
handlePrev();
|
|
29
|
+
break;
|
|
30
|
+
case 'ArrowRight':
|
|
31
|
+
case 'ArrowUp':
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
handleNext();
|
|
34
|
+
break;
|
|
35
|
+
case 'Escape':
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
close();
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
useEffect(()=>{
|
|
44
|
+
const ssr = 'undefined' == typeof window;
|
|
45
|
+
const cleanup = ssr ? ()=>null : ()=>window.removeEventListener('keydown', handleKeyPress);
|
|
46
|
+
if (visible && !ssr) window.addEventListener('keydown', handleKeyPress);
|
|
47
|
+
return cleanup;
|
|
48
|
+
}, [
|
|
49
|
+
visible,
|
|
50
|
+
currentIndex
|
|
51
|
+
]);
|
|
52
|
+
return visible ? /*#__PURE__*/ jsxs(Viewer, {
|
|
53
|
+
opacity: opacity,
|
|
54
|
+
prevNext: images.length > 1,
|
|
55
|
+
...rest,
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ jsx(Close, {
|
|
58
|
+
onClick: close,
|
|
59
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
60
|
+
name: "close",
|
|
61
|
+
color: "white"
|
|
62
|
+
})
|
|
63
|
+
}),
|
|
64
|
+
images.length > 1 && /*#__PURE__*/ jsx(PrevNext, {
|
|
65
|
+
id: "viewer-prev",
|
|
66
|
+
onClick: handlePrev,
|
|
67
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
68
|
+
name: "chevron-left",
|
|
69
|
+
size: 35,
|
|
70
|
+
color: "white"
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ jsx(Media, {
|
|
74
|
+
ref: imageRef,
|
|
75
|
+
src: images[currentIndex],
|
|
76
|
+
alt: alt,
|
|
77
|
+
maxWidth: maxWidth,
|
|
78
|
+
maxHeight: maxHeight
|
|
79
|
+
}),
|
|
80
|
+
images.length > 1 && /*#__PURE__*/ jsx(PrevNext, {
|
|
81
|
+
next: true,
|
|
82
|
+
id: "viewer-next",
|
|
83
|
+
onClick: handleNext,
|
|
84
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
85
|
+
name: "chevron-right",
|
|
86
|
+
size: 35,
|
|
87
|
+
color: "white"
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
}) : null;
|
|
92
|
+
};
|
|
93
|
+
const Viewer = styled.div(({ prevNext, opacity })=>({
|
|
94
|
+
width: '100%',
|
|
95
|
+
height: '100%',
|
|
96
|
+
backgroundColor: `rgba(0, 0, 0, ${opacity ?? 0.3})`,
|
|
97
|
+
position: 'fixed',
|
|
98
|
+
top: 0,
|
|
99
|
+
left: 0,
|
|
100
|
+
display: 'grid',
|
|
101
|
+
gridTemplateColumns: prevNext ? 'auto 1fr auto' : '1fr',
|
|
102
|
+
justifyContent: 'space-between',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
zIndex: 10000,
|
|
105
|
+
userSelect: 'none',
|
|
106
|
+
borderRadius: 5
|
|
107
|
+
}));
|
|
108
|
+
const Close = styled.div({
|
|
109
|
+
position: 'absolute',
|
|
110
|
+
top: 0,
|
|
111
|
+
right: 0,
|
|
112
|
+
display: 'flex',
|
|
113
|
+
justifyContent: 'center',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
cursor: 'pointer',
|
|
116
|
+
width: 50,
|
|
117
|
+
height: 50,
|
|
118
|
+
zIndex: 1
|
|
119
|
+
});
|
|
120
|
+
const PrevNext = styled.div(({ next })=>({
|
|
121
|
+
display: 'flex',
|
|
122
|
+
justifyContent: 'center',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
cursor: 'pointer',
|
|
125
|
+
width: 50,
|
|
126
|
+
height: '100%',
|
|
127
|
+
backgroundColor: 'transparent',
|
|
128
|
+
left: next ? void 0 : 0,
|
|
129
|
+
right: next ? 0 : void 0,
|
|
130
|
+
zIndex: 0,
|
|
131
|
+
'&:hover': {
|
|
132
|
+
background: `linear-gradient(90deg, rgba(0,0,0,${next ? 0 : 0.4}) 0%, rgba(0,0,0,${next ? 0.4 : 0}) 100%)`
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
const Media = styled.img(({ maxWidth, maxHeight })=>({
|
|
136
|
+
display: 'block',
|
|
137
|
+
justifySelf: 'center',
|
|
138
|
+
maxWidth: maxWidth || '100%',
|
|
139
|
+
maxHeight: maxHeight || '100%'
|
|
140
|
+
}));
|
|
141
|
+
const ImageViewer = ImageViewer_ImageViewer;
|
|
142
|
+
export { ImageViewer as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
const InlineCode_InlineCode = styled.code(({ theme })=>({
|
|
3
|
+
fontFamily: "source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace",
|
|
4
|
+
color: theme.scale10,
|
|
5
|
+
backgroundColor: theme.scale1,
|
|
6
|
+
borderRadius: theme.size.xs,
|
|
7
|
+
padding: '2px 4px'
|
|
8
|
+
}));
|
|
9
|
+
const InlineCode = InlineCode_InlineCode;
|
|
10
|
+
export { InlineCode as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import styled from "@emotion/styled";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { marginProps, paddingProps, widthHeightProps } from "./helpers/styledProps.js";
|
|
4
|
+
const useInputFocus = (onFocus, onBlur, focusCondition = true)=>{
|
|
5
|
+
const [focused, setFocused] = useState(false);
|
|
6
|
+
const handleFocus = (event)=>{
|
|
7
|
+
if (focusCondition) setFocused(true);
|
|
8
|
+
if (onFocus) onFocus(event);
|
|
9
|
+
};
|
|
10
|
+
const handleBlur = (event)=>{
|
|
11
|
+
setFocused(false);
|
|
12
|
+
if (onBlur) onBlur(event);
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
focused,
|
|
16
|
+
handleFocus,
|
|
17
|
+
handleBlur
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const isInputFilled = (value)=>{
|
|
21
|
+
const filled = !!value || null != value && '' !== value;
|
|
22
|
+
return filled;
|
|
23
|
+
};
|
|
24
|
+
const InputContainer = styled.div(({ theme: { input, accent }, backgroundColor, borderRadius, borderColor, textOnly, focused, invalid, disabled, hasLabel, pointer })=>({
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'space-between',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
position: 'relative',
|
|
29
|
+
minHeight: hasLabel ? 48 : 40,
|
|
30
|
+
height: hasLabel ? 48 : 40,
|
|
31
|
+
padding: '5px 16px',
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
color: disabled ? input.labelColor.disabled : input.labelColor.default,
|
|
34
|
+
backgroundColor: input.background.default,
|
|
35
|
+
border: 'none',
|
|
36
|
+
borderColor,
|
|
37
|
+
borderRadius: borderRadius ?? 4,
|
|
38
|
+
cursor: pointer ? 'pointer' : void 0,
|
|
39
|
+
outline: 'none',
|
|
40
|
+
outlineOffset: -1,
|
|
41
|
+
'&:focus-visible': {
|
|
42
|
+
outline: `${accent} solid 1px`
|
|
43
|
+
},
|
|
44
|
+
'&:hover': {
|
|
45
|
+
backgroundColor: disabled || textOnly || backgroundColor ? void 0 : input.background.hover,
|
|
46
|
+
borderColor: focused || disabled || invalid ? void 0 : input.borderColor.hover,
|
|
47
|
+
Label: {
|
|
48
|
+
color: focused || disabled ? void 0 : input.labelColor.hover
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}), ({ theme: { input }, focused })=>({
|
|
52
|
+
backgroundColor: focused ? input.background.focused : void 0,
|
|
53
|
+
borderColor: focused ? input.borderColor.focused : void 0
|
|
54
|
+
}), ({ theme: { input }, invalid })=>({
|
|
55
|
+
borderColor: invalid ? input.borderColor.error : void 0
|
|
56
|
+
}), ({ theme: { input }, disabled, readOnly })=>({
|
|
57
|
+
backgroundColor: disabled ? input.background.disabled : void 0,
|
|
58
|
+
borderColor: disabled ? input.borderColor.disabled : void 0,
|
|
59
|
+
pointerEvents: disabled || readOnly ? 'none' : void 0
|
|
60
|
+
}), ({ theme, textOnly, disabled })=>({
|
|
61
|
+
padding: textOnly ? 0 : void 0,
|
|
62
|
+
backgroundColor: textOnly ? 'transparent' : void 0,
|
|
63
|
+
width: textOnly ? 'max-content' : void 0,
|
|
64
|
+
height: textOnly ? 'max-content' : void 0,
|
|
65
|
+
minHeight: textOnly ? 'max-content' : void 0,
|
|
66
|
+
color: textOnly && disabled ? theme.scale4 : void 0
|
|
67
|
+
}), ({ backgroundColor })=>({
|
|
68
|
+
backgroundColor
|
|
69
|
+
}), widthHeightProps, marginProps, paddingProps);
|
|
70
|
+
const InputWrapper = styled.div(({ readOnly })=>({
|
|
71
|
+
display: 'flex',
|
|
72
|
+
flexDirection: 'column',
|
|
73
|
+
boxSizing: 'border-box',
|
|
74
|
+
width: '100%',
|
|
75
|
+
position: 'relative',
|
|
76
|
+
'& > label, & > input': {
|
|
77
|
+
pointerEvents: readOnly ? 'none' : void 0,
|
|
78
|
+
caretColor: readOnly ? 'transparent' : void 0
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
const Label = styled.label(({ theme: { font, input }, filled, focused })=>({
|
|
82
|
+
fontSize: filled || focused ? font.size.sm : font.size.lg,
|
|
83
|
+
color: filled ? input.labelColor.filled : input.labelColor.default,
|
|
84
|
+
position: 'relative',
|
|
85
|
+
top: filled || focused ? void 0 : 1
|
|
86
|
+
}), ({ theme: { input }, disabled })=>({
|
|
87
|
+
color: disabled ? input.labelColor.disabled : void 0
|
|
88
|
+
}), ({ theme: { input }, focused })=>({
|
|
89
|
+
color: focused ? input.labelColor.focused : void 0
|
|
90
|
+
}));
|
|
91
|
+
const Description = styled.div(({ theme: { font, input }, invalid })=>({
|
|
92
|
+
color: invalid ? input.color.descriptionError : input.color.description,
|
|
93
|
+
fontSize: font.size.sm,
|
|
94
|
+
position: 'absolute',
|
|
95
|
+
left: 0,
|
|
96
|
+
top: 'calc(100% + 4px)'
|
|
97
|
+
}));
|
|
98
|
+
const InputHelpers = {
|
|
99
|
+
Container: InputContainer,
|
|
100
|
+
Wrapper: InputWrapper,
|
|
101
|
+
Label,
|
|
102
|
+
Description,
|
|
103
|
+
useInputFocus,
|
|
104
|
+
isInputFilled
|
|
105
|
+
};
|
|
106
|
+
export { Description, InputContainer, InputWrapper, Label, InputHelpers as default, isInputFilled, useInputFocus };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { CalendarDate } from "@internationalized/date";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { DateInput, DatePicker, Dialog, Popover } from "react-aria-components";
|
|
6
|
+
import Calendar from "../Calendar.js";
|
|
7
|
+
import useMinMax from "../CalendarParts/useMinMax.js";
|
|
8
|
+
import { getDateFromObj, getObjFromDate } from "../CalendarParts/utils.js";
|
|
9
|
+
import getIcon from "../helpers/getIcon.js";
|
|
10
|
+
import Icon from "../Icon/index.js";
|
|
11
|
+
import Spinner from "../Spinner.js";
|
|
12
|
+
import DateSegment from "./helpers/DateSegment.js";
|
|
13
|
+
import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
14
|
+
import InputMessage from "./helpers/InputMessage.js";
|
|
15
|
+
import InputStyles, { preventProps } from "./helpers/InputStyles.js";
|
|
16
|
+
import Label from "./helpers/Label.js";
|
|
17
|
+
import PickerToggle from "./helpers/PickerToggle.js";
|
|
18
|
+
const DatePicker_DatePicker = ({ value, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, onChange, afterShow, afterHide, ref, ...props })=>{
|
|
19
|
+
const [selectedDate, setSelectedDate] = useState(value ? getObjFromDate(value) : void 0);
|
|
20
|
+
const containerRef = useRef(null);
|
|
21
|
+
const { min, max } = useMinMax({
|
|
22
|
+
past: preventPast,
|
|
23
|
+
future: preventFuture
|
|
24
|
+
});
|
|
25
|
+
useEffect(()=>{
|
|
26
|
+
if (value) setSelectedDate(getObjFromDate(value));
|
|
27
|
+
}, [
|
|
28
|
+
value
|
|
29
|
+
]);
|
|
30
|
+
const handleOpenChange = (show)=>{
|
|
31
|
+
if (afterShow && show) afterShow();
|
|
32
|
+
if (afterHide && !show) afterHide();
|
|
33
|
+
};
|
|
34
|
+
const handleDateChange = (val)=>{
|
|
35
|
+
if (!val) return;
|
|
36
|
+
const { year, month, day } = val;
|
|
37
|
+
const selected = new CalendarDate(year, month, day);
|
|
38
|
+
setSelectedDate(selected);
|
|
39
|
+
const newDate = getDateFromObj(val);
|
|
40
|
+
if (onChange) onChange(newDate);
|
|
41
|
+
};
|
|
42
|
+
const handleCalendarChange = (val)=>{
|
|
43
|
+
handleDateChange(getObjFromDate(val));
|
|
44
|
+
};
|
|
45
|
+
const inputHidden = !!(!selectedDate && label);
|
|
46
|
+
return /*#__PURE__*/ jsxs(InputContainer, {
|
|
47
|
+
value: selectedDate,
|
|
48
|
+
hasLabel: !!label,
|
|
49
|
+
isDisabled: disabled,
|
|
50
|
+
isReadOnly: readOnly || loading,
|
|
51
|
+
isInvalid: invalid,
|
|
52
|
+
isRequired: required,
|
|
53
|
+
minValue: min,
|
|
54
|
+
maxValue: max,
|
|
55
|
+
onChange: handleDateChange,
|
|
56
|
+
onOpenChange: handleOpenChange,
|
|
57
|
+
ref: containerRef,
|
|
58
|
+
...props,
|
|
59
|
+
children: [
|
|
60
|
+
iconLeft && getIcon(iconLeft, {
|
|
61
|
+
marginRight: 8
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsx(Label, {
|
|
64
|
+
label: label,
|
|
65
|
+
filled: !!selectedDate,
|
|
66
|
+
disabled: disabled,
|
|
67
|
+
children: /*#__PURE__*/ jsx(Input, {
|
|
68
|
+
ref: ref,
|
|
69
|
+
hide: inputHidden,
|
|
70
|
+
fontSize: fontSize,
|
|
71
|
+
placeholderColor: placeholderColor,
|
|
72
|
+
isDisabled: disabled,
|
|
73
|
+
children: (segment)=>/*#__PURE__*/ jsx(DateSegment, {
|
|
74
|
+
placeholderColor: placeholderColor,
|
|
75
|
+
segment: segment
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
}),
|
|
79
|
+
!hidePicker && /*#__PURE__*/ jsx(PickerToggle, {
|
|
80
|
+
isDisabled: disabled,
|
|
81
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
82
|
+
size: "small",
|
|
83
|
+
name: "calendar"
|
|
84
|
+
})
|
|
85
|
+
}),
|
|
86
|
+
iconRight && getIcon(iconRight),
|
|
87
|
+
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
88
|
+
/*#__PURE__*/ jsx(InputMessage, {
|
|
89
|
+
description: description,
|
|
90
|
+
errorMessage: errorMessage
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ jsx(Popover, {
|
|
93
|
+
triggerRef: containerRef,
|
|
94
|
+
children: /*#__PURE__*/ jsx(Dialog, {
|
|
95
|
+
children: /*#__PURE__*/ jsx(Calendar, {
|
|
96
|
+
date: selectedDate ? getDateFromObj(selectedDate) : void 0,
|
|
97
|
+
onChange: handleCalendarChange,
|
|
98
|
+
preventPast: preventPast,
|
|
99
|
+
preventFuture: preventFuture
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
const InputContainer = styled(DatePicker)(InputContainerStyles);
|
|
107
|
+
const Input = styled(DateInput, preventProps)({
|
|
108
|
+
display: 'flex'
|
|
109
|
+
}, InputStyles);
|
|
110
|
+
const Inputs_DatePicker = DatePicker_DatePicker;
|
|
111
|
+
export { Inputs_DatePicker as default };
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from "@emotion/styled";
|
|
3
|
+
import { CalendarDate } from "@internationalized/date";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { DateInput, DateRangePicker, Dialog, Group, Popover } from "react-aria-components";
|
|
6
|
+
import useMinMax from "../CalendarParts/useMinMax.js";
|
|
7
|
+
import { getDateFromObj, getObjFromDate } from "../CalendarParts/utils.js";
|
|
8
|
+
import getIcon from "../helpers/getIcon.js";
|
|
9
|
+
import Icon from "../Icon/index.js";
|
|
10
|
+
import RangeCalendar from "../RangeCalendar.js";
|
|
11
|
+
import Spinner from "../Spinner.js";
|
|
12
|
+
import DateSegment from "./helpers/DateSegment.js";
|
|
13
|
+
import InputContainerStyles from "./helpers/InputContainerStyles.js";
|
|
14
|
+
import InputMessage from "./helpers/InputMessage.js";
|
|
15
|
+
import InputStyles, { preventProps } from "./helpers/InputStyles.js";
|
|
16
|
+
import Label from "./helpers/Label.js";
|
|
17
|
+
import PickerToggle from "./helpers/PickerToggle.js";
|
|
18
|
+
const DateRangePicker_DateRangePicker = ({ startValue, endValue, label, iconLeft, iconRight, loading, fontSize, placeholderColor, disabled, readOnly, invalid, required, description, errorMessage, preventPast, preventFuture, hidePicker, onChange, afterShow, afterHide, ref, ...props })=>{
|
|
19
|
+
const [selectedStart, setSelectedStart] = useState(startValue ? getObjFromDate(startValue) : void 0);
|
|
20
|
+
const [selectedEnd, setSelectedEnd] = useState(endValue ? getObjFromDate(endValue) : void 0);
|
|
21
|
+
const containerRef = useRef(null);
|
|
22
|
+
const { min, max } = useMinMax({
|
|
23
|
+
past: preventPast,
|
|
24
|
+
future: preventFuture
|
|
25
|
+
});
|
|
26
|
+
useEffect(()=>{
|
|
27
|
+
if (startValue) setSelectedStart(getObjFromDate(startValue));
|
|
28
|
+
if (endValue) setSelectedEnd(getObjFromDate(endValue));
|
|
29
|
+
}, [
|
|
30
|
+
startValue,
|
|
31
|
+
endValue
|
|
32
|
+
]);
|
|
33
|
+
const handleOpenChange = (show)=>{
|
|
34
|
+
if (afterShow && show) afterShow();
|
|
35
|
+
if (afterHide && !show) afterHide();
|
|
36
|
+
};
|
|
37
|
+
const handleDateChange = (val)=>{
|
|
38
|
+
if (!val) return;
|
|
39
|
+
const { start, end } = val;
|
|
40
|
+
const { year: sYear, month: sMonth, day: sDay } = start;
|
|
41
|
+
const { year: eYear, month: eMonth, day: eDay } = end;
|
|
42
|
+
const newStart = new CalendarDate(sYear, sMonth, sDay);
|
|
43
|
+
setSelectedStart(newStart);
|
|
44
|
+
const newEnd = new CalendarDate(eYear, eMonth, eDay);
|
|
45
|
+
setSelectedEnd(newEnd);
|
|
46
|
+
const newStartDate = getDateFromObj(start);
|
|
47
|
+
const newEndDate = getDateFromObj(end);
|
|
48
|
+
if (onChange) onChange(newStartDate, newEndDate);
|
|
49
|
+
};
|
|
50
|
+
const handleCalendarChange = (startVal, endVal)=>{
|
|
51
|
+
const newStart = getObjFromDate(startVal);
|
|
52
|
+
const newEnd = getObjFromDate(endVal);
|
|
53
|
+
handleDateChange({
|
|
54
|
+
start: newStart,
|
|
55
|
+
end: newEnd
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const hasValue = !!(selectedStart || selectedEnd);
|
|
59
|
+
const inputHidden = !!(!hasValue && label);
|
|
60
|
+
return /*#__PURE__*/ jsxs(InputContainer, {
|
|
61
|
+
value: selectedStart && selectedEnd ? {
|
|
62
|
+
start: selectedStart,
|
|
63
|
+
end: selectedEnd
|
|
64
|
+
} : void 0,
|
|
65
|
+
hasLabel: !!label,
|
|
66
|
+
isDisabled: disabled,
|
|
67
|
+
isReadOnly: readOnly || loading,
|
|
68
|
+
isInvalid: invalid,
|
|
69
|
+
isRequired: required,
|
|
70
|
+
minValue: min,
|
|
71
|
+
maxValue: max,
|
|
72
|
+
onChange: handleDateChange,
|
|
73
|
+
onOpenChange: handleOpenChange,
|
|
74
|
+
ref: containerRef,
|
|
75
|
+
...props,
|
|
76
|
+
children: [
|
|
77
|
+
iconLeft && getIcon(iconLeft, {
|
|
78
|
+
marginRight: 8
|
|
79
|
+
}),
|
|
80
|
+
/*#__PURE__*/ jsx(Label, {
|
|
81
|
+
label: label,
|
|
82
|
+
filled: hasValue,
|
|
83
|
+
disabled: disabled,
|
|
84
|
+
children: /*#__PURE__*/ jsxs(InputsWrapper, {
|
|
85
|
+
fontSize: fontSize,
|
|
86
|
+
hide: inputHidden,
|
|
87
|
+
isDisabled: disabled,
|
|
88
|
+
children: [
|
|
89
|
+
/*#__PURE__*/ jsx(Input, {
|
|
90
|
+
slot: "start",
|
|
91
|
+
ref: ref,
|
|
92
|
+
fontSize: fontSize,
|
|
93
|
+
placeholderColor: placeholderColor,
|
|
94
|
+
isDisabled: disabled,
|
|
95
|
+
children: (segment)=>/*#__PURE__*/ jsx(DateSegment, {
|
|
96
|
+
placeholderColor: placeholderColor,
|
|
97
|
+
segment: segment
|
|
98
|
+
})
|
|
99
|
+
}),
|
|
100
|
+
/*#__PURE__*/ jsx("span", {
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
children: "–"
|
|
103
|
+
}),
|
|
104
|
+
/*#__PURE__*/ jsx(Input, {
|
|
105
|
+
slot: "end",
|
|
106
|
+
fontSize: fontSize,
|
|
107
|
+
placeholderColor: placeholderColor,
|
|
108
|
+
isDisabled: disabled,
|
|
109
|
+
children: (segment)=>/*#__PURE__*/ jsx(DateSegment, {
|
|
110
|
+
placeholderColor: placeholderColor,
|
|
111
|
+
segment: segment
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
})
|
|
116
|
+
}),
|
|
117
|
+
!hidePicker && /*#__PURE__*/ jsx(PickerToggle, {
|
|
118
|
+
isDisabled: disabled,
|
|
119
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
120
|
+
size: "small",
|
|
121
|
+
name: "calendar"
|
|
122
|
+
})
|
|
123
|
+
}),
|
|
124
|
+
iconRight && getIcon(iconRight),
|
|
125
|
+
loading && /*#__PURE__*/ jsx(Spinner, {}),
|
|
126
|
+
/*#__PURE__*/ jsx(InputMessage, {
|
|
127
|
+
description: description,
|
|
128
|
+
errorMessage: errorMessage
|
|
129
|
+
}),
|
|
130
|
+
/*#__PURE__*/ jsx(Popover, {
|
|
131
|
+
triggerRef: containerRef,
|
|
132
|
+
children: /*#__PURE__*/ jsx(Dialog, {
|
|
133
|
+
children: /*#__PURE__*/ jsx(RangeCalendar, {
|
|
134
|
+
startDate: selectedStart ? getDateFromObj(selectedStart) : void 0,
|
|
135
|
+
endDate: selectedEnd ? getDateFromObj(selectedEnd) : void 0,
|
|
136
|
+
onChange: handleCalendarChange,
|
|
137
|
+
preventPast: preventPast,
|
|
138
|
+
preventFuture: preventFuture
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
const InputContainer = styled(DateRangePicker)(InputContainerStyles);
|
|
146
|
+
const Input = styled(DateInput, preventProps)(InputStyles, {
|
|
147
|
+
display: 'flex',
|
|
148
|
+
'&:first-of-type': {
|
|
149
|
+
marginRight: 0
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
const InputsWrapper = styled(Group, preventProps)(({ theme: { input, font }, hide, fontSize, isDisabled })=>({
|
|
153
|
+
display: 'flex',
|
|
154
|
+
alignItems: 'center',
|
|
155
|
+
gap: 4,
|
|
156
|
+
'& > span': {
|
|
157
|
+
color: isDisabled ? input.color.disabled : input.color.default,
|
|
158
|
+
fontSize: fontSize || font.size.lg
|
|
159
|
+
},
|
|
160
|
+
'&:not(:focus):not(:focus-within)': {
|
|
161
|
+
opacity: hide ? 0 : 1,
|
|
162
|
+
position: hide ? 'absolute' : void 0
|
|
163
|
+
}
|
|
164
|
+
}));
|
|
165
|
+
const Inputs_DateRangePicker = DateRangePicker_DateRangePicker;
|
|
166
|
+
export { Inputs_DateRangePicker as default };
|