@pedidopago/ui 1.7.26 → 1.8.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.
- package/dist/components/Alert/alert.test.js +1 -85
- package/dist/components/Alert/index.js +1 -63
- package/dist/components/Alert/styles.js +1 -32
- package/dist/components/Avatar/avatar.test.js +1 -67
- package/dist/components/Avatar/index.js +1 -94
- package/dist/components/Avatar/styles.js +1 -51
- package/dist/components/Badge/badge.test.js +1 -71
- package/dist/components/Badge/index.js +2 -43
- package/dist/components/Badge/styles.js +1 -33
- package/dist/components/Button/Button.test.js +1 -154
- package/dist/components/Button/index.js +1 -87
- package/dist/components/Button/styles.js +1 -112
- package/dist/components/Card/card.test.js +1 -30
- package/dist/components/Card/index.js +1 -44
- package/dist/components/Card/styles.js +1 -16
- package/dist/components/CheckboxInput/checkbox-input.test.js +1 -170
- package/dist/components/CheckboxInput/components/MultipleCheckbox.js +1 -205
- package/dist/components/CheckboxInput/index.js +1 -94
- package/dist/components/CheckboxInput/styles.js +1 -34
- package/dist/components/ChoiceList/index.d.ts +6 -0
- package/dist/components/ChoiceList/index.d.ts.map +1 -0
- package/dist/components/ChoiceList/index.js +1 -0
- package/dist/components/ChoiceList/styles.d.ts +22 -0
- package/dist/components/ChoiceList/styles.d.ts.map +1 -0
- package/dist/components/ChoiceList/styles.js +1 -0
- package/dist/components/ChoiceList/types.d.ts +24 -0
- package/dist/components/ChoiceList/types.d.ts.map +1 -0
- package/dist/components/ChoiceList/types.js +1 -0
- package/dist/components/CollapseCard/ExpandButton/index.js +1 -40
- package/dist/components/CollapseCard/ExpandButton/styles.js +1 -16
- package/dist/components/CollapseCard/expand-button.test.js +1 -161
- package/dist/components/CollapseCard/index.js +1 -98
- package/dist/components/CollapseCard/styles.js +1 -26
- package/dist/components/ColorPicker/colorpicker.test.js +1 -64
- package/dist/components/ColorPicker/components/ColorHue.js +1 -44
- package/dist/components/ColorPicker/components/ColorInput.js +1 -63
- package/dist/components/ColorPicker/components/ColorPickerBox.js +1 -52
- package/dist/components/ColorPicker/components/ColorPointer.js +1 -25
- package/dist/components/ColorPicker/components/ColorSelector.js +1 -107
- package/dist/components/ColorPicker/hooks/useCachedCallback.js +1 -16
- package/dist/components/ColorPicker/hooks/useHsva.js +1 -53
- package/dist/components/ColorPicker/index.js +1 -93
- package/dist/components/ColorPicker/styles.js +1 -46
- package/dist/components/ColorPicker/utils/checkers.js +1 -55
- package/dist/components/ColorPicker/utils/conversors.js +2 -243
- package/dist/components/ColorPicker/utils/parsers.js +10 -108
- package/dist/components/ComposeIcon/index.js +2 -48
- package/dist/components/ComposeIcon/styles.js +1 -53
- package/dist/components/DateInput/DateInput-example.js +7 -45
- package/dist/components/DateInput/components/ModalWrapper/index.js +1 -35
- package/dist/components/DateInput/components/ModalWrapper/styles.js +1 -21
- package/dist/components/DateInput/dateInput.test.js +2 -43
- package/dist/components/DateInput/index.js +2 -104
- package/dist/components/DateInput/styles.js +1 -18
- package/dist/components/DatePicker/components/DatePickerContent.js +2 -222
- package/dist/components/DatePicker/components/DateYearPicker.js +1 -102
- package/dist/components/DatePicker/datepicker.test.js +1 -120
- package/dist/components/DatePicker/index.js +1 -236
- package/dist/components/DatePicker/styles.js +1 -88
- package/dist/components/DatePicker/utils/getMonthName.js +1 -11
- package/dist/components/Dialog/dialog-example.js +1 -46
- package/dist/components/Dialog/dialog.test.js +1 -68
- package/dist/components/Dialog/index.js +2 -100
- package/dist/components/Dialog/styles.js +1 -31
- package/dist/components/Dropzone/dropzone.test.js +1 -69
- package/dist/components/Dropzone/index.js +1 -289
- package/dist/components/Dropzone/styles.js +1 -75
- package/dist/components/Dropzone/utils/accepts.js +2 -27
- package/dist/components/EmojiPicker/Emote/index.js +2 -24
- package/dist/components/EmojiPicker/Emote/styles.js +1 -27
- package/dist/components/EmojiPicker/EmotePickerData/constants.js +1 -51
- package/dist/components/EmojiPicker/EmotePickerData/index.js +2 -159
- package/dist/components/EmojiPicker/EmotePickerData/styles.js +1 -57
- package/dist/components/EmojiPicker/EmotePickerData/utils.js +1 -41
- package/dist/components/EmojiPicker/Example/EmotePickerExample.js +1 -43
- package/dist/components/EmojiPicker/animation.js +1 -43
- package/dist/components/EmojiPicker/index.js +1 -169
- package/dist/components/EmojiPicker/styles.js +1 -21
- package/dist/components/Flex/flex.test.js +1 -336
- package/dist/components/Flex/index.js +1 -49
- package/dist/components/Flex/styles.js +1 -25
- package/dist/components/Grid/grid.test.js +1 -134
- package/dist/components/Grid/index.js +1 -51
- package/dist/components/Grid/styles.js +1 -48
- package/dist/components/Icon/data/beauty.js +2 -206
- package/dist/components/Icon/data/dash.js +2 -2
- package/dist/components/Icon/data/ecommerce.js +2 -94
- package/dist/components/Icon/data/form.js +2 -248
- package/dist/components/Icon/data/health.js +2 -255
- package/dist/components/Icon/data/illustrations.js +2 -318
- package/dist/components/Icon/data/men.js +2 -52
- package/dist/components/Icon/data/payment.js +2 -94
- package/dist/components/Icon/data/pedidoPago.js +2 -45
- package/dist/components/Icon/data/physicalPerfomance.js +2 -283
- package/dist/components/Icon/data/social.js +2 -24
- package/dist/components/Icon/data/status.js +2 -115
- package/dist/components/Icon/data/summer.js +2 -52
- package/dist/components/Icon/data/woman.js +2 -80
- package/dist/components/Icon/icon.test.js +1 -57
- package/dist/components/Icon/index.js +1 -53
- package/dist/components/Icon/scripts/build.js +9 -104
- package/dist/components/Icon/scripts/extractor.js +2 -33
- package/dist/components/Icon/scripts/run-build.js +2 -7
- package/dist/components/Icon/scripts/writers.js +3 -34
- package/dist/components/Icon/styles.js +1 -22
- package/dist/components/Icon/utils/allIcons.js +1 -28
- package/dist/components/Icon/utils/iconExists.js +1 -13
- package/dist/components/IconItem/IconItem.test.js +1 -58
- package/dist/components/IconItem/index.js +1 -52
- package/dist/components/IconItem/styles.js +1 -43
- package/dist/components/Illustration/illustration.test.js +4 -50
- package/dist/components/Illustration/index.js +2 -65
- package/dist/components/Illustration/styles.js +1 -65
- package/dist/components/ImageItem/imageFake.js +1 -25
- package/dist/components/ImageItem/index.js +2 -66
- package/dist/components/ImageItem/input.test.js +1 -85
- package/dist/components/ImageItem/styles.js +1 -61
- package/dist/components/Input/index.js +1 -163
- package/dist/components/Input/input.test.js +1 -120
- package/dist/components/Input/styles.js +1 -177
- package/dist/components/Label/index.js +1 -45
- package/dist/components/Label/label.test.js +1 -83
- package/dist/components/Label/styles.js +1 -21
- package/dist/components/List/index.js +1 -39
- package/dist/components/List/list.test.js +1 -64
- package/dist/components/List/styles.js +1 -23
- package/dist/components/Modal/ModalExample.js +1 -70
- package/dist/components/Modal/index.js +1 -145
- package/dist/components/Modal/modal.test.js +1 -179
- package/dist/components/Modal/styles.js +1 -33
- package/dist/components/MultipleSelect/MultipleSelect.test.js +1 -334
- package/dist/components/MultipleSelect/animations.js +1 -25
- package/dist/components/MultipleSelect/components/InputWrapper/index.js +1 -26
- package/dist/components/MultipleSelect/components/OptionsArea/index.js +1 -244
- package/dist/components/MultipleSelect/components/OptionsArea/styles.js +1 -68
- package/dist/components/MultipleSelect/components/SelectArea/ButtonsArea.js +1 -27
- package/dist/components/MultipleSelect/components/SelectArea/SelectAreaWrapper.js +1 -37
- package/dist/components/MultipleSelect/components/SelectArea/SelectedOptionsArea.js +1 -49
- package/dist/components/MultipleSelect/components/SelectArea/index.js +1 -100
- package/dist/components/MultipleSelect/components/SelectArea/styles.js +1 -36
- package/dist/components/MultipleSelect/components/index.js +1 -38
- package/dist/components/MultipleSelect/index.js +1 -209
- package/dist/components/NewSelect/Examples/constants.js +1 -56
- package/dist/components/NewSelect/Examples/index.js +1 -161
- package/dist/components/NewSelect/components/Chip/index.js +1 -36
- package/dist/components/NewSelect/components/Chip/styles.js +1 -24
- package/dist/components/NewSelect/components/OptionsSelect/styles.js +1 -21
- package/dist/components/NewSelect/components/SelectInputSearch/index.js +1 -24
- package/dist/components/NewSelect/components/SelectItem/index.js +1 -22
- package/dist/components/NewSelect/components/SelectItem/styles.js +1 -24
- package/dist/components/NewSelect/index.js +1 -18
- package/dist/components/NewSelect/multiple/index.js +1 -246
- package/dist/components/NewSelect/newSelect.test.js +1 -108
- package/dist/components/NewSelect/single/index.js +1 -183
- package/dist/components/NewSelect/styles.js +1 -44
- package/dist/components/Observer/index.js +1 -59
- package/dist/components/Observer/observer.test.js +2 -43
- package/dist/components/Pagination/hooks/usePagination.js +1 -57
- package/dist/components/Pagination/index.js +1 -174
- package/dist/components/Pagination/pagination.test.js +1 -118
- package/dist/components/Pagination/styles.js +1 -78
- package/dist/components/Progress/Circle/index.js +1 -102
- package/dist/components/Progress/Circle/styles.js +1 -69
- package/dist/components/Progress/Linear/index.js +1 -62
- package/dist/components/Progress/Linear/styles.js +1 -66
- package/dist/components/Progress/getSteps.js +1 -17
- package/dist/components/Progress/index.js +1 -39
- package/dist/components/Progress/progress.test.js +1 -109
- package/dist/components/Radio/components/RadioGroup/index.d.ts +5 -0
- package/dist/components/Radio/components/RadioGroup/index.d.ts.map +1 -0
- package/dist/components/Radio/components/RadioGroup/index.js +1 -0
- package/dist/components/Radio/components/RadioGroup/styles.d.ts +19 -0
- package/dist/components/Radio/components/RadioGroup/styles.d.ts.map +1 -0
- package/dist/components/Radio/components/RadioGroup/styles.js +1 -0
- package/dist/components/Radio/components/RadioGroup/types.d.ts +17 -0
- package/dist/components/Radio/components/RadioGroup/types.d.ts.map +1 -0
- package/dist/components/Radio/components/RadioGroup/types.js +1 -0
- package/dist/components/Radio/index.d.ts +5 -0
- package/dist/components/Radio/index.d.ts.map +1 -0
- package/dist/components/Radio/index.js +1 -0
- package/dist/components/Radio/styles.d.ts +10 -0
- package/dist/components/Radio/styles.d.ts.map +1 -0
- package/dist/components/Radio/styles.js +1 -0
- package/dist/components/Radio/types.d.ts +6 -0
- package/dist/components/Radio/types.d.ts.map +1 -0
- package/dist/components/Radio/types.js +1 -0
- package/dist/components/Rating/index.js +1 -133
- package/dist/components/Rating/rating.test.js +1 -63
- package/dist/components/Rating/styles.js +1 -27
- package/dist/components/ReactPortal/index.js +1 -43
- package/dist/components/ReactPortal/reactPortal.test.js +1 -21
- package/dist/components/ReactPortal/utils/createWrapperAndApprendToBody.js +1 -12
- package/dist/components/Select/components/OptionsSelect/index.js +1 -73
- package/dist/components/Select/components/OptionsSelect/styles.js +1 -21
- package/dist/components/Select/index.js +4 -247
- package/dist/components/Select/select.test.js +1 -58
- package/dist/components/Select/styles.js +1 -46
- package/dist/components/Skeleton/index.js +1 -28
- package/dist/components/Skeleton/skeleton.test.js +1 -90
- package/dist/components/Skeleton/styles.js +1 -27
- package/dist/components/Slider/SliderExample.js +1 -52
- package/dist/components/Slider/components/SliderPointer.js +1 -39
- package/dist/components/Slider/components/SliderRail.js +1 -116
- package/dist/components/Slider/components/SliderSelector.js +1 -173
- package/dist/components/Slider/hooks/useEventCallback.js +1 -16
- package/dist/components/Slider/index.js +1 -137
- package/dist/components/Slider/slider.test.js +1 -121
- package/dist/components/Slider/styles.js +1 -69
- package/dist/components/Spinner/index.js +1 -26
- package/dist/components/Spinner/spinner.test.js +1 -45
- package/dist/components/Spinner/styles.js +1 -23
- package/dist/components/Steps/components/StepIcon/index.js +1 -50
- package/dist/components/Steps/components/StepIcon/styles.js +1 -42
- package/dist/components/Steps/components/StepIcon/utils.js +1 -22
- package/dist/components/Steps/index.js +1 -116
- package/dist/components/Steps/steps.test.js +1 -53
- package/dist/components/Steps/styles.js +1 -96
- package/dist/components/Steps/utils.js +1 -15
- package/dist/components/Switch/index.js +1 -73
- package/dist/components/Switch/styles.js +1 -58
- package/dist/components/Switch/switch.test.js +2 -115
- package/dist/components/Table/components/MenuItem.js +1 -59
- package/dist/components/Table/components/TableSkeleton.js +1 -39
- package/dist/components/Table/components/animations.js +1 -24
- package/dist/components/Table/index.js +2 -253
- package/dist/components/Table/styles.js +1 -49
- package/dist/components/Table/table.test.js +1 -114
- package/dist/components/Tabs/TabsExample.js +1 -64
- package/dist/components/Tabs/components/Tab.js +1 -49
- package/dist/components/Tabs/components/TabPanel.js +1 -25
- package/dist/components/Tabs/components/Tabs.js +1 -107
- package/dist/components/Tabs/index.js +1 -26
- package/dist/components/Tabs/styles.js +1 -61
- package/dist/components/Tabs/tabs.test.js +1 -146
- package/dist/components/Tag/index.js +1 -53
- package/dist/components/Tag/styles.js +1 -34
- package/dist/components/Tag/tag.test.js +1 -64
- package/dist/components/TextAreaInput/index.js +1 -74
- package/dist/components/TextAreaInput/styles.js +1 -53
- package/dist/components/TextAreaInput/text-area-input.test.js +1 -81
- package/dist/components/Thumbnail/index.js +1 -125
- package/dist/components/Thumbnail/styles.js +1 -47
- package/dist/components/Thumbnail/thumbnail.test.js +1 -66
- package/dist/components/Thumbnail/utils/index.js +1 -27
- package/dist/components/Thumbnail/utils/validate-file-size.js +1 -10
- package/dist/components/Thumbnail/utils/validate-file-type.js +1 -9
- package/dist/components/TimeInput/constants.js +1 -29
- package/dist/components/TimeInput/index.js +1 -288
- package/dist/components/TimeInput/styles.js +1 -34
- package/dist/components/TimeInput/utils.js +1 -94
- package/dist/components/Timeline/components/Timeline.js +1 -17
- package/dist/components/Timeline/components/TimelineContent.js +1 -61
- package/dist/components/Timeline/components/TimelineItem.js +1 -25
- package/dist/components/Timeline/components/TimelineSeparator.js +1 -20
- package/dist/components/Timeline/index.js +1 -33
- package/dist/components/Timeline/styles.js +1 -37
- package/dist/components/Timeline/timeline.test.js +1 -138
- package/dist/components/Toast/button-example.js +1 -31
- package/dist/components/Toast/components/Toast.js +1 -79
- package/dist/components/Toast/contexts/ToastProvider.js +1 -72
- package/dist/components/Toast/hooks/useToast.js +1 -18
- package/dist/components/Toast/index.js +1 -111
- package/dist/components/Toast/styles.js +1 -36
- package/dist/components/Toast/toast.test.js +1 -129
- package/dist/components/Tooltip/components/TooltipLabel.js +1 -71
- package/dist/components/Tooltip/example.js +1 -27
- package/dist/components/Tooltip/index.js +1 -187
- package/dist/components/Tooltip/styles.js +1 -20
- package/dist/components/Typography/index.js +1 -37
- package/dist/components/Typography/styles.js +1 -15
- package/dist/components/Typography/typography.test.js +1 -288
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -548
- package/dist/shared/animations/opacityAnimation.js +1 -21
- package/dist/shared/assets/emotes.js +1 -1
- package/dist/shared/components/FocusLock/index.js +5 -86
- package/dist/shared/formatters/format-number.js +5 -41
- package/dist/shared/global.js +1 -8
- package/dist/shared/hooks/devices.js +1 -14
- package/dist/shared/hooks/useBreakpoints.js +2 -95
- package/dist/shared/hooks/useDebounce.js +1 -35
- package/dist/shared/hooks/useDevices.js +2 -42
- package/dist/shared/hooks/useDisableBodyScroll.js +5 -52
- package/dist/shared/hooks/useDraggableScroll/index.js +5 -65
- package/dist/shared/hooks/useKeyPress.js +1 -18
- package/dist/shared/hooks/useObserver.js +2 -29
- package/dist/shared/hooks/useOnClickOutside.js +1 -30
- package/dist/shared/hooks/useReposition/index.js +2 -53
- package/dist/shared/hooks/useSystemTheme.js +1 -38
- package/dist/shared/hooks/useWindowSize.js +1 -36
- package/dist/shared/tests/test-utils.js +1 -31
- package/dist/shared/theme/button-example.js +1 -31
- package/dist/shared/theme/contexts/ThemeContext.js +1 -90
- package/dist/shared/theme/hooks/useColorMode.js +1 -18
- package/dist/shared/theme/hooks/useColorModeValue.js +1 -13
- package/dist/shared/theme/hooks/useTheme.js +1 -17
- package/dist/shared/theme/index.js +1 -67
- package/dist/shared/theme/objects/breakpoints.js +1 -15
- package/dist/shared/theme/objects/colors.js +1 -177
- package/dist/shared/theme/objects/shadows.js +1 -19
- package/dist/shared/theme/objects/sizes.js +6 -33
- package/dist/shared/theme/objects/spaces.js +1 -75
- package/dist/shared/theme/objects/transitions.js +1 -10
- package/dist/shared/theme/objects/typography.js +1 -20
- package/dist/shared/theme/objects/z-indexes.js +1 -20
- package/dist/shared/theme/theme.js +1 -36
- package/dist/shared/theme/theme.test.js +1 -94
- package/dist/shared/theme/utils/extendTheme.js +1 -25
- package/dist/shared/theme/utils/localStorageController.js +1 -21
- package/dist/styled.d.js +1 -3
- package/dist/utils/GenerateKey.js +3 -18
- package/dist/utils/brightnessColorChange.js +2 -17
- package/dist/utils/colorCheck.js +6 -64
- package/dist/utils/colorFunctions.js +1 -39
- package/dist/utils/colorToGray.js +2 -64
- package/dist/utils/customColorMode.js +1 -11
- package/dist/utils/file.js +5 -124
- package/dist/utils/formatters/bytes.js +2 -17
- package/dist/utils/formatters/capitalize.js +2 -11
- package/dist/utils/formatters/cep.js +3 -18
- package/dist/utils/formatters/cnpj.js +4 -38
- package/dist/utils/formatters/color.js +12 -101
- package/dist/utils/formatters/cpf.js +16 -85
- package/dist/utils/formatters/credit-card.js +5 -54
- package/dist/utils/formatters/email.js +1 -8
- package/dist/utils/formatters/index.js +1 -170
- package/dist/utils/formatters/name.js +4 -31
- package/dist/utils/formatters/number.js +5 -14
- package/dist/utils/formatters/passport.js +5 -33
- package/dist/utils/formatters/phone.js +17 -214
- package/dist/utils/formatters/price.js +3 -21
- package/dist/utils/formatters/rg.js +3 -18
- package/dist/utils/formatters/strings.js +4 -27
- package/dist/utils/fuctionsColors.js +1 -39
- package/dist/utils/generateUUID.js +1 -13
- package/dist/utils/getColorValue.js +2 -23
- package/dist/utils/getSvg.js +1 -17
- package/dist/utils/getValuesBySize.js +1 -9
- package/dist/utils/invertColor.js +4 -40
- package/package.json +2 -1
|
@@ -1,111 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _framerMotion = require("framer-motion");
|
|
9
|
-
var _Toast = _interopRequireDefault(require("./components/Toast"));
|
|
10
|
-
var _ReactPortal = require("../ReactPortal");
|
|
11
|
-
var _ToastProvider = require("./contexts/ToastProvider");
|
|
12
|
-
var _styles = require("./styles");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
16
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
21
|
-
var ToastContainer = function ToastContainer() {
|
|
22
|
-
var _useContext = (0, _react.useContext)(_ToastProvider.ToastContext),
|
|
23
|
-
toasts = _useContext.toasts,
|
|
24
|
-
remove = _useContext.remove;
|
|
25
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReactPortal.ReactPortal, {
|
|
26
|
-
wrapperId: "toast-root",
|
|
27
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.StyledToastContainerOverlay, {
|
|
28
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
29
|
-
position: "top",
|
|
30
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
31
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
32
|
-
initial: false,
|
|
33
|
-
children: toasts && toasts.map(function (toast) {
|
|
34
|
-
return toast.config.position === 'top' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
35
|
-
toastId: toast.id,
|
|
36
|
-
close: remove
|
|
37
|
-
}, toast.config), toast.id);
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
})
|
|
41
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
42
|
-
position: "top-right",
|
|
43
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
44
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
45
|
-
initial: false,
|
|
46
|
-
children: toasts && toasts.map(function (toast) {
|
|
47
|
-
return toast.config.position === 'top-right' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
48
|
-
toastId: toast.id,
|
|
49
|
-
close: remove
|
|
50
|
-
}, toast.config), toast.id);
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
})
|
|
54
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
55
|
-
position: "top-left",
|
|
56
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
57
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
58
|
-
initial: false,
|
|
59
|
-
children: toasts && toasts.map(function (toast) {
|
|
60
|
-
return toast.config.position === 'top-left' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
61
|
-
toastId: toast.id,
|
|
62
|
-
close: remove
|
|
63
|
-
}, toast.config), toast.id);
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
68
|
-
position: "bottom",
|
|
69
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
70
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
71
|
-
initial: false,
|
|
72
|
-
children: toasts && toasts.map(function (toast) {
|
|
73
|
-
return toast.config.position === 'bottom' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
74
|
-
toastId: toast.id,
|
|
75
|
-
close: remove
|
|
76
|
-
}, toast.config), toast.id);
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
81
|
-
position: "bottom-right",
|
|
82
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
83
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
84
|
-
initial: false,
|
|
85
|
-
children: toasts && toasts.map(function (toast) {
|
|
86
|
-
return toast.config.position === 'bottom-right' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
87
|
-
toastId: toast.id,
|
|
88
|
-
close: remove
|
|
89
|
-
}, toast.config), toast.id);
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerOverlay, {
|
|
94
|
-
position: "bottom-left",
|
|
95
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledToastManagerInner, {
|
|
96
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
97
|
-
initial: false,
|
|
98
|
-
children: toasts && toasts.map(function (toast) {
|
|
99
|
-
return toast.config.position === 'bottom-left' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Toast.default, _objectSpread({
|
|
100
|
-
toastId: toast.id,
|
|
101
|
-
close: remove
|
|
102
|
-
}, toast.config), toast.id);
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
})]
|
|
107
|
-
})
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
var _default = ToastContainer;
|
|
111
|
-
exports.default = _default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_framerMotion=require("framer-motion"),_Toast=_interopRequireDefault(require("./components/Toast")),_ReactPortal=require("../ReactPortal"),_ToastProvider=require("./contexts/ToastProvider"),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var ToastContainer=function(){var _useContext=(0,_react.useContext)(_ToastProvider.ToastContext),toasts=_useContext.toasts,remove=_useContext.remove;return/*#__PURE__*/(0,_jsxRuntime.jsx)(_ReactPortal.ReactPortal,{wrapperId:"toast-root",children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.StyledToastContainerOverlay,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerOverlay,{position:"top",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerInner,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{initial:!1,children:toasts&&toasts.map(function(toast){return"top"===toast.config.position&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Toast.default,_objectSpread({toastId:toast.id,close:remove},toast.config),toast.id)})})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerOverlay,{position:"top-right",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerInner,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{initial:!1,children:toasts&&toasts.map(function(toast){return"top-right"===toast.config.position&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Toast.default,_objectSpread({toastId:toast.id,close:remove},toast.config),toast.id)})})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerOverlay,{position:"top-left",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerInner,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{initial:!1,children:toasts&&toasts.map(function(toast){return"top-left"===toast.config.position&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Toast.default,_objectSpread({toastId:toast.id,close:remove},toast.config),toast.id)})})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerOverlay,{position:"bottom",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerInner,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{initial:!1,children:toasts&&toasts.map(function(toast){return"bottom"===toast.config.position&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Toast.default,_objectSpread({toastId:toast.id,close:remove},toast.config),toast.id)})})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerOverlay,{position:"bottom-right",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerInner,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{initial:!1,children:toasts&&toasts.map(function(toast){return"bottom-right"===toast.config.position&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Toast.default,_objectSpread({toastId:toast.id,close:remove},toast.config),toast.id)})})})}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerOverlay,{position:"bottom-left",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledToastManagerInner,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{initial:!1,children:toasts&&toasts.map(function(toast){return"bottom-left"===toast.config.position&&/*#__PURE__*/(0,_jsxRuntime.jsx)(_Toast.default,_objectSpread({toastId:toast.id,close:remove},toast.config),toast.id)})})})})]})})},_default=ToastContainer;exports.default=_default;
|
|
@@ -1,36 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.StyledToastManagerOverlay = exports.StyledToastManagerInner = exports.StyledToastContainerOverlay = exports.StyledToastComponent = void 0;
|
|
7
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
8
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
var StyledToastContainerOverlay = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-wrap: break-word;\n"])));
|
|
12
|
-
exports.StyledToastContainerOverlay = StyledToastContainerOverlay;
|
|
13
|
-
var StyledToastManagerOverlay = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: fixed;\n pointer-events: none;\n width: 100%;\n height: 100%;\n z-index: ", ";\n top: 0;\n left: 0;\n\n & > div {\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n }\n"])), function (_ref) {
|
|
14
|
-
var theme = _ref.theme;
|
|
15
|
-
return theme.zIndex.level48;
|
|
16
|
-
}, function (props) {
|
|
17
|
-
return props.position === 'top' && "\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n ";
|
|
18
|
-
}, function (props) {
|
|
19
|
-
return props.position === 'top-left' && "\n top: 0;\n left: 0;\n ";
|
|
20
|
-
}, function (props) {
|
|
21
|
-
return props.position === 'top-right' && "\n top: 0;\n right: 0;\n ";
|
|
22
|
-
}, function (props) {
|
|
23
|
-
return props.position === 'bottom-left' && "\n bottom: 0;\n left: 0;\n ";
|
|
24
|
-
}, function (props) {
|
|
25
|
-
return props.position === 'bottom-right' && "\n bottom: 0;\n right: 0;\n ";
|
|
26
|
-
}, function (props) {
|
|
27
|
-
return props.position === 'bottom' && "\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n ";
|
|
28
|
-
});
|
|
29
|
-
exports.StyledToastManagerOverlay = StyledToastManagerOverlay;
|
|
30
|
-
var StyledToastManagerInner = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n pointer-events: none;\n z-index: ", ";\n padding: 1.5rem;\n width: 400px;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"])), function (_ref2) {
|
|
31
|
-
var theme = _ref2.theme;
|
|
32
|
-
return theme.zIndex.level48;
|
|
33
|
-
});
|
|
34
|
-
exports.StyledToastManagerInner = StyledToastManagerInner;
|
|
35
|
-
var StyledToastComponent = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n user-select: none;\n pointer-events: auto;\n"])));
|
|
36
|
-
exports.StyledToastComponent = StyledToastComponent;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StyledToastManagerOverlay=exports.StyledToastManagerInner=exports.StyledToastContainerOverlay=exports.StyledToastComponent=void 0;var _templateObject,_templateObject2,_templateObject3,_templateObject4,_styled=_interopRequireDefault(require("@emotion/styled"));function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _taggedTemplateLiteral(strings,raw){return raw||(raw=strings.slice(0)),Object.freeze(Object.defineProperties(strings,{raw:{value:Object.freeze(raw)}}))}var StyledToastContainerOverlay=_styled.default.div(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n overflow-wrap: break-word;\n"])));exports.StyledToastContainerOverlay=StyledToastContainerOverlay;var StyledToastManagerOverlay=_styled.default.div(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n position: fixed;\n pointer-events: none;\n width: 100%;\n height: 100%;\n z-index: ",";\n top: 0;\n left: 0;\n\n & > div {\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n\n ","\n }\n"])),function(_ref){var theme=_ref.theme;return theme.zIndex.level48},function(props){return"top"===props.position&&"\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n "},function(props){return"top-left"===props.position&&"\n top: 0;\n left: 0;\n "},function(props){return"top-right"===props.position&&"\n top: 0;\n right: 0;\n "},function(props){return"bottom-left"===props.position&&"\n bottom: 0;\n left: 0;\n "},function(props){return"bottom-right"===props.position&&"\n bottom: 0;\n right: 0;\n "},function(props){return"bottom"===props.position&&"\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n "});exports.StyledToastManagerOverlay=StyledToastManagerOverlay;var StyledToastManagerInner=_styled.default.div(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n position: absolute;\n pointer-events: none;\n z-index: ",";\n padding: 1.5rem;\n width: 400px;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"])),function(_ref2){var theme=_ref2.theme;return theme.zIndex.level48});exports.StyledToastManagerInner=StyledToastManagerInner;var StyledToastComponent=_styled.default.div(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["\n position: relative;\n user-select: none;\n pointer-events: auto;\n"])));exports.StyledToastComponent=StyledToastComponent;
|
|
@@ -1,129 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
require("@testing-library/jest-dom");
|
|
5
|
-
var _buttonExample = _interopRequireDefault(require("./button-example"));
|
|
6
|
-
var _ToastProvider = _interopRequireDefault(require("./contexts/ToastProvider"));
|
|
7
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
|
-
var setup = function setup(props) {
|
|
16
|
-
return (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToastProvider.default, {
|
|
17
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttonExample.default, _objectSpread({}, props))
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
describe('Toast', function () {
|
|
21
|
-
it('should it render the toast on the screen', function () {
|
|
22
|
-
var container = setup({
|
|
23
|
-
title: 'Toast Title',
|
|
24
|
-
content: 'Toast Message',
|
|
25
|
-
type: 'success'
|
|
26
|
-
});
|
|
27
|
-
container.getByText('Show toast').click();
|
|
28
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
29
|
-
});
|
|
30
|
-
it('should it render the toast on position top of the screen', function () {
|
|
31
|
-
var container = setup({
|
|
32
|
-
title: 'Toast Title',
|
|
33
|
-
content: 'Toast Message',
|
|
34
|
-
type: 'success',
|
|
35
|
-
position: 'top'
|
|
36
|
-
});
|
|
37
|
-
container.getByText('Show toast').click();
|
|
38
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
39
|
-
});
|
|
40
|
-
it('should it render the toast on position top-left of the screen', function () {
|
|
41
|
-
var container = setup({
|
|
42
|
-
title: 'Toast Title',
|
|
43
|
-
content: 'Toast Message',
|
|
44
|
-
type: 'success',
|
|
45
|
-
position: 'top-left'
|
|
46
|
-
});
|
|
47
|
-
container.getByText('Show toast').click();
|
|
48
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
49
|
-
});
|
|
50
|
-
it('should it render the toast on position top-right of the screen', function () {
|
|
51
|
-
var container = setup({
|
|
52
|
-
title: 'Toast Title',
|
|
53
|
-
content: 'Toast Message',
|
|
54
|
-
type: 'success',
|
|
55
|
-
position: 'top-right'
|
|
56
|
-
});
|
|
57
|
-
container.getByText('Show toast').click();
|
|
58
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
59
|
-
});
|
|
60
|
-
it('should it render the toast on position bottom of the screen', function () {
|
|
61
|
-
var container = setup({
|
|
62
|
-
title: 'Toast Title',
|
|
63
|
-
content: 'Toast Message',
|
|
64
|
-
type: 'success',
|
|
65
|
-
position: 'bottom'
|
|
66
|
-
});
|
|
67
|
-
container.getByText('Show toast').click();
|
|
68
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
69
|
-
});
|
|
70
|
-
it('should it render the toast on position bottom-left of the screen', function () {
|
|
71
|
-
var container = setup({
|
|
72
|
-
title: 'Toast Title',
|
|
73
|
-
content: 'Toast Message',
|
|
74
|
-
type: 'success',
|
|
75
|
-
position: 'bottom-left'
|
|
76
|
-
});
|
|
77
|
-
container.getByText('Show toast').click();
|
|
78
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
79
|
-
});
|
|
80
|
-
it('should it render the toast on position bottom-right of the screen', function () {
|
|
81
|
-
var container = setup({
|
|
82
|
-
title: 'Toast Title',
|
|
83
|
-
content: 'Toast Message',
|
|
84
|
-
type: 'success',
|
|
85
|
-
position: 'bottom-right'
|
|
86
|
-
});
|
|
87
|
-
container.getByText('Show toast').click();
|
|
88
|
-
expect(container.getByText('Toast Title')).toBeInTheDocument();
|
|
89
|
-
});
|
|
90
|
-
it('should it render the toast on the screen and close it by alert close button', function () {
|
|
91
|
-
var _container$baseElemen;
|
|
92
|
-
var container = setup({
|
|
93
|
-
title: 'Toast Title',
|
|
94
|
-
content: 'Toast Message',
|
|
95
|
-
type: 'success'
|
|
96
|
-
});
|
|
97
|
-
container.getByText('Show toast').click();
|
|
98
|
-
(_container$baseElemen = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen === void 0 ? void 0 : _container$baseElemen.click();
|
|
99
|
-
setTimeout(function () {
|
|
100
|
-
expect(container.getByText('Toast Title')).not.toBeInTheDocument();
|
|
101
|
-
}, 500);
|
|
102
|
-
});
|
|
103
|
-
it('should it call the callback provided in onClose prop', function () {
|
|
104
|
-
var _container$baseElemen2;
|
|
105
|
-
var onClose = jest.fn();
|
|
106
|
-
var container = setup({
|
|
107
|
-
title: 'Toast Title',
|
|
108
|
-
content: 'Toast Message',
|
|
109
|
-
type: 'success',
|
|
110
|
-
onClose: onClose
|
|
111
|
-
});
|
|
112
|
-
container.getByText('Show toast').click();
|
|
113
|
-
(_container$baseElemen2 = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen2 === void 0 ? void 0 : _container$baseElemen2.click();
|
|
114
|
-
expect(onClose).toHaveBeenCalled();
|
|
115
|
-
});
|
|
116
|
-
it('should it call the callback provided in onClose prop and pass the id', function () {
|
|
117
|
-
var _container$baseElemen3;
|
|
118
|
-
var onClose = jest.fn();
|
|
119
|
-
var container = setup({
|
|
120
|
-
title: 'Toast Title',
|
|
121
|
-
content: 'Toast Message',
|
|
122
|
-
type: 'success',
|
|
123
|
-
onClose: onClose
|
|
124
|
-
});
|
|
125
|
-
container.getByText('Show toast').click();
|
|
126
|
-
(_container$baseElemen3 = container.baseElement.querySelectorAll('svg')[1].parentElement) === null || _container$baseElemen3 === void 0 ? void 0 : _container$baseElemen3.click();
|
|
127
|
-
expect(onClose).toHaveBeenCalledWith(expect.any(String));
|
|
128
|
-
});
|
|
129
|
-
});
|
|
1
|
+
"use strict";var _testUtils=require("../../shared/tests/test-utils");require("@testing-library/jest-dom");var _buttonExample=_interopRequireDefault(require("./button-example")),_ToastProvider=_interopRequireDefault(require("./contexts/ToastProvider")),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}var setup=function(props){return(0,_testUtils.render)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_ToastProvider.default,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_buttonExample.default,_objectSpread({},props))}))};describe("Toast",function(){it("should it render the toast on the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on position top of the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success",position:"top"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on position top-left of the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success",position:"top-left"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on position top-right of the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success",position:"top-right"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on position bottom of the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success",position:"bottom"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on position bottom-left of the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success",position:"bottom-left"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on position bottom-right of the screen",function(){var container=setup({title:"Toast Title",content:"Toast Message",type:"success",position:"bottom-right"});container.getByText("Show toast").click(),expect(container.getByText("Toast Title")).toBeInTheDocument()}),it("should it render the toast on the screen and close it by alert close button",function(){var _container$baseElemen,container=setup({title:"Toast Title",content:"Toast Message",type:"success"});container.getByText("Show toast").click(),null===(_container$baseElemen=container.baseElement.querySelectorAll("svg")[1].parentElement)||void 0===_container$baseElemen?void 0:_container$baseElemen.click(),setTimeout(function(){expect(container.getByText("Toast Title")).not.toBeInTheDocument()},500)}),it("should it call the callback provided in onClose prop",function(){var _container$baseElemen2,onClose=jest.fn(),container=setup({title:"Toast Title",content:"Toast Message",type:"success",onClose:onClose});container.getByText("Show toast").click(),null===(_container$baseElemen2=container.baseElement.querySelectorAll("svg")[1].parentElement)||void 0===_container$baseElemen2?void 0:_container$baseElemen2.click(),expect(onClose).toHaveBeenCalled()}),it("should it call the callback provided in onClose prop and pass the id",function(){var _container$baseElemen3,onClose=jest.fn(),container=setup({title:"Toast Title",content:"Toast Message",type:"success",onClose:onClose});container.getByText("Show toast").click(),null===(_container$baseElemen3=container.baseElement.querySelectorAll("svg")[1].parentElement)||void 0===_container$baseElemen3?void 0:_container$baseElemen3.click(),expect(onClose).toHaveBeenCalledWith(expect.any(String))})});
|
|
@@ -1,71 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.TooltipLabel = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _Flex = _interopRequireDefault(require("../../../components/Flex"));
|
|
10
|
-
var _styles = require("../styles");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _excluded = ["tooltipPositions", "animationDuration", "setShowTooltip", "showLabelModal", "setShowLabelModal", "maxWidth", "isVisible"];
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
19
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
21
|
-
var TooltipLabel = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
22
|
-
var tooltipPositions = _ref.tooltipPositions,
|
|
23
|
-
_ref$animationDuratio = _ref.animationDuration,
|
|
24
|
-
animationDuration = _ref$animationDuratio === void 0 ? 0.2 : _ref$animationDuratio,
|
|
25
|
-
setShowTooltip = _ref.setShowTooltip,
|
|
26
|
-
showLabelModal = _ref.showLabelModal,
|
|
27
|
-
setShowLabelModal = _ref.setShowLabelModal,
|
|
28
|
-
maxWidth = _ref.maxWidth,
|
|
29
|
-
isVisible = _ref.isVisible,
|
|
30
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
-
var labelRef = (0, _react.useRef)(null);
|
|
32
|
-
(0, _react.useImperativeHandle)(ref, function () {
|
|
33
|
-
return labelRef.current;
|
|
34
|
-
});
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledTooltipLabel, _objectSpread(_objectSpread({
|
|
36
|
-
ref: labelRef,
|
|
37
|
-
style: _objectSpread(_objectSpread({}, tooltipPositions), {}, {
|
|
38
|
-
opacity: isVisible ? 1 : 0,
|
|
39
|
-
visibility: isVisible ? 'visible' : 'hidden',
|
|
40
|
-
transition: "opacity ".concat(animationDuration, "s ease-in-out, visibility ").concat(animationDuration, "s ease-in-out")
|
|
41
|
-
}),
|
|
42
|
-
onMouseEnter: function onMouseEnter() {
|
|
43
|
-
setShowTooltip(true);
|
|
44
|
-
},
|
|
45
|
-
onMouseLeave: function onMouseLeave() {
|
|
46
|
-
setShowTooltip(false);
|
|
47
|
-
},
|
|
48
|
-
maxWidth: maxWidth
|
|
49
|
-
}, rest), {}, {
|
|
50
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Flex.default, {
|
|
51
|
-
direction: "column",
|
|
52
|
-
spacing: "0",
|
|
53
|
-
children: ! /*#__PURE__*/(0, _react.isValidElement)(rest.label) && String(rest === null || rest === void 0 ? void 0 : rest.label).length > 180 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
54
|
-
children: [rest.label && String(rest.label).slice(0, 180), "...", /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.ViewMoreButton, {
|
|
55
|
-
variant: "ghost",
|
|
56
|
-
size: "xs",
|
|
57
|
-
onClick: function onClick() {
|
|
58
|
-
setShowTooltip(false);
|
|
59
|
-
setShowLabelModal(true);
|
|
60
|
-
},
|
|
61
|
-
style: {
|
|
62
|
-
paddingLeft: 0
|
|
63
|
-
},
|
|
64
|
-
children: "Ver mais"
|
|
65
|
-
})]
|
|
66
|
-
}) : rest.label
|
|
67
|
-
})
|
|
68
|
-
}));
|
|
69
|
-
});
|
|
70
|
-
exports.TooltipLabel = TooltipLabel;
|
|
71
|
-
TooltipLabel.displayName = 'TooltipLabel';
|
|
1
|
+
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.TooltipLabel=void 0;var _react=require("react"),_Flex=_interopRequireDefault(require("../../../components/Flex")),_styles=require("../styles"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["tooltipPositions","animationDuration","setShowTooltip","showLabelModal","setShowLabelModal","maxWidth","isVisible"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}var TooltipLabel=/*#__PURE__*/(0,_react.forwardRef)(function(_ref,ref){var tooltipPositions=_ref.tooltipPositions,_ref$animationDuratio=_ref.animationDuration,animationDuration=void 0===_ref$animationDuratio?.2:_ref$animationDuratio,setShowTooltip=_ref.setShowTooltip,showLabelModal=_ref.showLabelModal,setShowLabelModal=_ref.setShowLabelModal,maxWidth=_ref.maxWidth,isVisible=_ref.isVisible,rest=_objectWithoutProperties(_ref,_excluded),labelRef=(0,_react.useRef)(null);return(0,_react.useImperativeHandle)(ref,function(){return labelRef.current}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledTooltipLabel,_objectSpread(_objectSpread({ref:labelRef,style:_objectSpread(_objectSpread({},tooltipPositions),{},{opacity:isVisible?1:0,visibility:isVisible?"visible":"hidden",transition:"opacity ".concat(animationDuration,"s ease-in-out, visibility ").concat(animationDuration,"s ease-in-out")}),onMouseEnter:function onMouseEnter(){setShowTooltip(!0)},onMouseLeave:function onMouseLeave(){setShowTooltip(!1)},maxWidth:maxWidth},rest),{},{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_Flex.default,{direction:"column",spacing:"0",children:!/*#__PURE__*/(0,_react.isValidElement)(rest.label)&&180<((null===rest||void 0===rest?void 0:rest.label)+"").length?/*#__PURE__*/(0,_jsxRuntime.jsxs)(_react.Fragment,{children:[rest.label&&(rest.label+"").slice(0,180),"...",/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.ViewMoreButton,{variant:"ghost",size:"xs",onClick:function onClick(){setShowTooltip(!1),setShowLabelModal(!0)},style:{paddingLeft:0},children:"Ver mais"})]}):rest.label})}))});exports.TooltipLabel=TooltipLabel,TooltipLabel.displayName="TooltipLabel";
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ExampleTooltip = ExampleTooltip;
|
|
7
|
-
var _ = _interopRequireDefault(require("."));
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
function ExampleTooltip() {
|
|
11
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
12
|
-
style: {
|
|
13
|
-
background: '#000',
|
|
14
|
-
color: 'white',
|
|
15
|
-
marginBottom: '20px'
|
|
16
|
-
},
|
|
17
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, {
|
|
18
|
-
position: "top",
|
|
19
|
-
label: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
20
|
-
children: "Medicamentos - Cliente toma medicamentos diariamente Comandos dispon\xEDveis: #1: Rejeitar com mensagem padr\xE3o #2: Rejeitar sem mensagem nenhuma #3: Continuar com o fluxoMedicamentos - Cliente toma medicamentos diariamente Comandos dispon\xEDveis: #1: Rejeitar com mensagem padr\xE3o #2: Rejeitar sem mensagem nenhuma #3: Continuar com o fluxo"
|
|
21
|
-
}),
|
|
22
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
23
|
-
children: "Large text component with tooltip wrap"
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
});
|
|
27
|
-
}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ExampleTooltip=ExampleTooltip;var _=_interopRequireDefault(require(".")),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ExampleTooltip(){return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{style:{background:"#000",color:"white",marginBottom:"20px"},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_.default,{position:"top",label:/*#__PURE__*/(0,_jsxRuntime.jsx)("span",{children:"Medicamentos - Cliente toma medicamentos diariamente Comandos dispon\xEDveis: #1: Rejeitar com mensagem padr\xE3o #2: Rejeitar sem mensagem nenhuma #3: Continuar com o fluxoMedicamentos - Cliente toma medicamentos diariamente Comandos dispon\xEDveis: #1: Rejeitar com mensagem padr\xE3o #2: Rejeitar sem mensagem nenhuma #3: Continuar com o fluxo"}),children:/*#__PURE__*/(0,_jsxRuntime.jsx)("span",{children:"Large text component with tooltip wrap"})})})}
|
|
@@ -1,187 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _TooltipLabel = require("./components/TooltipLabel");
|
|
10
|
-
var _Button = _interopRequireDefault(require("../Button"));
|
|
11
|
-
var _Flex = _interopRequireDefault(require("../Flex"));
|
|
12
|
-
var _Modal = require("../Modal");
|
|
13
|
-
var _ReactPortal = require("../ReactPortal");
|
|
14
|
-
var _theme = require("../../shared/theme");
|
|
15
|
-
var _styles = require("./styles");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["position", "offset", "maxWidth", "disabled"];
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
24
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
28
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
29
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
31
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
32
|
-
var Tooltip = function Tooltip(_ref) {
|
|
33
|
-
var _tooltipLabelRef$curr;
|
|
34
|
-
var _ref$position = _ref.position,
|
|
35
|
-
position = _ref$position === void 0 ? 'bottom' : _ref$position,
|
|
36
|
-
_ref$offset = _ref.offset,
|
|
37
|
-
offset = _ref$offset === void 0 ? 10 : _ref$offset,
|
|
38
|
-
_ref$maxWidth = _ref.maxWidth,
|
|
39
|
-
maxWidth = _ref$maxWidth === void 0 ? 250 : _ref$maxWidth,
|
|
40
|
-
disabled = _ref.disabled,
|
|
41
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
-
var _useTheme = (0, _theme.useTheme)(),
|
|
43
|
-
theme = _useTheme.theme;
|
|
44
|
-
var _useState = (0, _react.useState)(false),
|
|
45
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
46
|
-
showTooltip = _useState2[0],
|
|
47
|
-
setShowTooltip = _useState2[1];
|
|
48
|
-
var _useState3 = (0, _react.useState)(false),
|
|
49
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
50
|
-
showLabelModal = _useState4[0],
|
|
51
|
-
setShowLabelModal = _useState4[1];
|
|
52
|
-
var _useState5 = (0, _react.useState)({
|
|
53
|
-
top: 0,
|
|
54
|
-
left: 0,
|
|
55
|
-
transform: ''
|
|
56
|
-
}),
|
|
57
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
58
|
-
tooltipPositions = _useState6[0],
|
|
59
|
-
setTooltipPositions = _useState6[1];
|
|
60
|
-
var tooltipContentRef = (0, _react.useRef)(null);
|
|
61
|
-
var tooltipLabelRef = (0, _react.useRef)(null);
|
|
62
|
-
var isHidden = !showLabelModal;
|
|
63
|
-
var tooltipHeight = ((_tooltipLabelRef$curr = tooltipLabelRef.current) === null || _tooltipLabelRef$curr === void 0 ? void 0 : _tooltipLabelRef$curr.getBoundingClientRect().height) || 0;
|
|
64
|
-
(0, _react.useEffect)(function () {
|
|
65
|
-
window.addEventListener('scroll', handleScroll);
|
|
66
|
-
return function () {
|
|
67
|
-
window.removeEventListener('scroll', handleScroll);
|
|
68
|
-
};
|
|
69
|
-
}, [showTooltip]);
|
|
70
|
-
function handleScroll() {
|
|
71
|
-
if (showTooltip) setShowTooltip(false);
|
|
72
|
-
}
|
|
73
|
-
function refreshTooltipPosition(newPosition) {
|
|
74
|
-
if (tooltipContentRef.current) {
|
|
75
|
-
var tooltipContentRect = tooltipContentRef.current.getBoundingClientRect();
|
|
76
|
-
switch (newPosition) {
|
|
77
|
-
case 'top':
|
|
78
|
-
setTooltipPositions({
|
|
79
|
-
top: tooltipContentRect.top - tooltipHeight - offset,
|
|
80
|
-
left: tooltipContentRect.left + tooltipContentRect.width / 2,
|
|
81
|
-
transform: 'translate(-50%, 0)'
|
|
82
|
-
});
|
|
83
|
-
break;
|
|
84
|
-
case 'bottom':
|
|
85
|
-
setTooltipPositions({
|
|
86
|
-
top: tooltipContentRect.top + tooltipContentRect.height + offset,
|
|
87
|
-
left: tooltipContentRect.left + tooltipContentRect.width / 2,
|
|
88
|
-
transform: 'translateX(-50%)'
|
|
89
|
-
});
|
|
90
|
-
break;
|
|
91
|
-
case 'left':
|
|
92
|
-
setTooltipPositions({
|
|
93
|
-
top: tooltipContentRect.top + tooltipContentRect.height / 2,
|
|
94
|
-
left: tooltipContentRect.left - offset,
|
|
95
|
-
transform: 'translate(-100%, -50%)'
|
|
96
|
-
});
|
|
97
|
-
break;
|
|
98
|
-
case 'right':
|
|
99
|
-
setTooltipPositions({
|
|
100
|
-
top: tooltipContentRect.top + tooltipContentRect.height / 2,
|
|
101
|
-
left: tooltipContentRect.left + tooltipContentRect.width + offset,
|
|
102
|
-
transform: 'translateY(-50%)'
|
|
103
|
-
});
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.TooltipWrapper, {
|
|
109
|
-
ref: tooltipContentRef,
|
|
110
|
-
onMouseEnter: function onMouseEnter() {
|
|
111
|
-
if (!disabled && tooltipLabelRef.current && tooltipContentRef.current) {
|
|
112
|
-
var _tooltipLabelRef$curr2 = tooltipLabelRef.current.getBoundingClientRect(),
|
|
113
|
-
left = _tooltipLabelRef$curr2.left,
|
|
114
|
-
width = _tooltipLabelRef$curr2.width,
|
|
115
|
-
height = _tooltipLabelRef$curr2.height;
|
|
116
|
-
var offsetTop = tooltipContentRef.current.getBoundingClientRect().top;
|
|
117
|
-
setShowTooltip(true);
|
|
118
|
-
var repositionRight = left < 0;
|
|
119
|
-
var repositionLeft = left + width >= screen.width - 100;
|
|
120
|
-
var repositionTop = offsetTop + height > screen.height - 200;
|
|
121
|
-
switch (position) {
|
|
122
|
-
case 'right':
|
|
123
|
-
{
|
|
124
|
-
repositionLeft ? refreshTooltipPosition('left') : refreshTooltipPosition('right');
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
case 'left':
|
|
128
|
-
{
|
|
129
|
-
repositionRight ? refreshTooltipPosition('right') : refreshTooltipPosition('left');
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case 'bottom':
|
|
133
|
-
{
|
|
134
|
-
repositionTop ? refreshTooltipPosition('top') : refreshTooltipPosition('bottom');
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
default:
|
|
138
|
-
offsetTop > 150 ? refreshTooltipPosition('top') : refreshTooltipPosition('bottom');
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
onMouseLeave: function onMouseLeave() {
|
|
143
|
-
if (!disabled) {
|
|
144
|
-
setShowTooltip(false);
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
children: [props.children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_ReactPortal.ReactPortal, {
|
|
148
|
-
wrapperId: "tooltip-portal",
|
|
149
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TooltipLabel.TooltipLabel, _objectSpread({
|
|
150
|
-
isVisible: showTooltip,
|
|
151
|
-
ref: tooltipLabelRef,
|
|
152
|
-
tooltipPositions: tooltipPositions,
|
|
153
|
-
showLabelModal: showLabelModal,
|
|
154
|
-
setShowLabelModal: setShowLabelModal,
|
|
155
|
-
setShowTooltip: setShowTooltip,
|
|
156
|
-
maxWidth: maxWidth
|
|
157
|
-
}, props))
|
|
158
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.Modal, {
|
|
159
|
-
open: showLabelModal,
|
|
160
|
-
"aria-hidden": isHidden,
|
|
161
|
-
maxWidth: "465px",
|
|
162
|
-
onClose: function onClose() {
|
|
163
|
-
setShowLabelModal(false);
|
|
164
|
-
setShowTooltip(false);
|
|
165
|
-
},
|
|
166
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Flex.default, {
|
|
167
|
-
direction: "column",
|
|
168
|
-
spacing: "6",
|
|
169
|
-
style: {
|
|
170
|
-
margin: '2em 1.5em',
|
|
171
|
-
color: theme.colors.neutral.black
|
|
172
|
-
},
|
|
173
|
-
children: [props.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
|
|
174
|
-
variant: "outline",
|
|
175
|
-
textColor: "tertiary.focus",
|
|
176
|
-
onClick: function onClick() {
|
|
177
|
-
setShowLabelModal(false);
|
|
178
|
-
setShowTooltip(false);
|
|
179
|
-
},
|
|
180
|
-
children: "Fechar"
|
|
181
|
-
})]
|
|
182
|
-
})
|
|
183
|
-
})]
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
var _default = Tooltip;
|
|
187
|
-
exports.default = _default;
|
|
1
|
+
"use strict";function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _react=require("react"),_TooltipLabel=require("./components/TooltipLabel"),_Button=_interopRequireDefault(require("../Button")),_Flex=_interopRequireDefault(require("../Flex")),_Modal=require("../Modal"),_ReactPortal=require("../ReactPortal"),_theme=require("../../shared/theme"),_styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["position","offset","maxWidth","disabled"];function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var source,i=1;i<arguments.length;i++)source=null==arguments[i]?{}:arguments[i],i%2?ownKeys(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))});return target}function _defineProperty(obj,key,value){return key=_toPropertyKey(key),key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _toPropertyKey(arg){var key=_toPrimitive(arg,"string");return"symbol"===_typeof(key)?key:key+""}function _toPrimitive(input,hint){if("object"!==_typeof(input)||null===input)return input;var prim=input[Symbol.toPrimitive];if(prim!==void 0){var res=prim.call(input,hint||"default");if("object"!==_typeof(res))return res;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===hint?String:Number)(input)}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(o){if("string"==typeof o)return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);return"Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n?Array.from(o):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(o,minLen):void 0}}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _iterableToArrayLimit(arr,i){var _i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _s,_e,_x,_r,_arr=[],_n=!0,_d=!1;try{if(_x=(_i=_i.call(arr)).next,0===i){if(Object(_i)!==_i)return;_n=!1}else for(;!(_n=(_s=_x.call(_i)).done)&&(_arr.push(_s.value),_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{if(!_n&&null!=_i.return&&(_r=_i.return(),Object(_r)!==_r))return}finally{if(_d)throw _e}}return _arr}}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr}function _objectWithoutProperties(source,excluded){if(null==source)return{};var key,i,target=_objectWithoutPropertiesLoose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],0<=excluded.indexOf(key)||Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _objectWithoutPropertiesLoose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],0<=excluded.indexOf(key)||(target[key]=source[key]);return target}var Tooltip=function(_ref){function handleScroll(){showTooltip&&setShowTooltip(!1)}function refreshTooltipPosition(newPosition){if(tooltipContentRef.current){var tooltipContentRect=tooltipContentRef.current.getBoundingClientRect();"top"===newPosition?setTooltipPositions({top:tooltipContentRect.top-tooltipHeight-offset,left:tooltipContentRect.left+tooltipContentRect.width/2,transform:"translate(-50%, 0)"}):"bottom"===newPosition?setTooltipPositions({top:tooltipContentRect.top+tooltipContentRect.height+offset,left:tooltipContentRect.left+tooltipContentRect.width/2,transform:"translateX(-50%)"}):"left"===newPosition?setTooltipPositions({top:tooltipContentRect.top+tooltipContentRect.height/2,left:tooltipContentRect.left-offset,transform:"translate(-100%, -50%)"}):"right"===newPosition?setTooltipPositions({top:tooltipContentRect.top+tooltipContentRect.height/2,left:tooltipContentRect.left+tooltipContentRect.width+offset,transform:"translateY(-50%)"}):void 0}}var _tooltipLabelRef$curr,_ref$position=_ref.position,position=void 0===_ref$position?"bottom":_ref$position,_ref$offset=_ref.offset,offset=void 0===_ref$offset?10:_ref$offset,_ref$maxWidth=_ref.maxWidth,maxWidth=void 0===_ref$maxWidth?250:_ref$maxWidth,disabled=_ref.disabled,props=_objectWithoutProperties(_ref,_excluded),_useTheme=(0,_theme.useTheme)(),theme=_useTheme.theme,_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),showTooltip=_useState2[0],setShowTooltip=_useState2[1],_useState3=(0,_react.useState)(!1),_useState4=_slicedToArray(_useState3,2),showLabelModal=_useState4[0],setShowLabelModal=_useState4[1],_useState5=(0,_react.useState)({top:0,left:0,transform:""}),_useState6=_slicedToArray(_useState5,2),tooltipPositions=_useState6[0],setTooltipPositions=_useState6[1],tooltipContentRef=(0,_react.useRef)(null),tooltipLabelRef=(0,_react.useRef)(null),tooltipHeight=(null===(_tooltipLabelRef$curr=tooltipLabelRef.current)||void 0===_tooltipLabelRef$curr?void 0:_tooltipLabelRef$curr.getBoundingClientRect().height)||0;return(0,_react.useEffect)(function(){return window.addEventListener("scroll",handleScroll),function(){window.removeEventListener("scroll",handleScroll)}},[showTooltip]),/*#__PURE__*/(0,_jsxRuntime.jsxs)(_styles.TooltipWrapper,{ref:tooltipContentRef,onMouseEnter:function onMouseEnter(){if(!disabled&&tooltipLabelRef.current&&tooltipContentRef.current){var _tooltipLabelRef$curr2=tooltipLabelRef.current.getBoundingClientRect(),left=_tooltipLabelRef$curr2.left,width=_tooltipLabelRef$curr2.width,height=_tooltipLabelRef$curr2.height,offsetTop=tooltipContentRef.current.getBoundingClientRect().top;setShowTooltip(!0);var repositionLeft=left+width>=screen.width-100,repositionTop=offsetTop+height>screen.height-200;switch(position){case"right":{repositionLeft?refreshTooltipPosition("left"):refreshTooltipPosition("right");break}case"left":{0>left?refreshTooltipPosition("right"):refreshTooltipPosition("left");break}case"bottom":{repositionTop?refreshTooltipPosition("top"):refreshTooltipPosition("bottom");break}default:150<offsetTop?refreshTooltipPosition("top"):refreshTooltipPosition("bottom");}}},onMouseLeave:function onMouseLeave(){disabled||setShowTooltip(!1)},children:[props.children,/*#__PURE__*/(0,_jsxRuntime.jsx)(_ReactPortal.ReactPortal,{wrapperId:"tooltip-portal",children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_TooltipLabel.TooltipLabel,_objectSpread({isVisible:showTooltip,ref:tooltipLabelRef,tooltipPositions:tooltipPositions,showLabelModal:showLabelModal,setShowLabelModal:setShowLabelModal,setShowTooltip:setShowTooltip,maxWidth:maxWidth},props))}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_Modal.Modal,{open:showLabelModal,"aria-hidden":!showLabelModal,maxWidth:"465px",onClose:function onClose(){setShowLabelModal(!1),setShowTooltip(!1)},children:/*#__PURE__*/(0,_jsxRuntime.jsxs)(_Flex.default,{direction:"column",spacing:"6",style:{margin:"2em 1.5em",color:theme.colors.neutral.black},children:[props.label,/*#__PURE__*/(0,_jsxRuntime.jsx)(_Button.default,{variant:"outline",textColor:"tertiary.focus",onClick:function onClick(){setShowLabelModal(!1),setShowTooltip(!1)},children:"Fechar"})]})})]})},_default=Tooltip;exports.default=_default;
|