@majoo-ui/react 2.0.1 → 2.1.0-rc.0

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.
Files changed (203) hide show
  1. package/charts.esm.js +3 -1453
  2. package/colors/Colors.esm.js +93 -0
  3. package/components/accordion/Accordion.esm.js +109 -0
  4. package/components/alertDialog/AlertDialog.esm.js +440 -0
  5. package/components/avatar/Avatar.esm.js +83 -0
  6. package/components/badge/Badge.esm.js +255 -0
  7. package/components/banner/Banner.esm.js +341 -0
  8. package/components/barChart/BarChart.esm.js +212 -0
  9. package/components/breadcrumb/Breadcrumb.esm.js +65 -0
  10. package/components/breadcrumb/index.esm.js +19 -0
  11. package/components/button/Button.esm.js +331 -0
  12. package/components/buttonGroup/ButtonGroup.esm.js +350 -0
  13. package/components/card/Card.esm.js +236 -0
  14. package/components/chart/assets/data_kosong.png.esm.js +3 -0
  15. package/components/chart/lineChart/LineChart.esm.js +358 -0
  16. package/components/chart/lineChart/components/Comparator.esm.js +82 -0
  17. package/components/chart/lineChart/components/ComparatorController.esm.js +112 -0
  18. package/components/chart/lineChart/components/ComparatorItem.esm.js +104 -0
  19. package/components/chart/lineChart/components/ProductList.esm.js +78 -0
  20. package/components/chart/lineChart/components/TitleLegend.esm.js +107 -0
  21. package/components/chart/lineChart/components/Tooltip.esm.js +90 -0
  22. package/components/chart/utils/index.esm.js +109 -0
  23. package/components/checkboxTable/CheckboxTable.esm.js +287 -0
  24. package/components/colorPicker/ColorPicker.esm.js +342 -0
  25. package/components/colorPicker/InputColorPicker.esm.js +120 -0
  26. package/components/colorPicker/assets/img_colormap.gif.esm.js +3 -0
  27. package/components/colorPicker/components/ColorFields.esm.js +144 -0
  28. package/components/colorPicker/components/ColorMap.esm.js +1188 -0
  29. package/components/contentEditor/ContentEditor.esm.js +251 -0
  30. package/components/contentEditor/assets/Inline-code-outline.svg.esm.js +3 -0
  31. package/components/contentEditor/assets/Link-outline.svg.esm.js +3 -0
  32. package/components/contentEditor/assets/List-bulleted-outline.svg.esm.js +3 -0
  33. package/components/contentEditor/assets/List-numbered-outline.svg.esm.js +3 -0
  34. package/components/contentEditor/assets/Redo-outline.svg.esm.js +3 -0
  35. package/components/contentEditor/assets/Text-bold-filled.svg.esm.js +3 -0
  36. package/components/contentEditor/assets/Text-clear-format-outline.svg.esm.js +3 -0
  37. package/components/contentEditor/assets/Text-italic-outline.svg.esm.js +3 -0
  38. package/components/contentEditor/assets/Text-strikethrough-outline.svg.esm.js +3 -0
  39. package/components/contentEditor/assets/Text-underline-outline.svg.esm.js +3 -0
  40. package/components/contentEditor/assets/Undo-outline.svg.esm.js +3 -0
  41. package/components/contextMenu/ContextMenu.esm.js +298 -0
  42. package/components/datePicker/AdvancedOption.esm.js +37 -0
  43. package/components/datePicker/CustomDatePicker.esm.js +121 -0
  44. package/components/datePicker/DatePicker.esm.js +244 -0
  45. package/components/datePicker/DatePickerMulti.esm.js +70 -0
  46. package/components/datePicker/InputDatePicker.esm.js +290 -0
  47. package/components/datePicker/InputDateRangePicker.esm.js +174 -0
  48. package/components/datePicker/components/Calendar.esm.js +654 -0
  49. package/components/datePicker/components/CalendarMulti.esm.js +407 -0
  50. package/components/datePicker/components/CalendarTimePicker.esm.js +104 -0
  51. package/components/datePicker/components/DateNumber.esm.js +89 -0
  52. package/components/datePicker/components/MobileCalendar.esm.js +522 -0
  53. package/components/datePicker/state/reducer.esm.js +286 -0
  54. package/components/datePicker/timePicker/InputTimePicker.esm.js +205 -0
  55. package/components/datePicker/timePicker/TimePicker.esm.js +481 -0
  56. package/components/devicePreview/DevicePreview.esm.js +631 -0
  57. package/components/devicePreview/deviceFrame/android-transparant.png.esm.js +3 -0
  58. package/components/devicePreview/deviceFrame/android-wide-transparant.png.esm.js +3 -0
  59. package/components/devicePreview/deviceFrame/bg-email.png.esm.js +3 -0
  60. package/components/devicePreview/deviceFrame/bg-notification.png.esm.js +3 -0
  61. package/components/devicePreview/deviceFrame/bg-sms.png.esm.js +3 -0
  62. package/components/devicePreview/deviceFrame/bg-whatsapp.png.esm.js +3 -0
  63. package/components/devicePreview/deviceFrame/desktop-transparant.png.esm.js +3 -0
  64. package/components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js +3 -0
  65. package/components/devicePreview/deviceFrame/iphone-transparant.png.esm.js +3 -0
  66. package/components/dialog/Dialog.esm.js +106 -0
  67. package/components/drawer/Drawer.esm.js +294 -0
  68. package/components/dropdownMenu/DropdownMenu.esm.js +281 -0
  69. package/components/editableTable/EditableMobile.esm.js +361 -0
  70. package/components/editableTable/EditableTable.esm.js +618 -0
  71. package/components/editableTable/transition.esm.js +37 -0
  72. package/components/form/components/FormGroup/FormGroup.esm.js +142 -0
  73. package/components/form/components/FormHelper/Helper.esm.js +50 -0
  74. package/components/form/components/FormLabel/Label.esm.js +90 -0
  75. package/components/form/components/InputAddon/InputAddon.esm.js +105 -0
  76. package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +60 -0
  77. package/components/form/components/InputCheckbox/InputCheckbox.esm.js +129 -0
  78. package/components/form/components/InputCheckbox/icon/CheckOutline.esm.js +33 -0
  79. package/components/form/components/InputCheckbox/icon/MinusOutline.esm.js +33 -0
  80. package/components/form/components/InputCombobox/InputCombobox.esm.js +169 -0
  81. package/components/form/components/InputCounter/InputCounter.esm.js +226 -0
  82. package/components/form/components/InputCreatable/InputCreatable.esm.js +229 -0
  83. package/components/form/components/InputDateRange/InputDateRange.esm.js +46 -0
  84. package/components/form/components/InputElement/InputElement.esm.js +35 -0
  85. package/components/form/components/InputGroup/InputGroup.esm.js +188 -0
  86. package/components/form/components/InputLetter/InputLetter.esm.js +68 -0
  87. package/components/form/components/InputNumber/InputNumber.esm.js +248 -0
  88. package/components/form/components/InputNumber/NumberFormat.esm.js +1263 -0
  89. package/components/form/components/InputOTP/InputOTP.esm.js +70 -0
  90. package/components/form/components/InputRadio/InputRadio.esm.js +273 -0
  91. package/components/form/components/InputRadio/InputRadioGroup.esm.js +35 -0
  92. package/components/form/components/InputRadio/context.esm.js +5 -0
  93. package/components/form/components/InputResourceList/InputResourceList.esm.js +429 -0
  94. package/components/form/components/InputSearchbox/CloseFilled.esm.js +34 -0
  95. package/components/form/components/InputSearchbox/InputSearchbox.esm.js +90 -0
  96. package/components/form/components/InputSearchbox/SearchOutline.esm.js +26 -0
  97. package/components/form/components/InputSelect/InputSelect.esm.js +964 -0
  98. package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +1388 -0
  99. package/components/form/components/InputSelectCheck/OptionGroupItem.esm.js +39 -0
  100. package/components/form/components/InputSelectCheck/icon/CheckOutline.esm.js +33 -0
  101. package/components/form/components/InputSelectTag/InputSelectTag.esm.js +62 -0
  102. package/components/form/components/InputSignature/InputSignature.esm.js +122 -0
  103. package/components/form/components/InputSignature/SignatureModal.esm.js +67 -0
  104. package/components/form/components/InputSwitch/InputSwitch.esm.js +96 -0
  105. package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +136 -0
  106. package/components/form/components/InputTags/InputTags.esm.js +268 -0
  107. package/components/form/components/InputText/InputText.esm.js +197 -0
  108. package/components/form/components/InputTextArea/InputTextArea.esm.js +77 -0
  109. package/components/heading/Heading.esm.js +64 -0
  110. package/components/iconButton/IconButton.esm.js +71 -0
  111. package/components/image/Image.esm.js +141 -0
  112. package/components/link/Link.esm.js +59 -0
  113. package/components/loadingBar/LoadingBar.esm.js +113 -0
  114. package/components/mapPicker/InputMapPicker.esm.js +160 -0
  115. package/components/mapPicker/MapPicker.esm.js +122 -0
  116. package/components/mapPicker/MapPicker.styles.esm.js +70 -0
  117. package/components/mapPicker/assets/images/Mapsicle.png.esm.js +3 -0
  118. package/components/mapPicker/components/AddressCard.esm.js +25 -0
  119. package/components/mapPicker/components/ButtonSelect.esm.js +46 -0
  120. package/components/mapPicker/components/ChangeView.esm.js +20 -0
  121. package/components/mapPicker/components/InputSearch.esm.js +74 -0
  122. package/components/mapPicker/components/MarkerIcon.esm.js +22 -0
  123. package/components/mapPicker/components/MarkerSvg.esm.js +62 -0
  124. package/components/mapPicker/components/ZoomControls.esm.js +36 -0
  125. package/components/mapPicker/hooks/useMapSearch.esm.js +161 -0
  126. package/components/modalDialog/ModalDialog.esm.js +247 -0
  127. package/components/notificationBadge/NotificationBadge.esm.js +149 -0
  128. package/components/pageDialog/PageDialog.esm.js +291 -0
  129. package/components/pageDialog/logo.svg.esm.js +3 -0
  130. package/components/pagination/Pagination.esm.js +94 -0
  131. package/components/pagination/PaginationButton.esm.js +346 -0
  132. package/components/pagination/PaginationInfo.esm.js +146 -0
  133. package/components/paper/Paper.esm.js +76 -0
  134. package/components/paragraph/Paragraph.esm.js +52 -0
  135. package/components/pieChart/PieChart.esm.js +287 -0
  136. package/components/popover/Popover.esm.js +142 -0
  137. package/components/progress/Progress.esm.js +170 -0
  138. package/components/progressIndicator/ProgressIndicator.esm.js +287 -0
  139. package/components/scrollSync/ScrollSync.esm.js +172 -0
  140. package/components/scrollSync/ScrollSyncNode.esm.js +87 -0
  141. package/components/scrollSync/utils.esm.js +9 -0
  142. package/components/separator/Separator.esm.js +43 -0
  143. package/components/skeleton/Skeleton.esm.js +131 -0
  144. package/components/slider/Slider.esm.js +345 -0
  145. package/components/stepWizard/StepWizard.esm.js +451 -0
  146. package/components/stepWizard/index.esm.js +14 -0
  147. package/components/table/MobileTable.esm.js +415 -0
  148. package/components/table/Table.esm.js +1472 -0
  149. package/components/table/components/columns/DateColumn.esm.js +26 -0
  150. package/components/table/components/columns/DecimalColumn.esm.js +36 -0
  151. package/components/table/components/columns/PriceColumn.esm.js +57 -0
  152. package/components/table/components/columns/RowDraggableColumn.esm.js +24 -0
  153. package/components/table/components/columns/RowExpanderColumn.esm.js +32 -0
  154. package/components/table/components/columns/RowExpanderMultipleColumn.esm.js +24 -0
  155. package/components/table/components/columns/RowMenuColumn.esm.js +101 -0
  156. package/components/table/components/columns/RowSelectionCallbackColumn.esm.js +38 -0
  157. package/components/table/components/columns/RowSelectionColumn.esm.js +34 -0
  158. package/components/table/images/img-emptydata.webp.esm.js +3 -0
  159. package/components/table/images/img-emptysearchdata.webp.esm.js +3 -0
  160. package/components/tableOfContent/TableOfContent.esm.js +267 -0
  161. package/components/tableOfContent/index.esm.js +18 -0
  162. package/components/tableOfContent/transition.esm.js +38 -0
  163. package/components/tabs/Tabs.esm.js +282 -0
  164. package/components/tag/Tag.esm.js +161 -0
  165. package/components/tagList/TagList.esm.js +90 -0
  166. package/components/tagStatus/TagStatus.esm.js +134 -0
  167. package/components/text/Text.esm.js +140 -0
  168. package/components/toast/Toast.esm.js +297 -0
  169. package/components/toast/ToastContainer.esm.js +73 -0
  170. package/components/toast/context/ToastContext.esm.js +5 -0
  171. package/components/toast/context/ToastProvider.esm.js +96 -0
  172. package/components/tooltip/Tooltip.esm.js +175 -0
  173. package/components/upload/Upload.esm.js +1103 -0
  174. package/components/upload/utils/canvasPreview.esm.js +39 -0
  175. package/components/upload/utils/imgPreview.esm.js +21 -0
  176. package/config/stitches.config.esm.js +216 -0
  177. package/editor.esm.js +1 -264
  178. package/hooks/useListOption/useListOption.esm.js +56 -0
  179. package/hooks/useToggle/useToggle.esm.js +8 -0
  180. package/index.esm.js +106 -42293
  181. package/layout/box/Box.esm.js +24 -0
  182. package/layout/flex/Flex.esm.js +135 -0
  183. package/layout/grid/Grid.esm.js +270 -0
  184. package/layout/pageContainer/PageContainer.esm.js +60 -0
  185. package/majoo-provider/MajooProvider.esm.js +42 -0
  186. package/majoo-provider/ThemeProvider.esm.js +41 -0
  187. package/majoo-provider/globalStyles.esm.js +242 -0
  188. package/majoo-provider/styles/modern-normalize.esm.js +95 -0
  189. package/map.esm.js +2 -734
  190. package/package.json +8 -4
  191. package/utils/calendar.esm.js +26 -0
  192. package/utils/element.esm.js +21 -0
  193. package/utils/object.esm.js +12 -0
  194. package/utils/request.esm.js +74 -0
  195. package/utils/strings.esm.js +6 -0
  196. package/{useMediaQuery.esm.js → utils/useMediaQuery.esm.js} +1 -1
  197. package/utils/useNavigatorOnline.esm.js +19 -0
  198. package/utils/variant.esm.js +12 -0
  199. package/wrapper/ConditionalWrapper.esm.js +9 -0
  200. package/ModalDialog.esm.js +0 -2669
  201. package/Separator.esm.js +0 -3002
  202. package/stitches.config.esm.js +0 -2284
  203. package/{index.esm.css → charts.esm.css} +4 -4
@@ -1,2669 +0,0 @@
1
- import { I as getDefaultExportFromCjs, D as defineBuiltIn$1, c as iteratorClose$5, K as wellKnownSymbol$1, O as iteratorsCore, P as createNonEnumerableProperty$1, L as objectCreate, l as internalState, Q as getMethod$1, f as functionCall, b as anObject$4, a as aCallable$2, i as iteratorHelperWithoutClosingOnEarlyError$2, _ as _export, g as getIteratorDirect$3, s as styled, d as iterate$2, C as createProperty$1 } from './stitches.config.esm.js';
2
- import * as React from 'react';
3
- import React__default, { useCallback } from 'react';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
- import { useTranslation } from 'react-i18next';
6
- import * as DialogPrimitive from '@radix-ui/react-dialog';
7
- import { CloseOutline } from '@majoo-ui/icons';
8
- import { useThemeProvider } from '@majoo-ui/helpers';
9
-
10
- var propTypes = {exports: {}};
11
-
12
- var reactIs = {exports: {}};
13
-
14
- var reactIs_production_min = {};
15
-
16
- /** @license React v16.13.1
17
- * react-is.production.min.js
18
- *
19
- * Copyright (c) Facebook, Inc. and its affiliates.
20
- *
21
- * This source code is licensed under the MIT license found in the
22
- * LICENSE file in the root directory of this source tree.
23
- */
24
-
25
- var hasRequiredReactIs_production_min;
26
-
27
- function requireReactIs_production_min () {
28
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
29
- hasRequiredReactIs_production_min = 1;
30
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
31
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
32
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
33
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
34
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
35
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
36
- return reactIs_production_min;
37
- }
38
-
39
- var reactIs_development = {};
40
-
41
- /** @license React v16.13.1
42
- * react-is.development.js
43
- *
44
- * Copyright (c) Facebook, Inc. and its affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */
49
-
50
- var hasRequiredReactIs_development;
51
-
52
- function requireReactIs_development () {
53
- if (hasRequiredReactIs_development) return reactIs_development;
54
- hasRequiredReactIs_development = 1;
55
-
56
-
57
-
58
- if (process.env.NODE_ENV !== "production") {
59
- (function() {
60
-
61
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
62
- // nor polyfill, then a plain number is used for performance.
63
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
64
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
65
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
66
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
67
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
68
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
69
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
70
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
71
- // (unstable) APIs that have been removed. Can we remove the symbols?
72
-
73
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
74
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
75
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
76
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
77
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
78
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
79
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
80
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
81
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
82
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
83
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
84
-
85
- function isValidElementType(type) {
86
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
87
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
88
- }
89
-
90
- function typeOf(object) {
91
- if (typeof object === 'object' && object !== null) {
92
- var $$typeof = object.$$typeof;
93
-
94
- switch ($$typeof) {
95
- case REACT_ELEMENT_TYPE:
96
- var type = object.type;
97
-
98
- switch (type) {
99
- case REACT_ASYNC_MODE_TYPE:
100
- case REACT_CONCURRENT_MODE_TYPE:
101
- case REACT_FRAGMENT_TYPE:
102
- case REACT_PROFILER_TYPE:
103
- case REACT_STRICT_MODE_TYPE:
104
- case REACT_SUSPENSE_TYPE:
105
- return type;
106
-
107
- default:
108
- var $$typeofType = type && type.$$typeof;
109
-
110
- switch ($$typeofType) {
111
- case REACT_CONTEXT_TYPE:
112
- case REACT_FORWARD_REF_TYPE:
113
- case REACT_LAZY_TYPE:
114
- case REACT_MEMO_TYPE:
115
- case REACT_PROVIDER_TYPE:
116
- return $$typeofType;
117
-
118
- default:
119
- return $$typeof;
120
- }
121
-
122
- }
123
-
124
- case REACT_PORTAL_TYPE:
125
- return $$typeof;
126
- }
127
- }
128
-
129
- return undefined;
130
- } // AsyncMode is deprecated along with isAsyncMode
131
-
132
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
133
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
134
- var ContextConsumer = REACT_CONTEXT_TYPE;
135
- var ContextProvider = REACT_PROVIDER_TYPE;
136
- var Element = REACT_ELEMENT_TYPE;
137
- var ForwardRef = REACT_FORWARD_REF_TYPE;
138
- var Fragment = REACT_FRAGMENT_TYPE;
139
- var Lazy = REACT_LAZY_TYPE;
140
- var Memo = REACT_MEMO_TYPE;
141
- var Portal = REACT_PORTAL_TYPE;
142
- var Profiler = REACT_PROFILER_TYPE;
143
- var StrictMode = REACT_STRICT_MODE_TYPE;
144
- var Suspense = REACT_SUSPENSE_TYPE;
145
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
146
-
147
- function isAsyncMode(object) {
148
- {
149
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
150
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
151
-
152
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
153
- }
154
- }
155
-
156
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
157
- }
158
- function isConcurrentMode(object) {
159
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
160
- }
161
- function isContextConsumer(object) {
162
- return typeOf(object) === REACT_CONTEXT_TYPE;
163
- }
164
- function isContextProvider(object) {
165
- return typeOf(object) === REACT_PROVIDER_TYPE;
166
- }
167
- function isElement(object) {
168
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
169
- }
170
- function isForwardRef(object) {
171
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
172
- }
173
- function isFragment(object) {
174
- return typeOf(object) === REACT_FRAGMENT_TYPE;
175
- }
176
- function isLazy(object) {
177
- return typeOf(object) === REACT_LAZY_TYPE;
178
- }
179
- function isMemo(object) {
180
- return typeOf(object) === REACT_MEMO_TYPE;
181
- }
182
- function isPortal(object) {
183
- return typeOf(object) === REACT_PORTAL_TYPE;
184
- }
185
- function isProfiler(object) {
186
- return typeOf(object) === REACT_PROFILER_TYPE;
187
- }
188
- function isStrictMode(object) {
189
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
190
- }
191
- function isSuspense(object) {
192
- return typeOf(object) === REACT_SUSPENSE_TYPE;
193
- }
194
-
195
- reactIs_development.AsyncMode = AsyncMode;
196
- reactIs_development.ConcurrentMode = ConcurrentMode;
197
- reactIs_development.ContextConsumer = ContextConsumer;
198
- reactIs_development.ContextProvider = ContextProvider;
199
- reactIs_development.Element = Element;
200
- reactIs_development.ForwardRef = ForwardRef;
201
- reactIs_development.Fragment = Fragment;
202
- reactIs_development.Lazy = Lazy;
203
- reactIs_development.Memo = Memo;
204
- reactIs_development.Portal = Portal;
205
- reactIs_development.Profiler = Profiler;
206
- reactIs_development.StrictMode = StrictMode;
207
- reactIs_development.Suspense = Suspense;
208
- reactIs_development.isAsyncMode = isAsyncMode;
209
- reactIs_development.isConcurrentMode = isConcurrentMode;
210
- reactIs_development.isContextConsumer = isContextConsumer;
211
- reactIs_development.isContextProvider = isContextProvider;
212
- reactIs_development.isElement = isElement;
213
- reactIs_development.isForwardRef = isForwardRef;
214
- reactIs_development.isFragment = isFragment;
215
- reactIs_development.isLazy = isLazy;
216
- reactIs_development.isMemo = isMemo;
217
- reactIs_development.isPortal = isPortal;
218
- reactIs_development.isProfiler = isProfiler;
219
- reactIs_development.isStrictMode = isStrictMode;
220
- reactIs_development.isSuspense = isSuspense;
221
- reactIs_development.isValidElementType = isValidElementType;
222
- reactIs_development.typeOf = typeOf;
223
- })();
224
- }
225
- return reactIs_development;
226
- }
227
-
228
- var hasRequiredReactIs;
229
-
230
- function requireReactIs () {
231
- if (hasRequiredReactIs) return reactIs.exports;
232
- hasRequiredReactIs = 1;
233
-
234
- if (process.env.NODE_ENV === 'production') {
235
- reactIs.exports = requireReactIs_production_min();
236
- } else {
237
- reactIs.exports = requireReactIs_development();
238
- }
239
- return reactIs.exports;
240
- }
241
-
242
- /*
243
- object-assign
244
- (c) Sindre Sorhus
245
- @license MIT
246
- */
247
-
248
- var objectAssign;
249
- var hasRequiredObjectAssign;
250
-
251
- function requireObjectAssign () {
252
- if (hasRequiredObjectAssign) return objectAssign;
253
- hasRequiredObjectAssign = 1;
254
- /* eslint-disable no-unused-vars */
255
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
256
- var hasOwnProperty = Object.prototype.hasOwnProperty;
257
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
258
-
259
- function toObject(val) {
260
- if (val === null || val === undefined) {
261
- throw new TypeError('Object.assign cannot be called with null or undefined');
262
- }
263
-
264
- return Object(val);
265
- }
266
-
267
- function shouldUseNative() {
268
- try {
269
- if (!Object.assign) {
270
- return false;
271
- }
272
-
273
- // Detect buggy property enumeration order in older V8 versions.
274
-
275
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
276
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
277
- test1[5] = 'de';
278
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
279
- return false;
280
- }
281
-
282
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
283
- var test2 = {};
284
- for (var i = 0; i < 10; i++) {
285
- test2['_' + String.fromCharCode(i)] = i;
286
- }
287
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
288
- return test2[n];
289
- });
290
- if (order2.join('') !== '0123456789') {
291
- return false;
292
- }
293
-
294
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
295
- var test3 = {};
296
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
297
- test3[letter] = letter;
298
- });
299
- if (Object.keys(Object.assign({}, test3)).join('') !==
300
- 'abcdefghijklmnopqrst') {
301
- return false;
302
- }
303
-
304
- return true;
305
- } catch (err) {
306
- // We don't expect any of the above to throw, but better to be safe.
307
- return false;
308
- }
309
- }
310
-
311
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
312
- var from;
313
- var to = toObject(target);
314
- var symbols;
315
-
316
- for (var s = 1; s < arguments.length; s++) {
317
- from = Object(arguments[s]);
318
-
319
- for (var key in from) {
320
- if (hasOwnProperty.call(from, key)) {
321
- to[key] = from[key];
322
- }
323
- }
324
-
325
- if (getOwnPropertySymbols) {
326
- symbols = getOwnPropertySymbols(from);
327
- for (var i = 0; i < symbols.length; i++) {
328
- if (propIsEnumerable.call(from, symbols[i])) {
329
- to[symbols[i]] = from[symbols[i]];
330
- }
331
- }
332
- }
333
- }
334
-
335
- return to;
336
- };
337
- return objectAssign;
338
- }
339
-
340
- /**
341
- * Copyright (c) 2013-present, Facebook, Inc.
342
- *
343
- * This source code is licensed under the MIT license found in the
344
- * LICENSE file in the root directory of this source tree.
345
- */
346
-
347
- var ReactPropTypesSecret_1;
348
- var hasRequiredReactPropTypesSecret;
349
-
350
- function requireReactPropTypesSecret () {
351
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
352
- hasRequiredReactPropTypesSecret = 1;
353
-
354
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
355
-
356
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
357
- return ReactPropTypesSecret_1;
358
- }
359
-
360
- var has;
361
- var hasRequiredHas;
362
-
363
- function requireHas () {
364
- if (hasRequiredHas) return has;
365
- hasRequiredHas = 1;
366
- has = Function.call.bind(Object.prototype.hasOwnProperty);
367
- return has;
368
- }
369
-
370
- /**
371
- * Copyright (c) 2013-present, Facebook, Inc.
372
- *
373
- * This source code is licensed under the MIT license found in the
374
- * LICENSE file in the root directory of this source tree.
375
- */
376
-
377
- var checkPropTypes_1;
378
- var hasRequiredCheckPropTypes;
379
-
380
- function requireCheckPropTypes () {
381
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
382
- hasRequiredCheckPropTypes = 1;
383
-
384
- var printWarning = function() {};
385
-
386
- if (process.env.NODE_ENV !== 'production') {
387
- var ReactPropTypesSecret = requireReactPropTypesSecret();
388
- var loggedTypeFailures = {};
389
- var has = requireHas();
390
-
391
- printWarning = function(text) {
392
- var message = 'Warning: ' + text;
393
- if (typeof console !== 'undefined') {
394
- console.error(message);
395
- }
396
- try {
397
- // --- Welcome to debugging React ---
398
- // This error was thrown as a convenience so that you can use this stack
399
- // to find the callsite that caused this warning to fire.
400
- throw new Error(message);
401
- } catch (x) { /**/ }
402
- };
403
- }
404
-
405
- /**
406
- * Assert that the values match with the type specs.
407
- * Error messages are memorized and will only be shown once.
408
- *
409
- * @param {object} typeSpecs Map of name to a ReactPropType
410
- * @param {object} values Runtime values that need to be type-checked
411
- * @param {string} location e.g. "prop", "context", "child context"
412
- * @param {string} componentName Name of the component for error messages.
413
- * @param {?Function} getStack Returns the component stack.
414
- * @private
415
- */
416
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
417
- if (process.env.NODE_ENV !== 'production') {
418
- for (var typeSpecName in typeSpecs) {
419
- if (has(typeSpecs, typeSpecName)) {
420
- var error;
421
- // Prop type validation may throw. In case they do, we don't want to
422
- // fail the render phase where it didn't fail before. So we log it.
423
- // After these have been cleaned up, we'll let them throw.
424
- try {
425
- // This is intentionally an invariant that gets caught. It's the same
426
- // behavior as without this statement except with a better message.
427
- if (typeof typeSpecs[typeSpecName] !== 'function') {
428
- var err = Error(
429
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
430
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
431
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
432
- );
433
- err.name = 'Invariant Violation';
434
- throw err;
435
- }
436
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
437
- } catch (ex) {
438
- error = ex;
439
- }
440
- if (error && !(error instanceof Error)) {
441
- printWarning(
442
- (componentName || 'React class') + ': type specification of ' +
443
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
444
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
445
- 'You may have forgotten to pass an argument to the type checker ' +
446
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
447
- 'shape all require an argument).'
448
- );
449
- }
450
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
451
- // Only monitor this failure once because there tends to be a lot of the
452
- // same error.
453
- loggedTypeFailures[error.message] = true;
454
-
455
- var stack = getStack ? getStack() : '';
456
-
457
- printWarning(
458
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
459
- );
460
- }
461
- }
462
- }
463
- }
464
- }
465
-
466
- /**
467
- * Resets warning cache when testing.
468
- *
469
- * @private
470
- */
471
- checkPropTypes.resetWarningCache = function() {
472
- if (process.env.NODE_ENV !== 'production') {
473
- loggedTypeFailures = {};
474
- }
475
- };
476
-
477
- checkPropTypes_1 = checkPropTypes;
478
- return checkPropTypes_1;
479
- }
480
-
481
- /**
482
- * Copyright (c) 2013-present, Facebook, Inc.
483
- *
484
- * This source code is licensed under the MIT license found in the
485
- * LICENSE file in the root directory of this source tree.
486
- */
487
-
488
- var factoryWithTypeCheckers;
489
- var hasRequiredFactoryWithTypeCheckers;
490
-
491
- function requireFactoryWithTypeCheckers () {
492
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
493
- hasRequiredFactoryWithTypeCheckers = 1;
494
-
495
- var ReactIs = requireReactIs();
496
- var assign = requireObjectAssign();
497
-
498
- var ReactPropTypesSecret = requireReactPropTypesSecret();
499
- var has = requireHas();
500
- var checkPropTypes = requireCheckPropTypes();
501
-
502
- var printWarning = function() {};
503
-
504
- if (process.env.NODE_ENV !== 'production') {
505
- printWarning = function(text) {
506
- var message = 'Warning: ' + text;
507
- if (typeof console !== 'undefined') {
508
- console.error(message);
509
- }
510
- try {
511
- // --- Welcome to debugging React ---
512
- // This error was thrown as a convenience so that you can use this stack
513
- // to find the callsite that caused this warning to fire.
514
- throw new Error(message);
515
- } catch (x) {}
516
- };
517
- }
518
-
519
- function emptyFunctionThatReturnsNull() {
520
- return null;
521
- }
522
-
523
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
524
- /* global Symbol */
525
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
526
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
527
-
528
- /**
529
- * Returns the iterator method function contained on the iterable object.
530
- *
531
- * Be sure to invoke the function with the iterable as context:
532
- *
533
- * var iteratorFn = getIteratorFn(myIterable);
534
- * if (iteratorFn) {
535
- * var iterator = iteratorFn.call(myIterable);
536
- * ...
537
- * }
538
- *
539
- * @param {?object} maybeIterable
540
- * @return {?function}
541
- */
542
- function getIteratorFn(maybeIterable) {
543
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
544
- if (typeof iteratorFn === 'function') {
545
- return iteratorFn;
546
- }
547
- }
548
-
549
- /**
550
- * Collection of methods that allow declaration and validation of props that are
551
- * supplied to React components. Example usage:
552
- *
553
- * var Props = require('ReactPropTypes');
554
- * var MyArticle = React.createClass({
555
- * propTypes: {
556
- * // An optional string prop named "description".
557
- * description: Props.string,
558
- *
559
- * // A required enum prop named "category".
560
- * category: Props.oneOf(['News','Photos']).isRequired,
561
- *
562
- * // A prop named "dialog" that requires an instance of Dialog.
563
- * dialog: Props.instanceOf(Dialog).isRequired
564
- * },
565
- * render: function() { ... }
566
- * });
567
- *
568
- * A more formal specification of how these methods are used:
569
- *
570
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
571
- * decl := ReactPropTypes.{type}(.isRequired)?
572
- *
573
- * Each and every declaration produces a function with the same signature. This
574
- * allows the creation of custom validation functions. For example:
575
- *
576
- * var MyLink = React.createClass({
577
- * propTypes: {
578
- * // An optional string or URI prop named "href".
579
- * href: function(props, propName, componentName) {
580
- * var propValue = props[propName];
581
- * if (propValue != null && typeof propValue !== 'string' &&
582
- * !(propValue instanceof URI)) {
583
- * return new Error(
584
- * 'Expected a string or an URI for ' + propName + ' in ' +
585
- * componentName
586
- * );
587
- * }
588
- * }
589
- * },
590
- * render: function() {...}
591
- * });
592
- *
593
- * @internal
594
- */
595
-
596
- var ANONYMOUS = '<<anonymous>>';
597
-
598
- // Important!
599
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
600
- var ReactPropTypes = {
601
- array: createPrimitiveTypeChecker('array'),
602
- bigint: createPrimitiveTypeChecker('bigint'),
603
- bool: createPrimitiveTypeChecker('boolean'),
604
- func: createPrimitiveTypeChecker('function'),
605
- number: createPrimitiveTypeChecker('number'),
606
- object: createPrimitiveTypeChecker('object'),
607
- string: createPrimitiveTypeChecker('string'),
608
- symbol: createPrimitiveTypeChecker('symbol'),
609
-
610
- any: createAnyTypeChecker(),
611
- arrayOf: createArrayOfTypeChecker,
612
- element: createElementTypeChecker(),
613
- elementType: createElementTypeTypeChecker(),
614
- instanceOf: createInstanceTypeChecker,
615
- node: createNodeChecker(),
616
- objectOf: createObjectOfTypeChecker,
617
- oneOf: createEnumTypeChecker,
618
- oneOfType: createUnionTypeChecker,
619
- shape: createShapeTypeChecker,
620
- exact: createStrictShapeTypeChecker,
621
- };
622
-
623
- /**
624
- * inlined Object.is polyfill to avoid requiring consumers ship their own
625
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
626
- */
627
- /*eslint-disable no-self-compare*/
628
- function is(x, y) {
629
- // SameValue algorithm
630
- if (x === y) {
631
- // Steps 1-5, 7-10
632
- // Steps 6.b-6.e: +0 != -0
633
- return x !== 0 || 1 / x === 1 / y;
634
- } else {
635
- // Step 6.a: NaN == NaN
636
- return x !== x && y !== y;
637
- }
638
- }
639
- /*eslint-enable no-self-compare*/
640
-
641
- /**
642
- * We use an Error-like object for backward compatibility as people may call
643
- * PropTypes directly and inspect their output. However, we don't use real
644
- * Errors anymore. We don't inspect their stack anyway, and creating them
645
- * is prohibitively expensive if they are created too often, such as what
646
- * happens in oneOfType() for any type before the one that matched.
647
- */
648
- function PropTypeError(message, data) {
649
- this.message = message;
650
- this.data = data && typeof data === 'object' ? data: {};
651
- this.stack = '';
652
- }
653
- // Make `instanceof Error` still work for returned errors.
654
- PropTypeError.prototype = Error.prototype;
655
-
656
- function createChainableTypeChecker(validate) {
657
- if (process.env.NODE_ENV !== 'production') {
658
- var manualPropTypeCallCache = {};
659
- var manualPropTypeWarningCount = 0;
660
- }
661
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
662
- componentName = componentName || ANONYMOUS;
663
- propFullName = propFullName || propName;
664
-
665
- if (secret !== ReactPropTypesSecret) {
666
- if (throwOnDirectAccess) {
667
- // New behavior only for users of `prop-types` package
668
- var err = new Error(
669
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
670
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
671
- 'Read more at http://fb.me/use-check-prop-types'
672
- );
673
- err.name = 'Invariant Violation';
674
- throw err;
675
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
676
- // Old behavior for people using React.PropTypes
677
- var cacheKey = componentName + ':' + propName;
678
- if (
679
- !manualPropTypeCallCache[cacheKey] &&
680
- // Avoid spamming the console because they are often not actionable except for lib authors
681
- manualPropTypeWarningCount < 3
682
- ) {
683
- printWarning(
684
- 'You are manually calling a React.PropTypes validation ' +
685
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
686
- 'and will throw in the standalone `prop-types` package. ' +
687
- 'You may be seeing this warning due to a third-party PropTypes ' +
688
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
689
- );
690
- manualPropTypeCallCache[cacheKey] = true;
691
- manualPropTypeWarningCount++;
692
- }
693
- }
694
- }
695
- if (props[propName] == null) {
696
- if (isRequired) {
697
- if (props[propName] === null) {
698
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
699
- }
700
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
701
- }
702
- return null;
703
- } else {
704
- return validate(props, propName, componentName, location, propFullName);
705
- }
706
- }
707
-
708
- var chainedCheckType = checkType.bind(null, false);
709
- chainedCheckType.isRequired = checkType.bind(null, true);
710
-
711
- return chainedCheckType;
712
- }
713
-
714
- function createPrimitiveTypeChecker(expectedType) {
715
- function validate(props, propName, componentName, location, propFullName, secret) {
716
- var propValue = props[propName];
717
- var propType = getPropType(propValue);
718
- if (propType !== expectedType) {
719
- // `propValue` being instance of, say, date/regexp, pass the 'object'
720
- // check, but we can offer a more precise error message here rather than
721
- // 'of type `object`'.
722
- var preciseType = getPreciseType(propValue);
723
-
724
- return new PropTypeError(
725
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
726
- {expectedType: expectedType}
727
- );
728
- }
729
- return null;
730
- }
731
- return createChainableTypeChecker(validate);
732
- }
733
-
734
- function createAnyTypeChecker() {
735
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
736
- }
737
-
738
- function createArrayOfTypeChecker(typeChecker) {
739
- function validate(props, propName, componentName, location, propFullName) {
740
- if (typeof typeChecker !== 'function') {
741
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
742
- }
743
- var propValue = props[propName];
744
- if (!Array.isArray(propValue)) {
745
- var propType = getPropType(propValue);
746
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
747
- }
748
- for (var i = 0; i < propValue.length; i++) {
749
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
750
- if (error instanceof Error) {
751
- return error;
752
- }
753
- }
754
- return null;
755
- }
756
- return createChainableTypeChecker(validate);
757
- }
758
-
759
- function createElementTypeChecker() {
760
- function validate(props, propName, componentName, location, propFullName) {
761
- var propValue = props[propName];
762
- if (!isValidElement(propValue)) {
763
- var propType = getPropType(propValue);
764
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
765
- }
766
- return null;
767
- }
768
- return createChainableTypeChecker(validate);
769
- }
770
-
771
- function createElementTypeTypeChecker() {
772
- function validate(props, propName, componentName, location, propFullName) {
773
- var propValue = props[propName];
774
- if (!ReactIs.isValidElementType(propValue)) {
775
- var propType = getPropType(propValue);
776
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
777
- }
778
- return null;
779
- }
780
- return createChainableTypeChecker(validate);
781
- }
782
-
783
- function createInstanceTypeChecker(expectedClass) {
784
- function validate(props, propName, componentName, location, propFullName) {
785
- if (!(props[propName] instanceof expectedClass)) {
786
- var expectedClassName = expectedClass.name || ANONYMOUS;
787
- var actualClassName = getClassName(props[propName]);
788
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
789
- }
790
- return null;
791
- }
792
- return createChainableTypeChecker(validate);
793
- }
794
-
795
- function createEnumTypeChecker(expectedValues) {
796
- if (!Array.isArray(expectedValues)) {
797
- if (process.env.NODE_ENV !== 'production') {
798
- if (arguments.length > 1) {
799
- printWarning(
800
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
801
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
802
- );
803
- } else {
804
- printWarning('Invalid argument supplied to oneOf, expected an array.');
805
- }
806
- }
807
- return emptyFunctionThatReturnsNull;
808
- }
809
-
810
- function validate(props, propName, componentName, location, propFullName) {
811
- var propValue = props[propName];
812
- for (var i = 0; i < expectedValues.length; i++) {
813
- if (is(propValue, expectedValues[i])) {
814
- return null;
815
- }
816
- }
817
-
818
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
819
- var type = getPreciseType(value);
820
- if (type === 'symbol') {
821
- return String(value);
822
- }
823
- return value;
824
- });
825
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
826
- }
827
- return createChainableTypeChecker(validate);
828
- }
829
-
830
- function createObjectOfTypeChecker(typeChecker) {
831
- function validate(props, propName, componentName, location, propFullName) {
832
- if (typeof typeChecker !== 'function') {
833
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
834
- }
835
- var propValue = props[propName];
836
- var propType = getPropType(propValue);
837
- if (propType !== 'object') {
838
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
839
- }
840
- for (var key in propValue) {
841
- if (has(propValue, key)) {
842
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
843
- if (error instanceof Error) {
844
- return error;
845
- }
846
- }
847
- }
848
- return null;
849
- }
850
- return createChainableTypeChecker(validate);
851
- }
852
-
853
- function createUnionTypeChecker(arrayOfTypeCheckers) {
854
- if (!Array.isArray(arrayOfTypeCheckers)) {
855
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
856
- return emptyFunctionThatReturnsNull;
857
- }
858
-
859
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
860
- var checker = arrayOfTypeCheckers[i];
861
- if (typeof checker !== 'function') {
862
- printWarning(
863
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
864
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
865
- );
866
- return emptyFunctionThatReturnsNull;
867
- }
868
- }
869
-
870
- function validate(props, propName, componentName, location, propFullName) {
871
- var expectedTypes = [];
872
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
873
- var checker = arrayOfTypeCheckers[i];
874
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
875
- if (checkerResult == null) {
876
- return null;
877
- }
878
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
879
- expectedTypes.push(checkerResult.data.expectedType);
880
- }
881
- }
882
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
883
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
884
- }
885
- return createChainableTypeChecker(validate);
886
- }
887
-
888
- function createNodeChecker() {
889
- function validate(props, propName, componentName, location, propFullName) {
890
- if (!isNode(props[propName])) {
891
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
892
- }
893
- return null;
894
- }
895
- return createChainableTypeChecker(validate);
896
- }
897
-
898
- function invalidValidatorError(componentName, location, propFullName, key, type) {
899
- return new PropTypeError(
900
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
901
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
902
- );
903
- }
904
-
905
- function createShapeTypeChecker(shapeTypes) {
906
- function validate(props, propName, componentName, location, propFullName) {
907
- var propValue = props[propName];
908
- var propType = getPropType(propValue);
909
- if (propType !== 'object') {
910
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
911
- }
912
- for (var key in shapeTypes) {
913
- var checker = shapeTypes[key];
914
- if (typeof checker !== 'function') {
915
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
916
- }
917
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
918
- if (error) {
919
- return error;
920
- }
921
- }
922
- return null;
923
- }
924
- return createChainableTypeChecker(validate);
925
- }
926
-
927
- function createStrictShapeTypeChecker(shapeTypes) {
928
- function validate(props, propName, componentName, location, propFullName) {
929
- var propValue = props[propName];
930
- var propType = getPropType(propValue);
931
- if (propType !== 'object') {
932
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
933
- }
934
- // We need to check all keys in case some are required but missing from props.
935
- var allKeys = assign({}, props[propName], shapeTypes);
936
- for (var key in allKeys) {
937
- var checker = shapeTypes[key];
938
- if (has(shapeTypes, key) && typeof checker !== 'function') {
939
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
940
- }
941
- if (!checker) {
942
- return new PropTypeError(
943
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
944
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
945
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
946
- );
947
- }
948
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
949
- if (error) {
950
- return error;
951
- }
952
- }
953
- return null;
954
- }
955
-
956
- return createChainableTypeChecker(validate);
957
- }
958
-
959
- function isNode(propValue) {
960
- switch (typeof propValue) {
961
- case 'number':
962
- case 'string':
963
- case 'undefined':
964
- return true;
965
- case 'boolean':
966
- return !propValue;
967
- case 'object':
968
- if (Array.isArray(propValue)) {
969
- return propValue.every(isNode);
970
- }
971
- if (propValue === null || isValidElement(propValue)) {
972
- return true;
973
- }
974
-
975
- var iteratorFn = getIteratorFn(propValue);
976
- if (iteratorFn) {
977
- var iterator = iteratorFn.call(propValue);
978
- var step;
979
- if (iteratorFn !== propValue.entries) {
980
- while (!(step = iterator.next()).done) {
981
- if (!isNode(step.value)) {
982
- return false;
983
- }
984
- }
985
- } else {
986
- // Iterator will provide entry [k,v] tuples rather than values.
987
- while (!(step = iterator.next()).done) {
988
- var entry = step.value;
989
- if (entry) {
990
- if (!isNode(entry[1])) {
991
- return false;
992
- }
993
- }
994
- }
995
- }
996
- } else {
997
- return false;
998
- }
999
-
1000
- return true;
1001
- default:
1002
- return false;
1003
- }
1004
- }
1005
-
1006
- function isSymbol(propType, propValue) {
1007
- // Native Symbol.
1008
- if (propType === 'symbol') {
1009
- return true;
1010
- }
1011
-
1012
- // falsy value can't be a Symbol
1013
- if (!propValue) {
1014
- return false;
1015
- }
1016
-
1017
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1018
- if (propValue['@@toStringTag'] === 'Symbol') {
1019
- return true;
1020
- }
1021
-
1022
- // Fallback for non-spec compliant Symbols which are polyfilled.
1023
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1024
- return true;
1025
- }
1026
-
1027
- return false;
1028
- }
1029
-
1030
- // Equivalent of `typeof` but with special handling for array and regexp.
1031
- function getPropType(propValue) {
1032
- var propType = typeof propValue;
1033
- if (Array.isArray(propValue)) {
1034
- return 'array';
1035
- }
1036
- if (propValue instanceof RegExp) {
1037
- // Old webkits (at least until Android 4.0) return 'function' rather than
1038
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1039
- // passes PropTypes.object.
1040
- return 'object';
1041
- }
1042
- if (isSymbol(propType, propValue)) {
1043
- return 'symbol';
1044
- }
1045
- return propType;
1046
- }
1047
-
1048
- // This handles more types than `getPropType`. Only used for error messages.
1049
- // See `createPrimitiveTypeChecker`.
1050
- function getPreciseType(propValue) {
1051
- if (typeof propValue === 'undefined' || propValue === null) {
1052
- return '' + propValue;
1053
- }
1054
- var propType = getPropType(propValue);
1055
- if (propType === 'object') {
1056
- if (propValue instanceof Date) {
1057
- return 'date';
1058
- } else if (propValue instanceof RegExp) {
1059
- return 'regexp';
1060
- }
1061
- }
1062
- return propType;
1063
- }
1064
-
1065
- // Returns a string that is postfixed to a warning about an invalid type.
1066
- // For example, "undefined" or "of type array"
1067
- function getPostfixForTypeWarning(value) {
1068
- var type = getPreciseType(value);
1069
- switch (type) {
1070
- case 'array':
1071
- case 'object':
1072
- return 'an ' + type;
1073
- case 'boolean':
1074
- case 'date':
1075
- case 'regexp':
1076
- return 'a ' + type;
1077
- default:
1078
- return type;
1079
- }
1080
- }
1081
-
1082
- // Returns class name of the object, if any.
1083
- function getClassName(propValue) {
1084
- if (!propValue.constructor || !propValue.constructor.name) {
1085
- return ANONYMOUS;
1086
- }
1087
- return propValue.constructor.name;
1088
- }
1089
-
1090
- ReactPropTypes.checkPropTypes = checkPropTypes;
1091
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1092
- ReactPropTypes.PropTypes = ReactPropTypes;
1093
-
1094
- return ReactPropTypes;
1095
- };
1096
- return factoryWithTypeCheckers;
1097
- }
1098
-
1099
- /**
1100
- * Copyright (c) 2013-present, Facebook, Inc.
1101
- *
1102
- * This source code is licensed under the MIT license found in the
1103
- * LICENSE file in the root directory of this source tree.
1104
- */
1105
-
1106
- var factoryWithThrowingShims;
1107
- var hasRequiredFactoryWithThrowingShims;
1108
-
1109
- function requireFactoryWithThrowingShims () {
1110
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1111
- hasRequiredFactoryWithThrowingShims = 1;
1112
-
1113
- var ReactPropTypesSecret = requireReactPropTypesSecret();
1114
-
1115
- function emptyFunction() {}
1116
- function emptyFunctionWithReset() {}
1117
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
1118
-
1119
- factoryWithThrowingShims = function() {
1120
- function shim(props, propName, componentName, location, propFullName, secret) {
1121
- if (secret === ReactPropTypesSecret) {
1122
- // It is still safe when called from React.
1123
- return;
1124
- }
1125
- var err = new Error(
1126
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1127
- 'Use PropTypes.checkPropTypes() to call them. ' +
1128
- 'Read more at http://fb.me/use-check-prop-types'
1129
- );
1130
- err.name = 'Invariant Violation';
1131
- throw err;
1132
- } shim.isRequired = shim;
1133
- function getShim() {
1134
- return shim;
1135
- } // Important!
1136
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1137
- var ReactPropTypes = {
1138
- array: shim,
1139
- bigint: shim,
1140
- bool: shim,
1141
- func: shim,
1142
- number: shim,
1143
- object: shim,
1144
- string: shim,
1145
- symbol: shim,
1146
-
1147
- any: shim,
1148
- arrayOf: getShim,
1149
- element: shim,
1150
- elementType: shim,
1151
- instanceOf: getShim,
1152
- node: shim,
1153
- objectOf: getShim,
1154
- oneOf: getShim,
1155
- oneOfType: getShim,
1156
- shape: getShim,
1157
- exact: getShim,
1158
-
1159
- checkPropTypes: emptyFunctionWithReset,
1160
- resetWarningCache: emptyFunction
1161
- };
1162
-
1163
- ReactPropTypes.PropTypes = ReactPropTypes;
1164
-
1165
- return ReactPropTypes;
1166
- };
1167
- return factoryWithThrowingShims;
1168
- }
1169
-
1170
- /**
1171
- * Copyright (c) 2013-present, Facebook, Inc.
1172
- *
1173
- * This source code is licensed under the MIT license found in the
1174
- * LICENSE file in the root directory of this source tree.
1175
- */
1176
-
1177
- if (process.env.NODE_ENV !== 'production') {
1178
- var ReactIs = requireReactIs();
1179
-
1180
- // By explicitly using `prop-types` you are opting into new development behavior.
1181
- // http://fb.me/prop-types-in-prod
1182
- var throwOnDirectAccess = true;
1183
- propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1184
- } else {
1185
- // By explicitly using `prop-types` you are opting into new production behavior.
1186
- // http://fb.me/prop-types-in-prod
1187
- propTypes.exports = requireFactoryWithThrowingShims()();
1188
- }
1189
-
1190
- var propTypesExports = propTypes.exports;
1191
- var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
1192
-
1193
- var defineBuiltIn = defineBuiltIn$1;
1194
-
1195
- var defineBuiltIns$1 = function (target, src, options) {
1196
- for (var key in src) defineBuiltIn(target, key, src[key], options);
1197
- return target;
1198
- };
1199
-
1200
- // `CreateIterResultObject` abstract operation
1201
- // https://tc39.es/ecma262/#sec-createiterresultobject
1202
- var createIterResultObject$1 = function (value, done) {
1203
- return { value: value, done: done };
1204
- };
1205
-
1206
- var iteratorClose$4 = iteratorClose$5;
1207
-
1208
- var iteratorCloseAll$1 = function (iters, kind, value) {
1209
- for (var i = iters.length - 1; i >= 0; i--) {
1210
- if (iters[i] === undefined) continue;
1211
- try {
1212
- value = iteratorClose$4(iters[i].iterator, kind, value);
1213
- } catch (error) {
1214
- kind = 'throw';
1215
- value = error;
1216
- }
1217
- }
1218
- if (kind === 'throw') throw value;
1219
- return value;
1220
- };
1221
-
1222
- var call$2 = functionCall;
1223
- var create = objectCreate;
1224
- var createNonEnumerableProperty = createNonEnumerableProperty$1;
1225
- var defineBuiltIns = defineBuiltIns$1;
1226
- var wellKnownSymbol = wellKnownSymbol$1;
1227
- var InternalStateModule = internalState;
1228
- var getMethod = getMethod$1;
1229
- var IteratorPrototype = iteratorsCore.IteratorPrototype;
1230
- var createIterResultObject = createIterResultObject$1;
1231
- var iteratorClose$3 = iteratorClose$5;
1232
- var iteratorCloseAll = iteratorCloseAll$1;
1233
-
1234
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1235
- var ITERATOR_HELPER = 'IteratorHelper';
1236
- var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
1237
- var NORMAL = 'normal';
1238
- var THROW = 'throw';
1239
- var setInternalState = InternalStateModule.set;
1240
-
1241
- var createIteratorProxyPrototype = function (IS_ITERATOR) {
1242
- var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
1243
-
1244
- return defineBuiltIns(create(IteratorPrototype), {
1245
- next: function next() {
1246
- var state = getInternalState(this);
1247
- // for simplification:
1248
- // for `%WrapForValidIteratorPrototype%.next` or with `state.returnHandlerResult` our `nextHandler` returns `IterResultObject`
1249
- // for `%IteratorHelperPrototype%.next` - just a value
1250
- if (IS_ITERATOR) return state.nextHandler();
1251
- if (state.done) return createIterResultObject(undefined, true);
1252
- try {
1253
- var result = state.nextHandler();
1254
- return state.returnHandlerResult ? result : createIterResultObject(result, state.done);
1255
- } catch (error) {
1256
- state.done = true;
1257
- throw error;
1258
- }
1259
- },
1260
- 'return': function () {
1261
- var state = getInternalState(this);
1262
- var iterator = state.iterator;
1263
- var done = state.done;
1264
- state.done = true;
1265
- if (IS_ITERATOR) {
1266
- var returnMethod = getMethod(iterator, 'return');
1267
- return returnMethod ? call$2(returnMethod, iterator) : createIterResultObject(undefined, true);
1268
- }
1269
- if (done) return createIterResultObject(undefined, true);
1270
- if (state.inner) try {
1271
- iteratorClose$3(state.inner.iterator, NORMAL);
1272
- } catch (error) {
1273
- return iteratorClose$3(iterator, THROW, error);
1274
- }
1275
- if (state.openIters) try {
1276
- iteratorCloseAll(state.openIters, NORMAL);
1277
- } catch (error) {
1278
- if (iterator) return iteratorClose$3(iterator, THROW, error);
1279
- throw error;
1280
- }
1281
- if (iterator) iteratorClose$3(iterator, NORMAL);
1282
- return createIterResultObject(undefined, true);
1283
- }
1284
- });
1285
- };
1286
-
1287
- var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
1288
- var IteratorHelperPrototype = createIteratorProxyPrototype(false);
1289
-
1290
- createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
1291
-
1292
- var iteratorCreateProxy = function (nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {
1293
- var IteratorProxy = function Iterator(record, state) {
1294
- if (state) {
1295
- state.iterator = record.iterator;
1296
- state.next = record.next;
1297
- } else state = record;
1298
- state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
1299
- state.returnHandlerResult = !!RETURN_HANDLER_RESULT;
1300
- state.nextHandler = nextHandler;
1301
- state.counter = 0;
1302
- state.done = false;
1303
- setInternalState(this, state);
1304
- };
1305
-
1306
- IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
1307
-
1308
- return IteratorProxy;
1309
- };
1310
-
1311
- var anObject$3 = anObject$4;
1312
- var iteratorClose$2 = iteratorClose$5;
1313
-
1314
- // call something on iterator step with safe closing on error
1315
- var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
1316
- try {
1317
- return ENTRIES ? fn(anObject$3(value)[0], value[1]) : fn(value);
1318
- } catch (error) {
1319
- iteratorClose$2(iterator, 'throw', error);
1320
- }
1321
- };
1322
-
1323
- // Should throw an error on invalid iterator
1324
- // https://issues.chromium.org/issues/336839115
1325
- var iteratorHelperThrowsOnInvalidIterator$1 = function (methodName, argument) {
1326
- // eslint-disable-next-line es/no-iterator -- required for testing
1327
- var method = typeof Iterator == 'function' && Iterator.prototype[methodName];
1328
- if (method) try {
1329
- method.call({ next: null }, argument).next();
1330
- } catch (error) {
1331
- return true;
1332
- }
1333
- };
1334
-
1335
- var $$2 = _export;
1336
- var call$1 = functionCall;
1337
- var aCallable$1 = aCallable$2;
1338
- var anObject$2 = anObject$4;
1339
- var getIteratorDirect$2 = getIteratorDirect$3;
1340
- var createIteratorProxy = iteratorCreateProxy;
1341
- var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
1342
- var iteratorClose$1 = iteratorClose$5;
1343
- var iteratorHelperThrowsOnInvalidIterator = iteratorHelperThrowsOnInvalidIterator$1;
1344
- var iteratorHelperWithoutClosingOnEarlyError$1 = iteratorHelperWithoutClosingOnEarlyError$2;
1345
-
1346
- var MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !iteratorHelperThrowsOnInvalidIterator('map', function () { /* empty */ });
1347
- var mapWithoutClosingOnEarlyError = !MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR
1348
- && iteratorHelperWithoutClosingOnEarlyError$1('map', TypeError);
1349
-
1350
- var FORCED = MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || mapWithoutClosingOnEarlyError;
1351
-
1352
- var IteratorProxy = createIteratorProxy(function () {
1353
- var iterator = this.iterator;
1354
- var result = anObject$2(call$1(this.next, iterator));
1355
- var done = this.done = !!result.done;
1356
- if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
1357
- });
1358
-
1359
- // `Iterator.prototype.map` method
1360
- // https://tc39.es/ecma262/#sec-iterator.prototype.map
1361
- $$2({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
1362
- map: function map(mapper) {
1363
- anObject$2(this);
1364
- try {
1365
- aCallable$1(mapper);
1366
- } catch (error) {
1367
- iteratorClose$1(this, 'throw', error);
1368
- }
1369
-
1370
- if (mapWithoutClosingOnEarlyError) return call$1(mapWithoutClosingOnEarlyError, this, mapper);
1371
-
1372
- return new IteratorProxy(getIteratorDirect$2(this), {
1373
- mapper: mapper
1374
- });
1375
- }
1376
- });
1377
-
1378
- const Box = styled('div', {
1379
- variants: {
1380
- mobileOnly: {
1381
- true: {
1382
- '@lg': {
1383
- display: 'none !important'
1384
- }
1385
- }
1386
- },
1387
- desktopOnly: {
1388
- true: {
1389
- display: 'none !important',
1390
- '@lg': {
1391
- display: 'inherit !important'
1392
- }
1393
- }
1394
- }
1395
- }
1396
- });
1397
- Box.displayName = 'Box';
1398
-
1399
- function seqNumberVariants(variantFn, max) {
1400
- var _a;
1401
- let variants = {};
1402
- for (let i = 1; (_a = i <= max) !== null && _a !== void 0 ? _a : 100; i++) {
1403
- variants = Object.assign(Object.assign({}, variants), {
1404
- [i]: variantFn(i)
1405
- });
1406
- }
1407
- return variants;
1408
- }
1409
-
1410
- const Flex = styled('div', {
1411
- display: 'flex',
1412
- variants: {
1413
- direction: {
1414
- row: {
1415
- flexDirection: 'row'
1416
- },
1417
- column: {
1418
- flexDirection: 'column'
1419
- },
1420
- rowReverse: {
1421
- flexDirection: 'row-reverse'
1422
- },
1423
- columnReverse: {
1424
- flexDirection: 'column-reverse'
1425
- }
1426
- },
1427
- align: {
1428
- start: {
1429
- alignItems: 'flex-start'
1430
- },
1431
- center: {
1432
- alignItems: 'center'
1433
- },
1434
- end: {
1435
- alignItems: 'flex-end'
1436
- },
1437
- stretch: {
1438
- alignItems: 'stretch'
1439
- },
1440
- baseline: {
1441
- alignItems: 'baseline'
1442
- }
1443
- },
1444
- justify: {
1445
- start: {
1446
- justifyContent: 'flex-start'
1447
- },
1448
- center: {
1449
- justifyContent: 'center'
1450
- },
1451
- end: {
1452
- justifyContent: 'flex-end'
1453
- },
1454
- between: {
1455
- justifyContent: 'space-between'
1456
- },
1457
- evenly: {
1458
- justifyContent: 'space-evenly'
1459
- },
1460
- around: {
1461
- justifyContent: 'space-around'
1462
- }
1463
- },
1464
- wrap: {
1465
- noWrap: {
1466
- flexWrap: 'nowrap'
1467
- },
1468
- wrap: {
1469
- flexWrap: 'wrap'
1470
- },
1471
- wrapReverse: {
1472
- flexWrap: 'wrap-reverse'
1473
- }
1474
- },
1475
- gap: seqNumberVariants(value => ({
1476
- gap: `$spacing-${value < 10 ? '0' + value : value}`
1477
- }), 12),
1478
- m: seqNumberVariants(value => ({
1479
- m: `$spacing-${value < 10 ? '0' + value : value}`
1480
- }), 12),
1481
- mt: seqNumberVariants(value => ({
1482
- mt: `$spacing-${value < 10 ? '0' + value : value}`
1483
- }), 12),
1484
- mb: seqNumberVariants(value => ({
1485
- mb: `$spacing-${value < 10 ? '0' + value : value}`
1486
- }), 12),
1487
- mr: seqNumberVariants(value => ({
1488
- mr: `$spacing-${value < 10 ? '0' + value : value}`
1489
- }), 12),
1490
- ml: seqNumberVariants(value => ({
1491
- ml: `$spacing-${value < 10 ? '0' + value : value}`
1492
- }), 12),
1493
- mx: seqNumberVariants(value => ({
1494
- mx: `$spacing-${value < 10 ? '0' + value : value}`
1495
- }), 12),
1496
- my: seqNumberVariants(value => ({
1497
- my: `$spacing-${value < 10 ? '0' + value : value}`
1498
- }), 12),
1499
- mobileOnly: {
1500
- true: {
1501
- '@lg': {
1502
- display: 'none !important'
1503
- }
1504
- }
1505
- },
1506
- desktopOnly: {
1507
- true: {
1508
- display: 'none !important',
1509
- '@lg': {
1510
- display: 'flex !important'
1511
- }
1512
- }
1513
- }
1514
- }
1515
- });
1516
- Flex.propTypes = {
1517
- direction: PropTypes.string,
1518
- align: PropTypes.string,
1519
- justify: PropTypes.string,
1520
- wrap: PropTypes.string,
1521
- gap: PropTypes.number,
1522
- m: PropTypes.number,
1523
- mt: PropTypes.number,
1524
- mb: PropTypes.number,
1525
- mr: PropTypes.number,
1526
- ml: PropTypes.number,
1527
- mx: PropTypes.number,
1528
- my: PropTypes.number
1529
- };
1530
- Flex.defaultProps = {
1531
- direction: 'row',
1532
- align: 'stretch',
1533
- justify: 'start',
1534
- wrap: 'noWrap',
1535
- gap: 0
1536
- };
1537
- Flex.displayName = 'Flex';
1538
-
1539
- const Text = styled('p', {
1540
- margin: 0,
1541
- // padding: 0,
1542
- variants: {
1543
- variant: {
1544
- link: {
1545
- fontSize: '$link',
1546
- lineHeight: '$link',
1547
- letterSpacing: '$link',
1548
- fontWeight: '400'
1549
- },
1550
- contentButton: {
1551
- fontSize: '$content-button',
1552
- lineHeight: '$content-button',
1553
- letterSpacing: '$content-button',
1554
- fontWeight: '600'
1555
- },
1556
- placeholder: {
1557
- fontSize: '$placeholder',
1558
- lineHeight: '$placeholder',
1559
- letterSpacing: '$placeholder',
1560
- fontWeight: '400'
1561
- },
1562
- breadcrumb: {
1563
- fontSize: '$breadcrumb',
1564
- lineHeight: '$breadcrumb',
1565
- letterSpacing: '$breadcrumb',
1566
- fontWeight: '500'
1567
- },
1568
- label: {
1569
- fontSize: '$label',
1570
- lineHeight: '$label',
1571
- letterSpacing: '$label',
1572
- fontWeight: '500'
1573
- },
1574
- status: {
1575
- fontSize: '$status',
1576
- lineHeight: '$status',
1577
- letterSpacing: '$status',
1578
- fontWeight: '600'
1579
- },
1580
- helper: {
1581
- fontSize: '$helper',
1582
- lineHeight: '$helper',
1583
- letterSpacing: '$helper',
1584
- fontWeight: '400'
1585
- },
1586
- caption: {
1587
- fontSize: '$caption',
1588
- lineHeight: '$caption',
1589
- letterSpacing: '$caption',
1590
- fontWeight: '400'
1591
- }
1592
- },
1593
- color: {
1594
- primary: {
1595
- color: '$textPrimary'
1596
- },
1597
- secondary: {
1598
- color: '$textSecondary'
1599
- },
1600
- disable: {
1601
- color: '$textDisable'
1602
- },
1603
- green: {
1604
- color: '$textGreen'
1605
- },
1606
- red: {
1607
- color: '$textRed'
1608
- },
1609
- white: {
1610
- color: '$textWhite'
1611
- },
1612
- brand: {
1613
- color: '$textBrand'
1614
- }
1615
- },
1616
- uppercase: {
1617
- true: {
1618
- textTransform: 'uppercase'
1619
- }
1620
- },
1621
- isTruncated: {
1622
- true: {
1623
- textOverflow: 'ellipsis',
1624
- overflow: 'hidden',
1625
- whiteSpace: 'nowrap'
1626
- }
1627
- },
1628
- align: {
1629
- justify: {
1630
- textAlign: 'justify'
1631
- },
1632
- center: {
1633
- textAlign: 'center'
1634
- },
1635
- right: {
1636
- textAlign: 'right'
1637
- },
1638
- left: {
1639
- textAlign: 'left'
1640
- }
1641
- },
1642
- mobileOnly: {
1643
- true: {
1644
- '@lg': {
1645
- display: 'none !important'
1646
- }
1647
- }
1648
- },
1649
- desktopOnly: {
1650
- true: {
1651
- display: 'none !important',
1652
- '@lg': {
1653
- display: 'block !important'
1654
- }
1655
- }
1656
- }
1657
- },
1658
- defaultVariants: {
1659
- as: 'p',
1660
- align: 'left'
1661
- }
1662
- });
1663
- const TextVariantsEnum = ['link', 'contentButton', 'placeholder', 'breadcrumb', 'label', 'status', 'helper', 'caption'];
1664
- Text.propTypes = {
1665
- variant: PropTypes.oneOf(TextVariantsEnum),
1666
- uppercase: PropTypes.bool,
1667
- isTruncated: PropTypes.bool
1668
- };
1669
- Text.defaultProps = {
1670
- as: 'p'
1671
- };
1672
- Text.displayName = 'Text';
1673
-
1674
- const Heading = styled(Text, {
1675
- variants: {
1676
- heading: {
1677
- h1: {
1678
- fontSize: '$heading-1',
1679
- lineHeight: '$heading-1',
1680
- letterSpacing: '$heading-1',
1681
- fontWeight: 'bold'
1682
- },
1683
- h2: {
1684
- fontSize: '$heading-2',
1685
- lineHeight: '$heading-2',
1686
- letterSpacing: '$heading-2',
1687
- fontWeight: '600'
1688
- },
1689
- h3: {
1690
- fontSize: '$heading-3',
1691
- lineHeight: '$heading-3',
1692
- letterSpacing: '$heading-3',
1693
- fontWeight: '600'
1694
- },
1695
- pageTitle: {
1696
- fontSize: '$page-title-2',
1697
- lineHeight: '$page-title',
1698
- letterSpacing: '$page-title',
1699
- fontWeight: '600'
1700
- },
1701
- sectionTitle: {
1702
- fontSize: '$section-title',
1703
- lineHeight: '$section-title',
1704
- letterSpacing: '$section-title',
1705
- fontWeight: '600'
1706
- },
1707
- sectionSubTitle: {
1708
- fontSize: '$section-sub-title',
1709
- lineHeight: '$section-sub-title',
1710
- letterSpacing: '$section-sub-title',
1711
- fontWeight: '600'
1712
- },
1713
- headerTabs: {
1714
- fontSize: '$header-tabs',
1715
- lineHeight: '$header-tabs',
1716
- letterSpacing: '$header-tabs',
1717
- fontWeight: '500'
1718
- },
1719
- headerTable: {
1720
- fontSize: '$header-table',
1721
- lineHeight: '$header-table',
1722
- letterSpacing: '$header-table',
1723
- fontWeight: '600'
1724
- }
1725
- }
1726
- }
1727
- });
1728
- Heading.defaultProps = {
1729
- color: 'primary',
1730
- heading: 'h1'
1731
- };
1732
- Heading.displayName = 'Heading';
1733
-
1734
- const Paragraph = styled(Text, {
1735
- variants: {
1736
- paragraph: {
1737
- shortContentBold: {
1738
- fontSize: '$short-content-bold',
1739
- lineHeight: '$short-content-bold',
1740
- letterSpacing: '$short-content-bold',
1741
- fontWeight: '600'
1742
- },
1743
- shortContentRegular: {
1744
- fontSize: '$short-content-regular',
1745
- lineHeight: '$short-content-regular',
1746
- letterSpacing: '$short-content-regular',
1747
- fontWeight: '400'
1748
- },
1749
- longContentRegular: {
1750
- fontSize: '$long-content-regular',
1751
- lineHeight: '$long-content-regular',
1752
- letterSpacing: '$long-content-regular',
1753
- fontWeight: '400'
1754
- }
1755
- },
1756
- maxLine: seqNumberVariants(value => ({
1757
- '-webkit-line-clamp': `${value}`,
1758
- display: '-webkit-box',
1759
- '-webkit-box-orient': 'vertical',
1760
- overflow: 'hidden'
1761
- }), 10)
1762
- },
1763
- defaultVariants: {
1764
- paragraph: 'shortContentRegular',
1765
- as: 'p'
1766
- }
1767
- });
1768
- Paragraph.propTypes = {
1769
- paragraph: PropTypes.oneOf(['shortContentBold', 'shortContentRegular', 'longContentRegular']),
1770
- uppercase: PropTypes.bool,
1771
- isTruncated: PropTypes.bool
1772
- };
1773
- Paragraph.defaultProps = {
1774
- paragraph: 'shortContentRegular',
1775
- as: 'p'
1776
- };
1777
- Paragraph.displayName = 'Paragraph';
1778
-
1779
- /******************************************************************************
1780
- Copyright (c) Microsoft Corporation.
1781
-
1782
- Permission to use, copy, modify, and/or distribute this software for any
1783
- purpose with or without fee is hereby granted.
1784
-
1785
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
1786
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
1787
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
1788
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
1789
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1790
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1791
- PERFORMANCE OF THIS SOFTWARE.
1792
- ***************************************************************************** */
1793
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
1794
-
1795
-
1796
- function __rest(s, e) {
1797
- var t = {};
1798
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
1799
- t[p] = s[p];
1800
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
1801
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1802
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
1803
- t[p[i]] = s[p[i]];
1804
- }
1805
- return t;
1806
- }
1807
-
1808
- function __awaiter(thisArg, _arguments, P, generator) {
1809
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1810
- return new (P || (P = Promise))(function (resolve, reject) {
1811
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
1812
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
1813
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
1814
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1815
- });
1816
- }
1817
-
1818
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
1819
- var e = new Error(message);
1820
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1821
- };
1822
-
1823
- const ButtonPrimary = {
1824
- backgroundColor: '$btnPrimary',
1825
- color: '$textWhite',
1826
- border: 'none',
1827
- '&:hover': {
1828
- backgroundColor: '$btnHoverPrimary'
1829
- },
1830
- '&:active': {
1831
- backgroundColor: '$btnActivePrimary'
1832
- }
1833
- };
1834
- const PrimarySecondary = {
1835
- backgroundColor: '$btnSecondary',
1836
- border: '1px solid $btnPrimary',
1837
- color: '$textBrand',
1838
- '&:hover': {
1839
- backgroundColor: '$btnHoverSecondary',
1840
- border: '1px solid $btnPrimary',
1841
- color: '$textBrand'
1842
- },
1843
- '&:active': {
1844
- backgroundColor: '$btnActiveSecondary',
1845
- border: '1px solid $btnPrimary'
1846
- }
1847
- };
1848
- const GhostButton = {
1849
- backgroundColor: '$btnSecondary',
1850
- color: '$textBrand',
1851
- border: 'none',
1852
- '&:focus': {
1853
- outline: 'none'
1854
- },
1855
- '&:hover': {
1856
- backgroundColor: '$btnHoverSecondary',
1857
- outline: '1px solid $btnHoverSecondary',
1858
- color: '$textBrand'
1859
- },
1860
- '&:active': {
1861
- backgroundColor: '$btnActiveSecondary',
1862
- outline: '1px solid $btnPrimary'
1863
- }
1864
- };
1865
- const ButtonNegative = {
1866
- backgroundColor: '$btnNegative',
1867
- color: '$textWhite',
1868
- border: 'none',
1869
- '&:hover': {
1870
- backgroundColor: '$btnHoverNegative'
1871
- },
1872
- '&:active': {
1873
- backgroundColor: '$btnActiveNegative'
1874
- }
1875
- };
1876
- const ButtonNegativeSecondary = {
1877
- backgroundColor: '$bgWhite',
1878
- border: '1px solid $btnNegative',
1879
- color: '$textRed',
1880
- '&:hover': {
1881
- backgroundColor: '$btnHoverNegativeSecondary',
1882
- border: '1px solid $textRed'
1883
- },
1884
- '&:active': {
1885
- backgroundColor: '$btnActiveNegativeSecondary',
1886
- border: '1px solid $textRed'
1887
- }
1888
- };
1889
- const ButtonNegativeGhost = {
1890
- backgroundColor: '$btnSecondary',
1891
- color: '$textRed',
1892
- border: 'none',
1893
- '&:hover': {
1894
- backgroundColor: '$btnHoverNegativeSecondary',
1895
- outline: '1px solid $btnHoverNegativeSecondary',
1896
- color: '$textRed'
1897
- },
1898
- '&:active': {
1899
- backgroundColor: '$btnActiveNegativeSecondary',
1900
- outline: '1px solid $btnNegative'
1901
- }
1902
- };
1903
- const ButtonGhostSecondary = {
1904
- backgroundColor: '$btnSecondary',
1905
- color: '$textSecondary',
1906
- border: 'none',
1907
- '&:hover': {
1908
- backgroundColor: '$gray100',
1909
- outline: '1px solid $gray100',
1910
- color: '$textSecondary'
1911
- },
1912
- '&:active': {
1913
- backgroundColor: '$gray150',
1914
- outline: '1px solid $gray150'
1915
- }
1916
- };
1917
- const ButtonHeaderMenu = {
1918
- backgroundColor: '$bgWhite',
1919
- border: '1px solid $bgBorder',
1920
- color: '$textPrimary',
1921
- '&:hover': {
1922
- backgroundColor: '$gray50',
1923
- border: '1px solid $bgBorder',
1924
- color: '$textPrimary'
1925
- },
1926
- '&:active': {
1927
- backgroundColor: '$gray50'
1928
- }
1929
- };
1930
- const ButtonTableMenu = {
1931
- backgroundColor: '$bgWhite',
1932
- color: '$textPrimary',
1933
- padding: '$spacing-04 $spacing-05',
1934
- width: '180px',
1935
- textAlign: 'left',
1936
- border: 'none',
1937
- borderRadius: 0,
1938
- '&:focus': {
1939
- outline: 'none'
1940
- },
1941
- '&:hover': {
1942
- backgroundColor: '$gray50'
1943
- },
1944
- '&:active': {
1945
- backgroundColor: '$gray100'
1946
- }
1947
- };
1948
- const StyledIcon = styled('div', {
1949
- display: 'inline-flex',
1950
- justifyContent: 'center',
1951
- alignItems: 'center',
1952
- '& svg': {
1953
- verticalAlign: 'middle'
1954
- }
1955
- });
1956
- const StyledIconLeft = styled('div', {
1957
- marginRight: '$spacing-03',
1958
- display: 'inline-flex',
1959
- justifyContent: 'center',
1960
- alignItems: 'center'
1961
- });
1962
- const StyledIconRight = styled('div', {
1963
- marginLeft: '$spacing-03',
1964
- display: 'inline-flex',
1965
- justifyContent: 'center',
1966
- alignItems: 'center'
1967
- });
1968
- const ButtonPrimitive = styled('button', {
1969
- margin: 0,
1970
- display: 'block',
1971
- verticalAlign: 'middle',
1972
- fontWeight: 600,
1973
- width: 'auto',
1974
- height: '40px',
1975
- userSelect: 'none',
1976
- borderRadius: '$md',
1977
- cursor: 'pointer',
1978
- fontSize: '14px',
1979
- textAlign: 'center',
1980
- lineHeight: '20px',
1981
- position: 'relative',
1982
- whiteSpace: 'nowrap',
1983
- '&:focus': {
1984
- outline: '2px solid $borderFocus'
1985
- },
1986
- '&:disabled': {
1987
- border: '1px solid $btnDisable',
1988
- backgroundColor: '$btnDisable',
1989
- color: '$textDisable',
1990
- cursor: 'not-allowed',
1991
- '&:hover': {
1992
- backgroundColor: '$btnDisable',
1993
- border: '1px solid $btnDisable',
1994
- color: '$textDisable'
1995
- },
1996
- '&:active': {
1997
- backgroundColor: '$btnDisable',
1998
- border: '1px solid $btnDisable'
1999
- }
2000
- },
2001
- variants: {
2002
- /**
2003
- * Specify the button type
2004
- */
2005
- buttonType: {
2006
- primary: Object.assign({}, ButtonPrimary),
2007
- secondary: Object.assign({}, PrimarySecondary),
2008
- ghost: Object.assign({}, GhostButton),
2009
- 'ghost-secondary': Object.assign({}, ButtonGhostSecondary),
2010
- negative: Object.assign({}, ButtonNegative),
2011
- 'negative-secondary': Object.assign({}, ButtonNegativeSecondary),
2012
- 'negative-ghost': Object.assign({}, ButtonNegativeGhost),
2013
- headerMenu: Object.assign({}, ButtonHeaderMenu),
2014
- tableMenu: Object.assign({}, ButtonTableMenu)
2015
- },
2016
- /**
2017
- * Specify the button size
2018
- */
2019
- size: {
2020
- xs: {
2021
- minWidth: '70px',
2022
- height: '28px',
2023
- padding: '1px 12px'
2024
- // padding: '4px 12px',
2025
- },
2026
- sm: {
2027
- minWidth: '70px',
2028
- height: '32px',
2029
- padding: '3px 12px'
2030
- // padding: '6px 12px',
2031
- },
2032
- md: {
2033
- minWidth: '70px',
2034
- height: '40px',
2035
- padding: '7px 12px'
2036
- // padding: '10px 12px',
2037
- },
2038
- lg: {
2039
- minWidth: '84px',
2040
- height: '48px',
2041
- padding: '11px 16px'
2042
- // padding: '14px 16px',
2043
- }
2044
- },
2045
- /**
2046
- * Specify the button icon size
2047
- */
2048
- iconSize: {
2049
- xs: {
2050
- minWidth: '28px',
2051
- height: '28px',
2052
- padding: '3px',
2053
- borderRadius: '$md'
2054
- },
2055
- sm: {
2056
- minWidth: '32px',
2057
- height: '32px',
2058
- padding: '5px',
2059
- borderRadius: '$md'
2060
- },
2061
- md: {
2062
- minWidth: '40px',
2063
- height: '40px',
2064
- padding: '7px',
2065
- borderRadius: '$md'
2066
- },
2067
- lg: {
2068
- minWidth: '48px',
2069
- height: '48px',
2070
- padding: '11px',
2071
- borderRadius: '$md'
2072
- }
2073
- },
2074
- /**
2075
- * Hidden the button
2076
- */
2077
- hidden: {
2078
- true: {
2079
- display: 'none'
2080
- }
2081
- },
2082
- withIcon: {
2083
- true: {
2084
- display: 'inline-flex',
2085
- flexDirection: 'row',
2086
- alignItems: 'center',
2087
- justifyContent: 'center'
2088
- }
2089
- },
2090
- mobileOnly: {
2091
- true: {
2092
- '@md': {
2093
- display: 'none !important'
2094
- }
2095
- }
2096
- },
2097
- desktopOnly: {
2098
- true: {
2099
- display: 'none !important',
2100
- '@md': {
2101
- display: 'inherit !important'
2102
- }
2103
- }
2104
- }
2105
- }
2106
- });
2107
- const Button = /*#__PURE__*/React.forwardRef((_a, forwardedRef) => {
2108
- var {
2109
- children,
2110
- type,
2111
- buttonType = 'primary',
2112
- size = 'md',
2113
- disabled = false,
2114
- block = false,
2115
- width,
2116
- leftIcon,
2117
- rightIcon,
2118
- icon = false,
2119
- iconSize,
2120
- mobileOnly,
2121
- desktopOnly
2122
- } = _a,
2123
- props = __rest(_a, ["children", "type", "buttonType", "size", "disabled", "block", "width", "leftIcon", "rightIcon", "icon", "iconSize", "mobileOnly", "desktopOnly"]);
2124
- return jsxs(ButtonPrimitive, Object.assign({
2125
- type: type,
2126
- buttonType: buttonType,
2127
- size: size,
2128
- withIcon: Boolean(icon || leftIcon || rightIcon),
2129
- iconSize: icon ? size : undefined,
2130
- disabled: disabled,
2131
- mobileOnly: mobileOnly,
2132
- desktopOnly: desktopOnly,
2133
- css: Object.assign(Object.assign({}, props.css), {
2134
- width: block ? '100%' : width
2135
- }),
2136
- ref: forwardedRef
2137
- }, props, {
2138
- children: [leftIcon && jsx(StyledIconLeft, {
2139
- children: leftIcon
2140
- }), icon ? jsx(StyledIcon, {
2141
- children: children
2142
- }) : children, rightIcon && jsx(StyledIconRight, {
2143
- children: rightIcon
2144
- })]
2145
- }));
2146
- });
2147
-
2148
- const ContainerFallback = styled(Flex, {
2149
- boxSizing: 'border-box',
2150
- border: '2px dashed #C0C4C4',
2151
- borderRadius: 8,
2152
- backgroundColor: '$gray50',
2153
- height: 120,
2154
- width: 188,
2155
- variants: {
2156
- rounded: {
2157
- true: {
2158
- borderRadius: '100%'
2159
- }
2160
- }
2161
- }
2162
- });
2163
- const TextFallback = styled('p', {
2164
- fontSize: 12,
2165
- fontWeight: 400,
2166
- fontStyle: 'normal',
2167
- textAlign: 'center',
2168
- color: '$textDisable'
2169
- });
2170
- const StyledImage = styled('img', {
2171
- display: 'inline-block',
2172
- alignItems: 'center',
2173
- justifyContent: 'center',
2174
- variants: {
2175
- rounded: {
2176
- true: {
2177
- borderRadius: '100%'
2178
- }
2179
- }
2180
- }
2181
- });
2182
- function Image({
2183
- className,
2184
- src,
2185
- alt,
2186
- width,
2187
- height,
2188
- objectFit,
2189
- fallback,
2190
- fallbackTitle,
2191
- css,
2192
- cssFallback,
2193
- rounded,
2194
- ...props
2195
- }) {
2196
- const {
2197
- t
2198
- } = useTranslation('translation');
2199
- if (src || fallback) {
2200
- return /*#__PURE__*/jsx(StyledImage, {
2201
- className: className,
2202
- src: src,
2203
- alt: alt,
2204
- width: width,
2205
- height: height,
2206
- srcSet: fallback,
2207
- rounded: rounded,
2208
- css: {
2209
- objectFit: objectFit,
2210
- ...css
2211
- },
2212
- ...props
2213
- });
2214
- } else {
2215
- return /*#__PURE__*/jsx(ContainerFallback, {
2216
- rounded: rounded,
2217
- align: "center",
2218
- justify: "center",
2219
- css: {
2220
- width,
2221
- height,
2222
- ...cssFallback
2223
- },
2224
- children: /*#__PURE__*/jsx(TextFallback, {
2225
- children: fallbackTitle === 'Tidak ada foto' ? t('fallbackTitle', fallbackTitle) : fallbackTitle
2226
- })
2227
- });
2228
- }
2229
- }
2230
- Image.propTypes = {
2231
- /**
2232
- Additional className for img element.
2233
- */
2234
- className: PropTypes.string,
2235
- /**
2236
- Which is used to specify the source of an image.
2237
- */
2238
- src: PropTypes.string,
2239
- /**
2240
- The written copy that appears in place of an image on a webpage if the image fails to load on a user's screen.
2241
- */
2242
- alt: PropTypes.string,
2243
- /**
2244
- Additional css for img element.
2245
- */
2246
- css: PropTypes.object,
2247
- /**
2248
- Additional css for default fallback element.
2249
- */
2250
- cssFallback: PropTypes.object,
2251
- /**
2252
- Custom width of img element.
2253
- */
2254
- width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
2255
- /**
2256
- Custom height of img element.
2257
- */
2258
- height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
2259
- /**
2260
- Set image to circle.
2261
- */
2262
- rounded: PropTypes.bool,
2263
- /**
2264
- Used to specify how an <img> should be resized to fit its container.
2265
- */
2266
- objectFit: PropTypes.string,
2267
- /**
2268
- Custom fallback if image url doesn't exist.
2269
- */
2270
- fallback: PropTypes.string,
2271
- /**
2272
- Custom fallback title for default fallback.
2273
- */
2274
- fallbackTitle: PropTypes.string
2275
- };
2276
- Image.defaultProps = {
2277
- rounded: false,
2278
- fallbackTitle: 'Tidak ada foto'
2279
- };
2280
-
2281
- const ConditionalWrapper = ({
2282
- condition,
2283
- wrapper,
2284
- children
2285
- }) => condition ? wrapper(children) : children;
2286
-
2287
- var $$1 = _export;
2288
- var call = functionCall;
2289
- var iterate$1 = iterate$2;
2290
- var aCallable = aCallable$2;
2291
- var anObject$1 = anObject$4;
2292
- var getIteratorDirect$1 = getIteratorDirect$3;
2293
- var iteratorClose = iteratorClose$5;
2294
- var iteratorHelperWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError$2;
2295
-
2296
- var findWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('find', TypeError);
2297
-
2298
- // `Iterator.prototype.find` method
2299
- // https://tc39.es/ecma262/#sec-iterator.prototype.find
2300
- $$1({ target: 'Iterator', proto: true, real: true, forced: findWithoutClosingOnEarlyError }, {
2301
- find: function find(predicate) {
2302
- anObject$1(this);
2303
- try {
2304
- aCallable(predicate);
2305
- } catch (error) {
2306
- iteratorClose(this, 'throw', error);
2307
- }
2308
-
2309
- if (findWithoutClosingOnEarlyError) return call(findWithoutClosingOnEarlyError, this, predicate);
2310
-
2311
- var record = getIteratorDirect$1(this);
2312
- var counter = 0;
2313
- return iterate$1(record, function (value, stop) {
2314
- if (predicate(value, counter++)) return stop(value);
2315
- }, { IS_RECORD: true, INTERRUPTED: true }).result;
2316
- }
2317
- });
2318
-
2319
- var $ = _export;
2320
- var anObject = anObject$4;
2321
- var createProperty = createProperty$1;
2322
- var iterate = iterate$2;
2323
- var getIteratorDirect = getIteratorDirect$3;
2324
-
2325
- // `Iterator.prototype.toArray` method
2326
- // https://tc39.es/ecma262/#sec-iterator.prototype.toarray
2327
- $({ target: 'Iterator', proto: true, real: true }, {
2328
- toArray: function toArray() {
2329
- var result = [];
2330
- var index = 0;
2331
- iterate(getIteratorDirect(anObject(this)), function (element) {
2332
- createProperty(result, index++, element);
2333
- }, { IS_RECORD: true });
2334
- return result;
2335
- }
2336
- });
2337
-
2338
- const StyledOverlay$1 = styled(DialogPrimitive.Overlay, {
2339
- backgroundColor: '$bgDimmer',
2340
- position: 'fixed',
2341
- inset: 0
2342
- });
2343
- const StyledContent$1 = styled(DialogPrimitive.Content, {
2344
- position: 'fixed',
2345
- top: '50%',
2346
- left: '50%',
2347
- transform: 'translate(-50%, -50%)',
2348
- '&:focus': {
2349
- outline: 'none'
2350
- },
2351
- width: '100%',
2352
- variants: {
2353
- /**
2354
- * Size of modal width, the height sized according to content. Size must be placed on DialogContent element
2355
- * if it's on mobile view will auto set maxWidth to 'unset'.
2356
- */
2357
- size: {
2358
- auto: {
2359
- '@md': {
2360
- width: 'auto'
2361
- }
2362
- },
2363
- xs: {
2364
- maxWidth: 'unset',
2365
- '@md': {
2366
- maxWidth: '320px'
2367
- }
2368
- },
2369
- sm: {
2370
- maxWidth: 'unset',
2371
- '@md': {
2372
- maxWidth: '384px'
2373
- }
2374
- },
2375
- md: {
2376
- maxWidth: 'unset',
2377
- '@md': {
2378
- maxWidth: '448px'
2379
- }
2380
- },
2381
- lg: {
2382
- maxWidth: 'unset',
2383
- '@md': {
2384
- maxWidth: '512px'
2385
- }
2386
- },
2387
- xl: {
2388
- maxWidth: 'unset',
2389
- '@md': {
2390
- maxWidth: '576px'
2391
- }
2392
- },
2393
- full: {
2394
- maxWidth: '100vw',
2395
- minHeight: '100vh'
2396
- }
2397
- }
2398
- },
2399
- defaultVariants: {
2400
- size: 'md'
2401
- }
2402
- });
2403
- const Content = /*#__PURE__*/React__default.forwardRef((props, ref) => {
2404
- const {
2405
- children
2406
- } = props,
2407
- rest = __rest(props, ["children"]);
2408
- return jsx(StyledContent$1, Object.assign({}, rest, {
2409
- ref: ref,
2410
- children: children
2411
- }));
2412
- });
2413
- const StyledTitle = styled(DialogPrimitive.Title, {});
2414
- const StyledDescription = styled(DialogPrimitive.Description, {
2415
- margin: '10px 0 20px',
2416
- color: '$textSecondary',
2417
- fontSize: 15,
2418
- lineHeight: 1.5
2419
- });
2420
- // Exports
2421
- const Dialog = DialogPrimitive.Root;
2422
- const DialogTrigger = DialogPrimitive.Trigger;
2423
- const DialogContent = Content;
2424
- const DialogTitle = StyledTitle;
2425
- const DialogDescription = StyledDescription;
2426
- const DialogClose = DialogPrimitive.Close;
2427
- const DialogOverlay = StyledOverlay$1;
2428
- const DialogPortal = DialogPrimitive.Portal;
2429
- DialogTrigger.displayName = 'DialogTrigger';
2430
- DialogContent.displayName = 'DialogContent';
2431
- DialogTitle.displayName = 'DialogTitle';
2432
- DialogDescription.displayName = 'DialogDescription';
2433
- DialogClose.displayName = 'DialogClose';
2434
- DialogOverlay.displayName = 'DialogOverlay';
2435
- DialogPortal.displayName = 'DialogPortal';
2436
-
2437
- const ModalDialogFooter = styled('div');
2438
- ModalDialogFooter.displayName = 'ModalDialogFooter';
2439
- const ModalDialogTitle = styled('div');
2440
- ModalDialogTitle.displayName = 'ModalDialogTitle';
2441
- const ModalDialogContent = styled('div');
2442
- ModalDialogContent.displayName = 'ModalDialogContent';
2443
- const ModalDialogTrigger = styled('div');
2444
- ModalDialogTrigger.displayName = 'ModalDialogTrigger';
2445
- const StyledContent = styled(DialogContent, {
2446
- top: 'auto',
2447
- bottom: 0,
2448
- left: 0,
2449
- transform: 'translate(0,0)',
2450
- '& > div': {
2451
- borderBottomRightRadius: 0,
2452
- borderBottomLeftRadius: 0
2453
- },
2454
- '@md': {
2455
- top: '50%',
2456
- left: '50%',
2457
- bottom: 'unset',
2458
- transform: 'translate(-50%, -50%)',
2459
- '& > div': {
2460
- borderBottomRightRadius: '$lg',
2461
- borderBottomLeftRadius: '$lg'
2462
- }
2463
- },
2464
- variants: {
2465
- isMobile: {
2466
- true: {
2467
- top: 'auto',
2468
- bottom: 0,
2469
- left: 0,
2470
- transform: 'translate(0,0)',
2471
- maxWidth: 'unset',
2472
- '& > div': {
2473
- borderBottomRightRadius: 0,
2474
- borderBottomLeftRadius: 0
2475
- }
2476
- },
2477
- false: {
2478
- top: '50%',
2479
- left: '50%',
2480
- bottom: 'unset',
2481
- transform: 'translate(-50%, -50%)',
2482
- '& > div': {
2483
- borderBottomRightRadius: '$lg',
2484
- borderBottomLeftRadius: '$lg'
2485
- }
2486
- }
2487
- }
2488
- }
2489
- });
2490
- const StyledOverlay = styled(Box, {
2491
- backgroundColor: '$bgDimmer',
2492
- position: 'fixed',
2493
- inset: 0
2494
- });
2495
- const findNodeChild = (array, displayName) => {
2496
- const result = array.find(child => {
2497
- if (/*#__PURE__*/React__default.isValidElement(child)) {
2498
- const reactElement = child;
2499
- if (typeof reactElement.type !== 'string') {
2500
- const reactFC = reactElement.type;
2501
- if (reactFC.displayName === displayName) {
2502
- return true;
2503
- }
2504
- }
2505
- }
2506
- return false;
2507
- });
2508
- return result;
2509
- };
2510
- /**
2511
- * ModalDialog are used to focus and display content that contains one specific task that requires interaction from the user and is separate from the main page.
2512
- * https://react-majoo-ui.mangkujagat.com/?path=/story/core-components-pagedialog--default
2513
- * @param size - default fullsize
2514
- * @param layer - z-index default 1400
2515
- * @param isMobile - force mobile/desktop view, default is responsive
2516
- * @param onOpenAutoFocus - set default open behaviour
2517
- *
2518
- * @example
2519
- * // Uncontrolled Example
2520
- * <ModalDialog>
2521
- * <ModalDialogTrigger>Button Trigger</ModalDialogTrigger>
2522
- * <ModalDialogTitle>Title</ModalDialogTitle>
2523
- * <ModalDialogContent>Content</ModalDialogContent>
2524
- * <ModalDialogFooter>Footer</ModalDialogFooter>
2525
- * </ModalDialog>
2526
- * @component
2527
- */
2528
- const ModalDialog = props => {
2529
- const {
2530
- children,
2531
- size,
2532
- css,
2533
- layer,
2534
- isMobile,
2535
- width,
2536
- onOpenAutoFocus,
2537
- disabledCloseButton,
2538
- onPointerDownOutside,
2539
- onCloseClick,
2540
- theme
2541
- } = props,
2542
- rest = __rest(props, ["children", "size", "css", "layer", "isMobile", "width", "onOpenAutoFocus", "disabledCloseButton", "onPointerDownOutside", "onCloseClick", "theme"]);
2543
- const childArray = React__default.Children.toArray(children);
2544
- const modalDialogFooter = findNodeChild(childArray, 'ModalDialogFooter');
2545
- const modalDialogTitle = findNodeChild(childArray, 'ModalDialogTitle');
2546
- const modalDialogContent = findNodeChild(childArray, 'ModalDialogContent');
2547
- const modalDialogTrigger = findNodeChild(childArray, 'ModalDialogTrigger');
2548
- const themeProvider = useThemeProvider(theme);
2549
- const ref = useCallback(node => {
2550
- const appElement = document.getElementById('app');
2551
- if (appElement) {
2552
- if (node !== null) {
2553
- appElement.classList.add('noscroll');
2554
- } else {
2555
- appElement.classList.remove('noscroll');
2556
- }
2557
- }
2558
- }, []);
2559
- return jsxs(Dialog, Object.assign({}, rest, {
2560
- children: [modalDialogTrigger && jsx(DialogTrigger, Object.assign({}, modalDialogTrigger.props)), jsxs(DialogPortal, {
2561
- children: [jsx(StyledOverlay, {
2562
- css: {
2563
- zIndex: layer
2564
- }
2565
- }), jsx(StyledContent, {
2566
- className: (themeProvider === null || themeProvider === void 0 ? void 0 : themeProvider.theme) || '',
2567
- size: size,
2568
- css: Object.assign(Object.assign({}, css), {
2569
- zIndex: layer,
2570
- width: width,
2571
- maxWidth: width && 'unset'
2572
- }),
2573
- ref: ref,
2574
- isMobile: isMobile,
2575
- onOpenAutoFocus: e => {
2576
- if (!onOpenAutoFocus) {
2577
- e.preventDefault();
2578
- } else {
2579
- onOpenAutoFocus(e);
2580
- }
2581
- },
2582
- onPointerDownOutside: e => onPointerDownOutside === null || onPointerDownOutside === void 0 ? void 0 : onPointerDownOutside(e),
2583
- children: jsxs(Box, {
2584
- css: {
2585
- backgroundColor: '$bgWhite',
2586
- display: 'flex',
2587
- flexDirection: 'column',
2588
- borderRadius: '$lg'
2589
- },
2590
- children: [modalDialogTitle && jsx(Box, {
2591
- css: Object.assign({
2592
- padding: '16px 24px',
2593
- display: 'block',
2594
- alignItems: 'center',
2595
- position: 'relative',
2596
- borderBottom: '1px solid $gray150',
2597
- '@md': {
2598
- padding: '24px 24px 19px 24px'
2599
- }
2600
- }, modalDialogTitle.props.containerCss),
2601
- children: jsxs(Box, {
2602
- css: {
2603
- justifyContent: 'space-between',
2604
- display: 'flex',
2605
- alignItems: 'center',
2606
- gap: '$compact',
2607
- marginRight: 0
2608
- },
2609
- children: [jsx(DialogTitle, {
2610
- css: {
2611
- margin: 0
2612
- },
2613
- children: jsx(Heading, Object.assign({
2614
- as: "p",
2615
- heading: "pageTitle"
2616
- }, modalDialogTitle.props))
2617
- }), !props.hideCloseButton && jsx(ConditionalWrapper, {
2618
- condition: !disabledCloseButton,
2619
- wrapper: children => jsx(DialogClose, {
2620
- asChild: true,
2621
- disabled: disabledCloseButton,
2622
- onClick: () => {
2623
- if (onCloseClick) onCloseClick();
2624
- },
2625
- children: children
2626
- }),
2627
- children: jsx(Box, {
2628
- css: {
2629
- display: 'flex',
2630
- justifyContent: 'center',
2631
- alignItems: 'center',
2632
- cursor: disabledCloseButton ? 'not-allowed' : 'pointer',
2633
- marginRight: 4
2634
- },
2635
- children: jsx(CloseOutline, {
2636
- size: "22"
2637
- })
2638
- })
2639
- })]
2640
- })
2641
- }), modalDialogContent && jsx(Box, Object.assign({}, modalDialogContent.props, {
2642
- css: Object.assign({
2643
- flexGrow: 1,
2644
- maxHeight: 'calc(100vh - 64px - 56px)',
2645
- padding: '16px 24px'
2646
- }, modalDialogContent.props.css)
2647
- })), modalDialogFooter && jsx(Box, Object.assign({}, modalDialogFooter.props, {
2648
- css: Object.assign({
2649
- borderTop: '1px solid $gray150',
2650
- padding: '16px 24px',
2651
- display: 'flex',
2652
- justifyContent: 'flex-end'
2653
- }, modalDialogFooter.props.css)
2654
- }))]
2655
- })
2656
- })]
2657
- })]
2658
- }));
2659
- };
2660
- ModalDialog.Trigger = ModalDialogTrigger;
2661
- ModalDialog.Title = ModalDialogTitle;
2662
- ModalDialog.Content = ModalDialogContent;
2663
- ModalDialog.Footer = ModalDialogFooter;
2664
- ModalDialog.defaultProps = {
2665
- size: 'md',
2666
- layer: '$modal'
2667
- };
2668
-
2669
- export { Box as B, ConditionalWrapper as C, DialogClose as D, Flex as F, Heading as H, Image as I, ModalDialog as M, PropTypes as P, Text as T, __rest as _, Paragraph as a, Button as b, ModalDialogTitle as c, ModalDialogContent as d, ModalDialogFooter as e, DialogPortal as f, ModalDialogTrigger as g, Dialog as h, DialogTrigger as i, DialogContent as j, DialogTitle as k, __awaiter as l, ButtonPrimitive as m, DialogDescription as n, DialogOverlay as o, TextVariantsEnum as p, iteratorHelperThrowsOnInvalidIterator$1 as q, iteratorCreateProxy as r, seqNumberVariants as s, callWithSafeIterationClosing$1 as t };