@majoo-ui/react 2.0.1 → 2.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/charts.esm.js +3 -1453
- package/colors/Colors.esm.js +93 -0
- package/components/accordion/Accordion.esm.js +109 -0
- package/components/alertDialog/AlertDialog.esm.js +440 -0
- package/components/avatar/Avatar.esm.js +83 -0
- package/components/badge/Badge.esm.js +255 -0
- package/components/banner/Banner.esm.js +341 -0
- package/components/barChart/BarChart.esm.js +212 -0
- package/components/breadcrumb/Breadcrumb.esm.js +65 -0
- package/components/breadcrumb/index.esm.js +19 -0
- package/components/button/Button.esm.js +331 -0
- package/components/buttonGroup/ButtonGroup.esm.js +350 -0
- package/components/card/Card.esm.js +236 -0
- package/components/chart/assets/data_kosong.png.esm.js +3 -0
- package/components/chart/lineChart/LineChart.esm.js +358 -0
- package/components/chart/lineChart/components/Comparator.esm.js +82 -0
- package/components/chart/lineChart/components/ComparatorController.esm.js +112 -0
- package/components/chart/lineChart/components/ComparatorItem.esm.js +104 -0
- package/components/chart/lineChart/components/ProductList.esm.js +78 -0
- package/components/chart/lineChart/components/TitleLegend.esm.js +107 -0
- package/components/chart/lineChart/components/Tooltip.esm.js +90 -0
- package/components/chart/utils/index.esm.js +109 -0
- package/components/checkboxTable/CheckboxTable.esm.js +287 -0
- package/components/colorPicker/ColorPicker.esm.js +342 -0
- package/components/colorPicker/InputColorPicker.esm.js +120 -0
- package/components/colorPicker/assets/img_colormap.gif.esm.js +3 -0
- package/components/colorPicker/components/ColorFields.esm.js +144 -0
- package/components/colorPicker/components/ColorMap.esm.js +1188 -0
- package/components/contentEditor/ContentEditor.esm.js +251 -0
- package/components/contentEditor/assets/Inline-code-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Link-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/List-bulleted-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/List-numbered-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Redo-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-bold-filled.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-clear-format-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-italic-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-strikethrough-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Text-underline-outline.svg.esm.js +3 -0
- package/components/contentEditor/assets/Undo-outline.svg.esm.js +3 -0
- package/components/contextMenu/ContextMenu.esm.js +298 -0
- package/components/datePicker/AdvancedOption.esm.js +37 -0
- package/components/datePicker/CustomDatePicker.esm.js +121 -0
- package/components/datePicker/DatePicker.esm.js +244 -0
- package/components/datePicker/DatePickerMulti.esm.js +70 -0
- package/components/datePicker/InputDatePicker.esm.js +290 -0
- package/components/datePicker/InputDateRangePicker.esm.js +174 -0
- package/components/datePicker/components/Calendar.esm.js +654 -0
- package/components/datePicker/components/CalendarMulti.esm.js +407 -0
- package/components/datePicker/components/CalendarTimePicker.esm.js +104 -0
- package/components/datePicker/components/DateNumber.esm.js +89 -0
- package/components/datePicker/components/MobileCalendar.esm.js +522 -0
- package/components/datePicker/state/reducer.esm.js +286 -0
- package/components/datePicker/timePicker/InputTimePicker.esm.js +205 -0
- package/components/datePicker/timePicker/TimePicker.esm.js +481 -0
- package/components/devicePreview/DevicePreview.esm.js +631 -0
- package/components/devicePreview/deviceFrame/android-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/android-wide-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-email.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-notification.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-sms.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/bg-whatsapp.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/desktop-transparant.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js +3 -0
- package/components/devicePreview/deviceFrame/iphone-transparant.png.esm.js +3 -0
- package/components/dialog/Dialog.esm.js +106 -0
- package/components/drawer/Drawer.esm.js +294 -0
- package/components/dropdownMenu/DropdownMenu.esm.js +281 -0
- package/components/editableTable/EditableMobile.esm.js +361 -0
- package/components/editableTable/EditableTable.esm.js +618 -0
- package/components/editableTable/transition.esm.js +37 -0
- package/components/form/components/FormGroup/FormGroup.esm.js +142 -0
- package/components/form/components/FormHelper/Helper.esm.js +50 -0
- package/components/form/components/FormLabel/Label.esm.js +90 -0
- package/components/form/components/InputAddon/InputAddon.esm.js +105 -0
- package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +60 -0
- package/components/form/components/InputCheckbox/InputCheckbox.esm.js +129 -0
- package/components/form/components/InputCheckbox/icon/CheckOutline.esm.js +33 -0
- package/components/form/components/InputCheckbox/icon/MinusOutline.esm.js +33 -0
- package/components/form/components/InputCombobox/InputCombobox.esm.js +169 -0
- package/components/form/components/InputCounter/InputCounter.esm.js +226 -0
- package/components/form/components/InputCreatable/InputCreatable.esm.js +229 -0
- package/components/form/components/InputDateRange/InputDateRange.esm.js +46 -0
- package/components/form/components/InputElement/InputElement.esm.js +35 -0
- package/components/form/components/InputGroup/InputGroup.esm.js +188 -0
- package/components/form/components/InputLetter/InputLetter.esm.js +68 -0
- package/components/form/components/InputNumber/InputNumber.esm.js +248 -0
- package/components/form/components/InputNumber/NumberFormat.esm.js +1263 -0
- package/components/form/components/InputOTP/InputOTP.esm.js +70 -0
- package/components/form/components/InputRadio/InputRadio.esm.js +273 -0
- package/components/form/components/InputRadio/InputRadioGroup.esm.js +35 -0
- package/components/form/components/InputRadio/context.esm.js +5 -0
- package/components/form/components/InputResourceList/InputResourceList.esm.js +429 -0
- package/components/form/components/InputSearchbox/CloseFilled.esm.js +34 -0
- package/components/form/components/InputSearchbox/InputSearchbox.esm.js +90 -0
- package/components/form/components/InputSearchbox/SearchOutline.esm.js +26 -0
- package/components/form/components/InputSelect/InputSelect.esm.js +964 -0
- package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +1388 -0
- package/components/form/components/InputSelectCheck/OptionGroupItem.esm.js +39 -0
- package/components/form/components/InputSelectCheck/icon/CheckOutline.esm.js +33 -0
- package/components/form/components/InputSelectTag/InputSelectTag.esm.js +62 -0
- package/components/form/components/InputSignature/InputSignature.esm.js +122 -0
- package/components/form/components/InputSignature/SignatureModal.esm.js +67 -0
- package/components/form/components/InputSwitch/InputSwitch.esm.js +96 -0
- package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +136 -0
- package/components/form/components/InputTags/InputTags.esm.js +268 -0
- package/components/form/components/InputText/InputText.esm.js +197 -0
- package/components/form/components/InputTextArea/InputTextArea.esm.js +77 -0
- package/components/heading/Heading.esm.js +64 -0
- package/components/iconButton/IconButton.esm.js +71 -0
- package/components/image/Image.esm.js +141 -0
- package/components/link/Link.esm.js +59 -0
- package/components/loadingBar/LoadingBar.esm.js +113 -0
- package/components/mapPicker/InputMapPicker.esm.js +160 -0
- package/components/mapPicker/MapPicker.esm.js +122 -0
- package/components/mapPicker/MapPicker.styles.esm.js +70 -0
- package/components/mapPicker/assets/images/Mapsicle.png.esm.js +3 -0
- package/components/mapPicker/components/AddressCard.esm.js +25 -0
- package/components/mapPicker/components/ButtonSelect.esm.js +46 -0
- package/components/mapPicker/components/ChangeView.esm.js +20 -0
- package/components/mapPicker/components/InputSearch.esm.js +74 -0
- package/components/mapPicker/components/MarkerIcon.esm.js +22 -0
- package/components/mapPicker/components/MarkerSvg.esm.js +62 -0
- package/components/mapPicker/components/ZoomControls.esm.js +36 -0
- package/components/mapPicker/hooks/useMapSearch.esm.js +161 -0
- package/components/modalDialog/ModalDialog.esm.js +247 -0
- package/components/notificationBadge/NotificationBadge.esm.js +149 -0
- package/components/pageDialog/PageDialog.esm.js +291 -0
- package/components/pageDialog/logo.svg.esm.js +3 -0
- package/components/pagination/Pagination.esm.js +94 -0
- package/components/pagination/PaginationButton.esm.js +346 -0
- package/components/pagination/PaginationInfo.esm.js +146 -0
- package/components/paper/Paper.esm.js +76 -0
- package/components/paragraph/Paragraph.esm.js +52 -0
- package/components/pieChart/PieChart.esm.js +287 -0
- package/components/popover/Popover.esm.js +142 -0
- package/components/progress/Progress.esm.js +170 -0
- package/components/progressIndicator/ProgressIndicator.esm.js +287 -0
- package/components/scrollSync/ScrollSync.esm.js +172 -0
- package/components/scrollSync/ScrollSyncNode.esm.js +87 -0
- package/components/scrollSync/utils.esm.js +9 -0
- package/components/separator/Separator.esm.js +43 -0
- package/components/skeleton/Skeleton.esm.js +131 -0
- package/components/slider/Slider.esm.js +345 -0
- package/components/stepWizard/StepWizard.esm.js +451 -0
- package/components/stepWizard/index.esm.js +14 -0
- package/components/table/MobileTable.esm.js +415 -0
- package/components/table/Table.esm.js +1472 -0
- package/components/table/components/columns/DateColumn.esm.js +26 -0
- package/components/table/components/columns/DecimalColumn.esm.js +36 -0
- package/components/table/components/columns/PriceColumn.esm.js +57 -0
- package/components/table/components/columns/RowDraggableColumn.esm.js +24 -0
- package/components/table/components/columns/RowExpanderColumn.esm.js +32 -0
- package/components/table/components/columns/RowExpanderMultipleColumn.esm.js +24 -0
- package/components/table/components/columns/RowMenuColumn.esm.js +101 -0
- package/components/table/components/columns/RowSelectionCallbackColumn.esm.js +38 -0
- package/components/table/components/columns/RowSelectionColumn.esm.js +34 -0
- package/components/table/images/img-emptydata.webp.esm.js +3 -0
- package/components/table/images/img-emptysearchdata.webp.esm.js +3 -0
- package/components/tableOfContent/TableOfContent.esm.js +267 -0
- package/components/tableOfContent/index.esm.js +18 -0
- package/components/tableOfContent/transition.esm.js +38 -0
- package/components/tabs/Tabs.esm.js +282 -0
- package/components/tag/Tag.esm.js +161 -0
- package/components/tagList/TagList.esm.js +90 -0
- package/components/tagStatus/TagStatus.esm.js +134 -0
- package/components/text/Text.esm.js +140 -0
- package/components/toast/Toast.esm.js +297 -0
- package/components/toast/ToastContainer.esm.js +73 -0
- package/components/toast/context/ToastContext.esm.js +5 -0
- package/components/toast/context/ToastProvider.esm.js +96 -0
- package/components/tooltip/Tooltip.esm.js +175 -0
- package/components/upload/Upload.esm.js +1103 -0
- package/components/upload/utils/canvasPreview.esm.js +39 -0
- package/components/upload/utils/imgPreview.esm.js +21 -0
- package/config/stitches.config.esm.js +216 -0
- package/editor.esm.js +1 -264
- package/hooks/useListOption/useListOption.esm.js +56 -0
- package/hooks/useToggle/useToggle.esm.js +8 -0
- package/index.esm.js +106 -42293
- package/layout/box/Box.esm.js +24 -0
- package/layout/flex/Flex.esm.js +135 -0
- package/layout/grid/Grid.esm.js +270 -0
- package/layout/pageContainer/PageContainer.esm.js +60 -0
- package/majoo-provider/MajooProvider.esm.js +42 -0
- package/majoo-provider/ThemeProvider.esm.js +41 -0
- package/majoo-provider/globalStyles.esm.js +242 -0
- package/majoo-provider/styles/modern-normalize.esm.js +95 -0
- package/map.esm.js +2 -734
- package/package.json +8 -4
- package/utils/calendar.esm.js +26 -0
- package/utils/element.esm.js +21 -0
- package/utils/object.esm.js +12 -0
- package/utils/request.esm.js +74 -0
- package/utils/strings.esm.js +6 -0
- package/{useMediaQuery.esm.js → utils/useMediaQuery.esm.js} +1 -1
- package/utils/useNavigatorOnline.esm.js +19 -0
- package/utils/variant.esm.js +12 -0
- package/wrapper/ConditionalWrapper.esm.js +9 -0
- package/ModalDialog.esm.js +0 -2669
- package/Separator.esm.js +0 -3002
- package/stitches.config.esm.js +0 -2284
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import 'core-js/modules/es.iterator.constructor.js';
|
|
2
|
+
import 'core-js/modules/es.iterator.find.js';
|
|
3
|
+
import 'core-js/modules/es.iterator.to-array.js';
|
|
4
|
+
import { __rest } from 'tslib';
|
|
5
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
|
+
import React__default, { useCallback } from 'react';
|
|
7
|
+
import { styled } from '../../config/stitches.config.esm.js';
|
|
8
|
+
import Box from '../../layout/box/Box.esm.js';
|
|
9
|
+
import Dialog, { DialogTrigger, DialogContent, DialogClose, DialogTitle, DialogPortal } from '../dialog/Dialog.esm.js';
|
|
10
|
+
import Heading from '../heading/Heading.esm.js';
|
|
11
|
+
import { Image } from '../image/Image.esm.js';
|
|
12
|
+
import { ConditionalWrapper } from '../../wrapper/ConditionalWrapper.esm.js';
|
|
13
|
+
import { CloseOutline } from '@majoo-ui/icons';
|
|
14
|
+
import useMediaQuery from '../../utils/useMediaQuery.esm.js';
|
|
15
|
+
|
|
16
|
+
const PageDialogFooter = styled('div');
|
|
17
|
+
PageDialogFooter.displayName = 'PageDialogFooter';
|
|
18
|
+
const PageDialogTitle = styled('div');
|
|
19
|
+
PageDialogTitle.displayName = 'PageDialogTitle';
|
|
20
|
+
const PageDialogContent = styled('div', {});
|
|
21
|
+
PageDialogContent.displayName = 'PageDialogContent';
|
|
22
|
+
const PageDialogTrigger = styled('div');
|
|
23
|
+
PageDialogTrigger.displayName = 'PageDialogTrigger';
|
|
24
|
+
const ContentWrapper = styled(Box, {
|
|
25
|
+
animationName: 'unset !important',
|
|
26
|
+
variants: {
|
|
27
|
+
wrapperSize: {
|
|
28
|
+
md: {
|
|
29
|
+
padding: '40px 24px',
|
|
30
|
+
marginLeft: 'auto',
|
|
31
|
+
marginRight: 'auto',
|
|
32
|
+
//982 + padding horizontal
|
|
33
|
+
maxWidth: 1030
|
|
34
|
+
},
|
|
35
|
+
lg: {
|
|
36
|
+
padding: '40px 24px',
|
|
37
|
+
marginLeft: 'auto',
|
|
38
|
+
marginRight: 'auto',
|
|
39
|
+
//1318 + padding horizontal
|
|
40
|
+
maxWidth: 1366
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const PageDialogLogo = styled('div', {
|
|
46
|
+
width: 124,
|
|
47
|
+
height: 40,
|
|
48
|
+
backgroundImage: 'var(--brandAssets-logo)',
|
|
49
|
+
backgroundSize: 'contain',
|
|
50
|
+
backgroundRepeat: 'no-repeat',
|
|
51
|
+
backgroundPosition: 'center'
|
|
52
|
+
});
|
|
53
|
+
const findNodeChild = (array, displayName) => {
|
|
54
|
+
const result = array.find(child => {
|
|
55
|
+
if (/*#__PURE__*/React__default.isValidElement(child)) {
|
|
56
|
+
const reactElement = child;
|
|
57
|
+
if (typeof reactElement.type !== 'string') {
|
|
58
|
+
const reactFC = reactElement.type;
|
|
59
|
+
if (reactFC.displayName === displayName) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
});
|
|
66
|
+
return result;
|
|
67
|
+
};
|
|
68
|
+
const FOOTER_HEIGHT = 64;
|
|
69
|
+
const HEADER_HEIGHT = 56;
|
|
70
|
+
const HEADER_HEIGHT_MOBILE = 60;
|
|
71
|
+
const PageDialog = props => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
const {
|
|
74
|
+
children,
|
|
75
|
+
size,
|
|
76
|
+
css,
|
|
77
|
+
layer,
|
|
78
|
+
isMobile: _isMobile,
|
|
79
|
+
onOpenAutoFocus,
|
|
80
|
+
onCloseAutoFocus,
|
|
81
|
+
onPointerDownOutside,
|
|
82
|
+
onInteractOutside,
|
|
83
|
+
disabledCloseButton,
|
|
84
|
+
withPortal = true,
|
|
85
|
+
logo
|
|
86
|
+
} = props,
|
|
87
|
+
rest = __rest(props, ["children", "size", "css", "layer", "isMobile", "onOpenAutoFocus", "onCloseAutoFocus", "onPointerDownOutside", "onInteractOutside", "disabledCloseButton", "withPortal", "logo"]);
|
|
88
|
+
const childArray = React__default.Children.toArray(children);
|
|
89
|
+
const footerChildren = findNodeChild(childArray, 'PageDialogFooter');
|
|
90
|
+
const headerTitle = findNodeChild(childArray, 'PageDialogTitle');
|
|
91
|
+
const pageDialogChildren = findNodeChild(childArray, 'PageDialogContent');
|
|
92
|
+
const pageDialogTrigger = findNodeChild(childArray, 'PageDialogTrigger');
|
|
93
|
+
const autoQuery = useMediaQuery('(max-width: 767px)');
|
|
94
|
+
const isMobile = _isMobile === undefined ? autoQuery : _isMobile;
|
|
95
|
+
const ref = useCallback(node => {
|
|
96
|
+
if (node !== null) {
|
|
97
|
+
document.body.style.overflow = 'hidden';
|
|
98
|
+
} else {
|
|
99
|
+
document.body.style.overflow = 'auto';
|
|
100
|
+
}
|
|
101
|
+
}, []);
|
|
102
|
+
const ClossedIcon = () => jsx("svg", {
|
|
103
|
+
width: "10",
|
|
104
|
+
height: "10",
|
|
105
|
+
viewBox: "0 0 10 10",
|
|
106
|
+
fill: "none",
|
|
107
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
108
|
+
children: jsx("path", {
|
|
109
|
+
fillRule: "evenodd",
|
|
110
|
+
clipRule: "evenodd",
|
|
111
|
+
d: "M0.292894 1.70711C-0.0976312 1.31658 -0.0976312 0.683417 0.292894 0.292893C0.683418 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L5 3.58579L8.29289 0.292893C8.68342 -0.0976311 9.31658 -0.0976311 9.70711 0.292893C10.0976 0.683417 10.0976 1.31658 9.70711 1.70711L6.41421 5L9.70711 8.29289C10.0976 8.68342 10.0976 9.31658 9.70711 9.70711C9.31658 10.0976 8.68342 10.0976 8.29289 9.70711L5 6.41421L1.70711 9.70711C1.31658 10.0976 0.683418 10.0976 0.292894 9.70711C-0.0976306 9.31658 -0.0976306 8.68342 0.292894 8.29289L3.58579 5L0.292894 1.70711Z",
|
|
112
|
+
fill: "#404545"
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
return jsxs(Dialog, Object.assign({}, rest, {
|
|
116
|
+
modal: false,
|
|
117
|
+
children: [pageDialogTrigger && jsx(DialogTrigger, Object.assign({}, pageDialogTrigger.props)), jsx(ConditionalWrapper, {
|
|
118
|
+
condition: withPortal,
|
|
119
|
+
wrapper: _child => jsx(DialogPortal, {
|
|
120
|
+
children: _child
|
|
121
|
+
}),
|
|
122
|
+
children: jsx(DialogContent, {
|
|
123
|
+
size: size,
|
|
124
|
+
css: Object.assign(Object.assign({}, css), {
|
|
125
|
+
height: '100%',
|
|
126
|
+
minHeight: 'unset',
|
|
127
|
+
zIndex: layer
|
|
128
|
+
}),
|
|
129
|
+
ref: ref,
|
|
130
|
+
onOpenAutoFocus: e => {
|
|
131
|
+
if (!onOpenAutoFocus) {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
} else {
|
|
134
|
+
onOpenAutoFocus(e);
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
onCloseAutoFocus: e => {
|
|
138
|
+
if (!onCloseAutoFocus) {
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
} else {
|
|
141
|
+
onCloseAutoFocus(e);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
onPointerDownOutside: e => {
|
|
145
|
+
if (!onPointerDownOutside) {
|
|
146
|
+
e.preventDefault();
|
|
147
|
+
} else {
|
|
148
|
+
onPointerDownOutside(e);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
onInteractOutside: e => {
|
|
152
|
+
if (!onInteractOutside) {
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
} else {
|
|
155
|
+
onInteractOutside(e);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
children: jsxs(Box, {
|
|
159
|
+
css: {
|
|
160
|
+
backgroundColor: isMobile ? '$white' : '$gray50',
|
|
161
|
+
height: '100%',
|
|
162
|
+
display: 'flex',
|
|
163
|
+
flexDirection: 'column'
|
|
164
|
+
},
|
|
165
|
+
children: [jsxs(Box, {
|
|
166
|
+
css: {
|
|
167
|
+
backgroundColor: '$white',
|
|
168
|
+
padding: isMobile ? '24px 16px' : '4px 24px',
|
|
169
|
+
display: 'flex',
|
|
170
|
+
alignItems: 'center',
|
|
171
|
+
position: 'relative',
|
|
172
|
+
boxShadow: '$small',
|
|
173
|
+
zIndex: isMobile ? 11 : 1,
|
|
174
|
+
height: isMobile ? HEADER_HEIGHT_MOBILE : HEADER_HEIGHT
|
|
175
|
+
},
|
|
176
|
+
children: [jsxs(Box, {
|
|
177
|
+
css: {
|
|
178
|
+
justifyContent: isMobile ? 'flex-end' : 'flex-start',
|
|
179
|
+
flexDirection: isMobile ? 'row-reverse' : 'row',
|
|
180
|
+
width: '100%',
|
|
181
|
+
display: 'flex',
|
|
182
|
+
alignItems: 'center',
|
|
183
|
+
gap: isMobile ? '$spacing-04' : '$cozy'
|
|
184
|
+
},
|
|
185
|
+
children: [!isMobile && jsx(ConditionalWrapper, {
|
|
186
|
+
condition: !disabledCloseButton,
|
|
187
|
+
wrapper: children => jsx(DialogClose, {
|
|
188
|
+
asChild: true,
|
|
189
|
+
children: children
|
|
190
|
+
}),
|
|
191
|
+
children: jsx(Box, {
|
|
192
|
+
css: {
|
|
193
|
+
width: 48,
|
|
194
|
+
height: 48,
|
|
195
|
+
display: 'flex',
|
|
196
|
+
justifyContent: 'center',
|
|
197
|
+
alignItems: 'center',
|
|
198
|
+
backgroundColor: '$gray150',
|
|
199
|
+
borderRadius: '$lg',
|
|
200
|
+
cursor: disabledCloseButton ? 'not-allowed' : 'pointer'
|
|
201
|
+
},
|
|
202
|
+
children: jsx(CloseOutline, {
|
|
203
|
+
size: "16"
|
|
204
|
+
})
|
|
205
|
+
})
|
|
206
|
+
}), jsx(DialogTitle, {
|
|
207
|
+
css: {
|
|
208
|
+
margin: 0,
|
|
209
|
+
zIndex: isMobile ? 11 : 'unset'
|
|
210
|
+
},
|
|
211
|
+
children: headerTitle && jsx(Heading, Object.assign({
|
|
212
|
+
as: "p",
|
|
213
|
+
heading: "pageTitle"
|
|
214
|
+
}, headerTitle.props))
|
|
215
|
+
}), isMobile && jsx(ConditionalWrapper, {
|
|
216
|
+
condition: !disabledCloseButton,
|
|
217
|
+
wrapper: children => jsx(DialogClose, {
|
|
218
|
+
asChild: true,
|
|
219
|
+
children: children
|
|
220
|
+
}),
|
|
221
|
+
children: jsx(Box, {
|
|
222
|
+
css: {
|
|
223
|
+
display: 'flex',
|
|
224
|
+
justifyContent: 'center',
|
|
225
|
+
alignItems: 'center',
|
|
226
|
+
cursor: disabledCloseButton ? 'not-allowed' : 'pointer',
|
|
227
|
+
padding: '$spacing-02',
|
|
228
|
+
backgroundColor: '$gray50',
|
|
229
|
+
borderRadius: 50
|
|
230
|
+
},
|
|
231
|
+
children: jsx(ClossedIcon, {})
|
|
232
|
+
})
|
|
233
|
+
})]
|
|
234
|
+
}), !isMobile && jsx(Box, {
|
|
235
|
+
css: {
|
|
236
|
+
position: 'absolute',
|
|
237
|
+
left: '50%',
|
|
238
|
+
top: '50%',
|
|
239
|
+
transform: 'translate(-50%,-50%)'
|
|
240
|
+
},
|
|
241
|
+
children: logo ? jsx(Image, {
|
|
242
|
+
src: logo,
|
|
243
|
+
alt: "logo",
|
|
244
|
+
width: 124,
|
|
245
|
+
height: 40,
|
|
246
|
+
objectFit: "contain",
|
|
247
|
+
className: undefined,
|
|
248
|
+
fallback: undefined
|
|
249
|
+
}) : jsx(PageDialogLogo, {})
|
|
250
|
+
})]
|
|
251
|
+
}), pageDialogChildren && jsx(Box, Object.assign({}, pageDialogChildren.props, {
|
|
252
|
+
ref: pageDialogChildren === null || pageDialogChildren === void 0 ? void 0 : pageDialogChildren.ref,
|
|
253
|
+
css: Object.assign({
|
|
254
|
+
flexGrow: 1,
|
|
255
|
+
maxHeight: footerChildren ? `calc(100vh - ${isMobile ? HEADER_HEIGHT_MOBILE : HEADER_HEIGHT}px - ${FOOTER_HEIGHT}px)` : `calc(100vh - ${isMobile ? HEADER_HEIGHT_MOBILE : HEADER_HEIGHT}px)`,
|
|
256
|
+
overflow: 'auto'
|
|
257
|
+
}, pageDialogChildren.props.css),
|
|
258
|
+
children: jsx(ContentWrapper, Object.assign({}, !isMobile ? {
|
|
259
|
+
wrapperSize: (_a = pageDialogChildren.props) === null || _a === void 0 ? void 0 : _a.wrapperSize
|
|
260
|
+
} : {
|
|
261
|
+
css: {
|
|
262
|
+
display: 'contents'
|
|
263
|
+
}
|
|
264
|
+
}, {
|
|
265
|
+
children: (_b = pageDialogChildren.props) === null || _b === void 0 ? void 0 : _b.children
|
|
266
|
+
}))
|
|
267
|
+
})), footerChildren && jsx(Box, Object.assign({}, footerChildren.props, {
|
|
268
|
+
css: Object.assign({
|
|
269
|
+
boxShadow: '$small',
|
|
270
|
+
backgroundColor: '$white',
|
|
271
|
+
padding: '16px 24px',
|
|
272
|
+
display: 'flex',
|
|
273
|
+
justifyContent: 'flex-end',
|
|
274
|
+
height: FOOTER_HEIGHT
|
|
275
|
+
}, footerChildren.props.css)
|
|
276
|
+
}))]
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
})]
|
|
280
|
+
}));
|
|
281
|
+
};
|
|
282
|
+
PageDialog.Trigger = PageDialogTrigger;
|
|
283
|
+
PageDialog.Title = PageDialogTitle;
|
|
284
|
+
PageDialog.Content = PageDialogContent;
|
|
285
|
+
PageDialog.Footer = PageDialogFooter;
|
|
286
|
+
PageDialog.defaultProps = {
|
|
287
|
+
size: 'full',
|
|
288
|
+
layer: '$modal'
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export { PageDialog, PageDialogContent, PageDialogFooter, PageDialogTitle, PageDialogTrigger };
|