@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,169 +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.EmotePicker = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _framerMotion = require("framer-motion");
|
|
10
|
-
var _EmotePickerData = require("./EmotePickerData");
|
|
11
|
-
var _useBreakpoints2 = require("../../shared/hooks/useBreakpoints");
|
|
12
|
-
var _useOnClickOutside = require("../../shared/hooks/useOnClickOutside");
|
|
13
|
-
var _styles = require("./styles");
|
|
14
|
-
var _animation = require("./animation");
|
|
15
|
-
var _opacityAnimation = require("../../shared/animations/opacityAnimation");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
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; }
|
|
20
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
-
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); }
|
|
22
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
|
-
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."); }
|
|
24
|
-
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); }
|
|
25
|
-
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; }
|
|
26
|
-
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; } }
|
|
27
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* eslint-disable no-console */
|
|
28
|
-
var MODAL_HEIGHT = 273;
|
|
29
|
-
var MODAL_WIDTH = 503;
|
|
30
|
-
var GAP = 10;
|
|
31
|
-
var EmotePicker = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
32
|
-
var onClick = _ref.onClick,
|
|
33
|
-
_ref$mobileVariant = _ref.mobileVariant,
|
|
34
|
-
mobileVariant = _ref$mobileVariant === void 0 ? 'default' : _ref$mobileVariant,
|
|
35
|
-
_ref$modalPosition = _ref.modalPosition,
|
|
36
|
-
modalPosition = _ref$modalPosition === void 0 ? 'top-right' : _ref$modalPosition;
|
|
37
|
-
var _useBreakpoints = (0, _useBreakpoints2.useBreakpoints)(),
|
|
38
|
-
breakpointPicker = _useBreakpoints.breakpointPicker;
|
|
39
|
-
var _useState = (0, _react.useState)(false),
|
|
40
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
41
|
-
isOpenEmotePicker = _useState2[0],
|
|
42
|
-
setIsOpenEmotePicker = _useState2[1];
|
|
43
|
-
var _useState3 = (0, _react.useState)(0),
|
|
44
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
45
|
-
left = _useState4[0],
|
|
46
|
-
setLeft = _useState4[1];
|
|
47
|
-
var _useState5 = (0, _react.useState)('unset'),
|
|
48
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
49
|
-
right = _useState6[0],
|
|
50
|
-
setRight = _useState6[1];
|
|
51
|
-
var _useState7 = (0, _react.useState)(0),
|
|
52
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
53
|
-
top = _useState8[0],
|
|
54
|
-
setTop = _useState8[1];
|
|
55
|
-
(0, _react.useImperativeHandle)(ref, function () {
|
|
56
|
-
return {
|
|
57
|
-
handleOpen: handleOpen,
|
|
58
|
-
repositionByElement: repositionByElement
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
function handleOpen() {
|
|
62
|
-
setIsOpenEmotePicker(!isOpenEmotePicker);
|
|
63
|
-
}
|
|
64
|
-
var modalDesktopRef = (0, _react.useRef)(null);
|
|
65
|
-
var triggerRef = (0, _react.useRef)(null);
|
|
66
|
-
var overlayMobileRef = (0, _react.useRef)(null);
|
|
67
|
-
var emotePickerMobileRef = (0, _react.useRef)(null);
|
|
68
|
-
(0, _useOnClickOutside.useOnClickOutside)([modalDesktopRef, triggerRef, overlayMobileRef, emotePickerMobileRef], function () {
|
|
69
|
-
setIsOpenEmotePicker(false);
|
|
70
|
-
});
|
|
71
|
-
function isOverflowWidth(offsetValue) {
|
|
72
|
-
return offsetValue < MODAL_WIDTH;
|
|
73
|
-
}
|
|
74
|
-
function handleModalPosition() {
|
|
75
|
-
var _triggerRef$current;
|
|
76
|
-
if (!triggerRef.current) return;
|
|
77
|
-
var triggerRects = (_triggerRef$current = triggerRef.current) === null || _triggerRef$current === void 0 ? void 0 : _triggerRef$current.getBoundingClientRect();
|
|
78
|
-
var modalIsInTop = modalPosition.includes('top');
|
|
79
|
-
var modalIsInRight = modalPosition.includes('right');
|
|
80
|
-
if (modalIsInRight) {
|
|
81
|
-
var rectRight = window.innerWidth - triggerRects.right + triggerRects.width;
|
|
82
|
-
var offsetRight = isOverflowWidth(rectRight) ? rectRight : rectRight - MODAL_WIDTH - GAP;
|
|
83
|
-
setLeft('unset');
|
|
84
|
-
setRight(offsetRight);
|
|
85
|
-
} else {
|
|
86
|
-
var offsetLeft = isOverflowWidth(triggerRects.left) ? triggerRects.left : triggerRects.left - MODAL_WIDTH + triggerRects.width;
|
|
87
|
-
setRight('unset');
|
|
88
|
-
setLeft(offsetLeft);
|
|
89
|
-
}
|
|
90
|
-
if (modalIsInTop) {
|
|
91
|
-
var shouldRepositionToBottom = triggerRects.top < MODAL_HEIGHT;
|
|
92
|
-
if (shouldRepositionToBottom) {
|
|
93
|
-
setTop(triggerRects.height + triggerRects.top + GAP);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
setTop(triggerRects.top - MODAL_HEIGHT);
|
|
97
|
-
} else {
|
|
98
|
-
var triggerOffsetBottom = window.innerHeight - triggerRects.bottom - GAP;
|
|
99
|
-
var shouldRepositionToTop = triggerOffsetBottom < MODAL_HEIGHT;
|
|
100
|
-
if (shouldRepositionToTop) {
|
|
101
|
-
setTop(triggerRects.top - MODAL_HEIGHT - GAP);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
setTop(triggerRects.height + triggerRects.top + GAP);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function repositionByElement(event) {
|
|
108
|
-
handleOpen();
|
|
109
|
-
triggerRef.current = event.currentTarget;
|
|
110
|
-
handleModalPosition();
|
|
111
|
-
}
|
|
112
|
-
(0, _react.useEffect)(function () {
|
|
113
|
-
function handler() {
|
|
114
|
-
setIsOpenEmotePicker(false);
|
|
115
|
-
}
|
|
116
|
-
if (isOpenEmotePicker) {
|
|
117
|
-
var _document;
|
|
118
|
-
(_document = document) === null || _document === void 0 ? void 0 : _document.addEventListener('scroll', handler);
|
|
119
|
-
} else {
|
|
120
|
-
var _document2;
|
|
121
|
-
(_document2 = document) === null || _document2 === void 0 ? void 0 : _document2.removeEventListener('scroll', handler);
|
|
122
|
-
}
|
|
123
|
-
return function () {
|
|
124
|
-
var _document3;
|
|
125
|
-
return (_document3 = document) === null || _document3 === void 0 ? void 0 : _document3.removeEventListener('scroll', handler);
|
|
126
|
-
};
|
|
127
|
-
}, [isOpenEmotePicker]);
|
|
128
|
-
(0, _react.useEffect)(function () {
|
|
129
|
-
handleModalPosition();
|
|
130
|
-
}, [modalPosition]);
|
|
131
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
132
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
133
|
-
mode: "wait",
|
|
134
|
-
children: isOpenEmotePicker && breakpointPicker({
|
|
135
|
-
base: mobileVariant === 'default' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_framerMotion.motion.div, _objectSpread(_objectSpread({
|
|
136
|
-
ref: emotePickerMobileRef
|
|
137
|
-
}, _animation.emotePickerMobileAnimation), {}, {
|
|
138
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmotePickerData.EmotePickerData, {
|
|
139
|
-
onClick: onClick
|
|
140
|
-
})
|
|
141
|
-
}), "emote-picker-mobile") : /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.EmotePickerMobileContainer, _objectSpread(_objectSpread({
|
|
142
|
-
ref: emotePickerMobileRef
|
|
143
|
-
}, _opacityAnimation.opacityAnimation), {}, {
|
|
144
|
-
onClick: function onClick(event) {
|
|
145
|
-
if (event.target === event.currentTarget) {
|
|
146
|
-
setIsOpenEmotePicker(false);
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmotePickerData.EmotePickerData, {
|
|
150
|
-
onClick: onClick
|
|
151
|
-
})
|
|
152
|
-
}), "emote-picker-mobile-fixed"),
|
|
153
|
-
lg: /*#__PURE__*/(0, _react.createElement)(_styles.EmotePickerDesktopContainer, _objectSpread(_objectSpread({}, _animation.modalAnimation), {}, {
|
|
154
|
-
ref: modalDesktopRef,
|
|
155
|
-
key: "emote-picker",
|
|
156
|
-
style: {
|
|
157
|
-
top: top,
|
|
158
|
-
left: left,
|
|
159
|
-
right: right
|
|
160
|
-
}
|
|
161
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmotePickerData.EmotePickerData, {
|
|
162
|
-
onClick: onClick
|
|
163
|
-
}))
|
|
164
|
-
})
|
|
165
|
-
})
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
exports.EmotePicker = EmotePicker;
|
|
169
|
-
EmotePicker.displayName = 'EmotePicker';
|
|
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.EmotePicker=void 0;var _react=require("react"),_framerMotion=require("framer-motion"),_EmotePickerData=require("./EmotePickerData"),_useBreakpoints2=require("../../shared/hooks/useBreakpoints"),_useOnClickOutside=require("../../shared/hooks/useOnClickOutside"),_styles=require("./styles"),_animation=require("./animation"),_opacityAnimation=require("../../shared/animations/opacityAnimation"),_jsxRuntime=require("react/jsx-runtime");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}/* eslint-disable no-console */var MODAL_HEIGHT=273,MODAL_WIDTH=503,GAP=10,EmotePicker=/*#__PURE__*/(0,_react.forwardRef)(function(_ref,ref){function handleOpen(){setIsOpenEmotePicker(!isOpenEmotePicker)}function isOverflowWidth(offsetValue){return offsetValue<MODAL_WIDTH}function handleModalPosition(){var _triggerRef$current;if(triggerRef.current){var triggerRects=null===(_triggerRef$current=triggerRef.current)||void 0===_triggerRef$current?void 0:_triggerRef$current.getBoundingClientRect(),modalIsInTop=modalPosition.includes("top"),modalIsInRight=modalPosition.includes("right");if(modalIsInRight){var rectRight=window.innerWidth-triggerRects.right+triggerRects.width,offsetRight=isOverflowWidth(rectRight)?rectRight:rectRight-MODAL_WIDTH-GAP;setLeft("unset"),setRight(offsetRight)}else{var offsetLeft=isOverflowWidth(triggerRects.left)?triggerRects.left:triggerRects.left-MODAL_WIDTH+triggerRects.width;setRight("unset"),setLeft(offsetLeft)}if(modalIsInTop){var shouldRepositionToBottom=triggerRects.top<MODAL_HEIGHT;if(shouldRepositionToBottom)return void setTop(triggerRects.height+triggerRects.top+GAP);setTop(triggerRects.top-MODAL_HEIGHT)}else{var triggerOffsetBottom=window.innerHeight-triggerRects.bottom-GAP;if(triggerOffsetBottom<MODAL_HEIGHT)return void setTop(triggerRects.top-MODAL_HEIGHT-GAP);setTop(triggerRects.height+triggerRects.top+GAP)}}}function repositionByElement(event){handleOpen(),triggerRef.current=event.currentTarget,handleModalPosition()}var onClick=_ref.onClick,_ref$mobileVariant=_ref.mobileVariant,mobileVariant=void 0===_ref$mobileVariant?"default":_ref$mobileVariant,_ref$modalPosition=_ref.modalPosition,modalPosition=void 0===_ref$modalPosition?"top-right":_ref$modalPosition,_useBreakpoints=(0,_useBreakpoints2.useBreakpoints)(),breakpointPicker=_useBreakpoints.breakpointPicker,_useState=(0,_react.useState)(!1),_useState2=_slicedToArray(_useState,2),isOpenEmotePicker=_useState2[0],setIsOpenEmotePicker=_useState2[1],_useState3=(0,_react.useState)(0),_useState4=_slicedToArray(_useState3,2),left=_useState4[0],setLeft=_useState4[1],_useState5=(0,_react.useState)("unset"),_useState6=_slicedToArray(_useState5,2),right=_useState6[0],setRight=_useState6[1],_useState7=(0,_react.useState)(0),_useState8=_slicedToArray(_useState7,2),top=_useState8[0],setTop=_useState8[1];(0,_react.useImperativeHandle)(ref,function(){return{handleOpen:handleOpen,repositionByElement:repositionByElement}});var modalDesktopRef=(0,_react.useRef)(null),triggerRef=(0,_react.useRef)(null),overlayMobileRef=(0,_react.useRef)(null),emotePickerMobileRef=(0,_react.useRef)(null);return(0,_useOnClickOutside.useOnClickOutside)([modalDesktopRef,triggerRef,overlayMobileRef,emotePickerMobileRef],function(){setIsOpenEmotePicker(!1)}),(0,_react.useEffect)(function(){function handler(){setIsOpenEmotePicker(!1)}if(isOpenEmotePicker){var _document;null===(_document=document)||void 0===_document?void 0:_document.addEventListener("scroll",handler)}else{var _document2;null===(_document2=document)||void 0===_document2?void 0:_document2.removeEventListener("scroll",handler)}return function(){var _document3;return null===(_document3=document)||void 0===_document3?void 0:_document3.removeEventListener("scroll",handler)}},[isOpenEmotePicker]),(0,_react.useEffect)(function(){handleModalPosition()},[modalPosition]),/*#__PURE__*/(0,_jsxRuntime.jsx)(_jsxRuntime.Fragment,{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.AnimatePresence,{mode:"wait",children:isOpenEmotePicker&&breakpointPicker({base:"default"===mobileVariant?/*#__PURE__*/(0,_jsxRuntime.jsx)(_framerMotion.motion.div,_objectSpread(_objectSpread({ref:emotePickerMobileRef},_animation.emotePickerMobileAnimation),{},{children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_EmotePickerData.EmotePickerData,{onClick:onClick})}),"emote-picker-mobile"):/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.EmotePickerMobileContainer,_objectSpread(_objectSpread({ref:emotePickerMobileRef},_opacityAnimation.opacityAnimation),{},{onClick:function(event){event.target===event.currentTarget&&setIsOpenEmotePicker(!1)},children:/*#__PURE__*/(0,_jsxRuntime.jsx)(_EmotePickerData.EmotePickerData,{onClick:onClick})}),"emote-picker-mobile-fixed"),lg:/*#__PURE__*/(0,_react.createElement)(_styles.EmotePickerDesktopContainer,_objectSpread(_objectSpread({},_animation.modalAnimation),{},{ref:modalDesktopRef,key:"emote-picker",style:{top:top,left:left,right:right}}),/*#__PURE__*/(0,_jsxRuntime.jsx)(_EmotePickerData.EmotePickerData,{onClick:onClick}))})})})});exports.EmotePicker=EmotePicker,EmotePicker.displayName="EmotePicker";
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.EmotePickerMobileContainer = exports.EmotePickerDesktopContainer = void 0;
|
|
7
|
-
var _framerMotion = require("framer-motion");
|
|
8
|
-
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
|
-
var _templateObject, _templateObject2;
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
-
var EmotePickerDesktopContainer = (0, _styled.default)(_framerMotion.motion.div)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: 0.5rem;\n position: fixed;\n z-index: ", ";\n"])), function (_ref) {
|
|
13
|
-
var theme = _ref.theme;
|
|
14
|
-
return theme.zIndex.level8;
|
|
15
|
-
});
|
|
16
|
-
exports.EmotePickerDesktopContainer = EmotePickerDesktopContainer;
|
|
17
|
-
var EmotePickerMobileContainer = (0, _styled.default)(_framerMotion.motion.div)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: fixed;\n z-index: ", ";\n\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.1);\n display: flex;\n padding: 1rem 1rem 0 1rem;\n\n justify-content: center;\n align-items: end;\n\n .emote_picker_container {\n border-radius: 0.5rem 0.5rem 0 0 !important;\n }\n"])), function (_ref2) {
|
|
18
|
-
var theme = _ref2.theme;
|
|
19
|
-
return theme.zIndex.level24;
|
|
20
|
-
});
|
|
21
|
-
exports.EmotePickerMobileContainer = EmotePickerMobileContainer;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EmotePickerMobileContainer=exports.EmotePickerDesktopContainer=void 0;var _templateObject,_templateObject2,_framerMotion=require("framer-motion"),_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 EmotePickerDesktopContainer=(0,_styled.default)(_framerMotion.motion.div)(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n border-radius: 0.5rem;\n position: fixed;\n z-index: ",";\n"])),function(_ref){var theme=_ref.theme;return theme.zIndex.level8});exports.EmotePickerDesktopContainer=EmotePickerDesktopContainer;var EmotePickerMobileContainer=(0,_styled.default)(_framerMotion.motion.div)(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n position: fixed;\n z-index: ",";\n\n height: 100%;\n width: 100%;\n background: rgba(0, 0, 0, 0.1);\n display: flex;\n padding: 1rem 1rem 0 1rem;\n\n justify-content: center;\n align-items: end;\n\n .emote_picker_container {\n border-radius: 0.5rem 0.5rem 0 0 !important;\n }\n"])),function(_ref2){var theme=_ref2.theme;return theme.zIndex.level24});exports.EmotePickerMobileContainer=EmotePickerMobileContainer;
|
|
@@ -1,336 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _testUtils = require("../../shared/tests/test-utils");
|
|
4
|
-
require("@testing-library/jest-dom");
|
|
5
|
-
var _ = _interopRequireDefault(require("."));
|
|
6
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
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); }
|
|
9
|
-
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; }
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
-
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); }
|
|
14
|
-
var setup = function setup(props, children) {
|
|
15
|
-
var utils = (0, _testUtils.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
16
|
-
children: children
|
|
17
|
-
})));
|
|
18
|
-
return utils;
|
|
19
|
-
};
|
|
20
|
-
describe('Flex', function () {
|
|
21
|
-
it('should it render the flex component', function () {
|
|
22
|
-
var _setup = setup({
|
|
23
|
-
direction: 'row'
|
|
24
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
25
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
26
|
-
children: "1"
|
|
27
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
28
|
-
children: "2"
|
|
29
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
30
|
-
children: "3"
|
|
31
|
-
})]
|
|
32
|
-
})),
|
|
33
|
-
container = _setup.container;
|
|
34
|
-
expect(container).toBeInTheDocument();
|
|
35
|
-
});
|
|
36
|
-
it('should it render the flex component with breakpoints on direction prop', function () {
|
|
37
|
-
var _setup2 = setup({
|
|
38
|
-
direction: {
|
|
39
|
-
base: 'column',
|
|
40
|
-
sm: 'row',
|
|
41
|
-
md: 'row-reverse',
|
|
42
|
-
lg: 'column-reverse'
|
|
43
|
-
}
|
|
44
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
45
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
46
|
-
children: "1"
|
|
47
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
48
|
-
children: "2"
|
|
49
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
50
|
-
children: "3"
|
|
51
|
-
})]
|
|
52
|
-
})),
|
|
53
|
-
container = _setup2.container;
|
|
54
|
-
expect(container).toBeInTheDocument();
|
|
55
|
-
});
|
|
56
|
-
it('should it render the flex component with breakpoints on alignItems prop', function () {
|
|
57
|
-
var _setup3 = setup({
|
|
58
|
-
alignItems: {
|
|
59
|
-
base: 'baseline',
|
|
60
|
-
sm: 'center',
|
|
61
|
-
md: 'flex-end',
|
|
62
|
-
lg: 'flex-start'
|
|
63
|
-
}
|
|
64
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
65
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
66
|
-
children: "1"
|
|
67
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
68
|
-
children: "2"
|
|
69
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
70
|
-
children: "3"
|
|
71
|
-
})]
|
|
72
|
-
})),
|
|
73
|
-
container = _setup3.container;
|
|
74
|
-
expect(container).toBeInTheDocument();
|
|
75
|
-
});
|
|
76
|
-
it('should it render the flex component with breakpoints on justifyContent prop', function () {
|
|
77
|
-
var _setup4 = setup({
|
|
78
|
-
justifyContent: {
|
|
79
|
-
base: 'space-between',
|
|
80
|
-
sm: 'center',
|
|
81
|
-
md: 'flex-end',
|
|
82
|
-
lg: 'flex-start'
|
|
83
|
-
}
|
|
84
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
85
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
86
|
-
children: "1"
|
|
87
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
88
|
-
children: "2"
|
|
89
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
-
children: "3"
|
|
91
|
-
})]
|
|
92
|
-
})),
|
|
93
|
-
container = _setup4.container;
|
|
94
|
-
expect(container).toBeInTheDocument();
|
|
95
|
-
});
|
|
96
|
-
it('should it render the flex component with breakpoints on alignContent prop', function () {
|
|
97
|
-
var _setup5 = setup({
|
|
98
|
-
alignContent: {
|
|
99
|
-
base: 'space-between',
|
|
100
|
-
sm: 'center',
|
|
101
|
-
md: 'flex-end',
|
|
102
|
-
lg: 'flex-start'
|
|
103
|
-
}
|
|
104
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
105
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
106
|
-
children: "1"
|
|
107
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
108
|
-
children: "2"
|
|
109
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
110
|
-
children: "3"
|
|
111
|
-
})]
|
|
112
|
-
})),
|
|
113
|
-
container = _setup5.container;
|
|
114
|
-
expect(container).toBeInTheDocument();
|
|
115
|
-
});
|
|
116
|
-
it('should it render the flex component with breakpoints on alignSelf prop', function () {
|
|
117
|
-
var _setup6 = setup({
|
|
118
|
-
alignSelf: {
|
|
119
|
-
base: 'baseline',
|
|
120
|
-
sm: 'center',
|
|
121
|
-
md: 'flex-end',
|
|
122
|
-
lg: 'flex-start'
|
|
123
|
-
}
|
|
124
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
125
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
126
|
-
children: "1"
|
|
127
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
128
|
-
children: "2"
|
|
129
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
130
|
-
children: "3"
|
|
131
|
-
})]
|
|
132
|
-
})),
|
|
133
|
-
container = _setup6.container;
|
|
134
|
-
expect(container).toBeInTheDocument();
|
|
135
|
-
});
|
|
136
|
-
it('should it render the flex component with breakpoints on justifySelf prop', function () {
|
|
137
|
-
var _setup7 = setup({
|
|
138
|
-
justifySelf: {
|
|
139
|
-
base: 'baseline',
|
|
140
|
-
sm: 'center',
|
|
141
|
-
md: 'flex-end',
|
|
142
|
-
lg: 'flex-start'
|
|
143
|
-
}
|
|
144
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
145
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
146
|
-
children: "1"
|
|
147
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
148
|
-
children: "2"
|
|
149
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
150
|
-
children: "3"
|
|
151
|
-
})]
|
|
152
|
-
})),
|
|
153
|
-
container = _setup7.container;
|
|
154
|
-
expect(container).toBeInTheDocument();
|
|
155
|
-
});
|
|
156
|
-
it('should it render the flex component with breakpoints on spacing prop', function () {
|
|
157
|
-
var _setup8 = setup({
|
|
158
|
-
spacing: {
|
|
159
|
-
base: 4,
|
|
160
|
-
sm: 8,
|
|
161
|
-
md: 12,
|
|
162
|
-
lg: 20
|
|
163
|
-
}
|
|
164
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
165
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
166
|
-
children: "1"
|
|
167
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
168
|
-
children: "2"
|
|
169
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
170
|
-
children: "3"
|
|
171
|
-
})]
|
|
172
|
-
})),
|
|
173
|
-
container = _setup8.container;
|
|
174
|
-
expect(container).toBeInTheDocument();
|
|
175
|
-
});
|
|
176
|
-
it('should it render the flex component with breakpoints on wrap prop', function () {
|
|
177
|
-
var _setup9 = setup({
|
|
178
|
-
wrap: {
|
|
179
|
-
base: 'wrap',
|
|
180
|
-
sm: 'wrap-reverse',
|
|
181
|
-
md: 'nowrap',
|
|
182
|
-
lg: 'wrap'
|
|
183
|
-
}
|
|
184
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
185
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
186
|
-
children: "1"
|
|
187
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
188
|
-
children: "2"
|
|
189
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
190
|
-
children: "3"
|
|
191
|
-
})]
|
|
192
|
-
})),
|
|
193
|
-
container = _setup9.container;
|
|
194
|
-
expect(container).toBeInTheDocument();
|
|
195
|
-
});
|
|
196
|
-
it('should it render the flex component with breakpoints on grow prop', function () {
|
|
197
|
-
var _setup10 = setup({
|
|
198
|
-
grow: {
|
|
199
|
-
base: '1',
|
|
200
|
-
sm: '2',
|
|
201
|
-
md: '3',
|
|
202
|
-
lg: '4'
|
|
203
|
-
}
|
|
204
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
205
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
206
|
-
children: "1"
|
|
207
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
208
|
-
children: "2"
|
|
209
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
210
|
-
children: "3"
|
|
211
|
-
})]
|
|
212
|
-
})),
|
|
213
|
-
container = _setup10.container;
|
|
214
|
-
expect(container).toBeInTheDocument();
|
|
215
|
-
});
|
|
216
|
-
it('should it render the flex component with breakpoints on shrink prop', function () {
|
|
217
|
-
var _setup11 = setup({
|
|
218
|
-
shrink: {
|
|
219
|
-
base: '1',
|
|
220
|
-
sm: '2',
|
|
221
|
-
md: '3',
|
|
222
|
-
lg: '4'
|
|
223
|
-
}
|
|
224
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
225
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
226
|
-
children: "1"
|
|
227
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
228
|
-
children: "2"
|
|
229
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
230
|
-
children: "3"
|
|
231
|
-
})]
|
|
232
|
-
})),
|
|
233
|
-
container = _setup11.container;
|
|
234
|
-
expect(container).toBeInTheDocument();
|
|
235
|
-
});
|
|
236
|
-
it('should it render the flex component with breakpoints on basis prop', function () {
|
|
237
|
-
var _setup12 = setup({
|
|
238
|
-
basis: {
|
|
239
|
-
base: '100%',
|
|
240
|
-
sm: '100%',
|
|
241
|
-
md: '50%',
|
|
242
|
-
lg: '25%'
|
|
243
|
-
}
|
|
244
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
245
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
246
|
-
children: "1"
|
|
247
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
248
|
-
children: "2"
|
|
249
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
250
|
-
children: "3"
|
|
251
|
-
})]
|
|
252
|
-
})),
|
|
253
|
-
container = _setup12.container;
|
|
254
|
-
expect(container).toBeInTheDocument();
|
|
255
|
-
});
|
|
256
|
-
it('should it render the flex component with breakpoints on all props', function () {
|
|
257
|
-
var _setup13 = setup({
|
|
258
|
-
direction: {
|
|
259
|
-
base: 'column',
|
|
260
|
-
sm: 'row',
|
|
261
|
-
md: 'row-reverse',
|
|
262
|
-
lg: 'column-reverse'
|
|
263
|
-
},
|
|
264
|
-
alignItems: {
|
|
265
|
-
base: 'baseline',
|
|
266
|
-
sm: 'center',
|
|
267
|
-
md: 'flex-end',
|
|
268
|
-
lg: 'flex-start'
|
|
269
|
-
},
|
|
270
|
-
justifyContent: {
|
|
271
|
-
base: 'space-between',
|
|
272
|
-
sm: 'center',
|
|
273
|
-
md: 'flex-end',
|
|
274
|
-
lg: 'flex-start'
|
|
275
|
-
},
|
|
276
|
-
alignContent: {
|
|
277
|
-
base: 'space-between',
|
|
278
|
-
sm: 'center',
|
|
279
|
-
md: 'flex-end',
|
|
280
|
-
lg: 'flex-start'
|
|
281
|
-
},
|
|
282
|
-
alignSelf: {
|
|
283
|
-
base: 'baseline',
|
|
284
|
-
sm: 'center',
|
|
285
|
-
md: 'flex-end',
|
|
286
|
-
lg: 'flex-start'
|
|
287
|
-
},
|
|
288
|
-
justifySelf: {
|
|
289
|
-
base: 'baseline',
|
|
290
|
-
sm: 'center',
|
|
291
|
-
md: 'flex-end',
|
|
292
|
-
lg: 'flex-start'
|
|
293
|
-
},
|
|
294
|
-
spacing: {
|
|
295
|
-
base: 4,
|
|
296
|
-
sm: 8,
|
|
297
|
-
md: 12,
|
|
298
|
-
lg: 20
|
|
299
|
-
},
|
|
300
|
-
wrap: {
|
|
301
|
-
base: 'wrap',
|
|
302
|
-
sm: 'wrap-reverse',
|
|
303
|
-
md: 'nowrap',
|
|
304
|
-
lg: 'wrap'
|
|
305
|
-
},
|
|
306
|
-
grow: {
|
|
307
|
-
base: '1',
|
|
308
|
-
sm: '2',
|
|
309
|
-
md: '3',
|
|
310
|
-
lg: '4'
|
|
311
|
-
},
|
|
312
|
-
shrink: {
|
|
313
|
-
base: '1',
|
|
314
|
-
sm: '2',
|
|
315
|
-
md: '3',
|
|
316
|
-
lg: '4'
|
|
317
|
-
},
|
|
318
|
-
basis: {
|
|
319
|
-
base: '100%',
|
|
320
|
-
sm: '100%',
|
|
321
|
-
md: '50%',
|
|
322
|
-
lg: '25%'
|
|
323
|
-
}
|
|
324
|
-
}, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
325
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
326
|
-
children: "1"
|
|
327
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
328
|
-
children: "2"
|
|
329
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
330
|
-
children: "3"
|
|
331
|
-
})]
|
|
332
|
-
})),
|
|
333
|
-
container = _setup13.container;
|
|
334
|
-
expect(container).toBeInTheDocument();
|
|
335
|
-
});
|
|
336
|
-
});
|
|
1
|
+
"use strict";var _testUtils=require("../../shared/tests/test-utils");require("@testing-library/jest-dom");var _=_interopRequireDefault(require(".")),_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,children){var utils=(0,_testUtils.render)(/*#__PURE__*/(0,_jsxRuntime.jsx)(_.default,_objectSpread(_objectSpread({},props),{},{children:children})));return utils};describe("Flex",function(){it("should it render the flex component",function(){var _setup=setup({direction:"row"},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on direction prop",function(){var _setup2=setup({direction:{base:"column",sm:"row",md:"row-reverse",lg:"column-reverse"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup2.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on alignItems prop",function(){var _setup3=setup({alignItems:{base:"baseline",sm:"center",md:"flex-end",lg:"flex-start"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup3.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on justifyContent prop",function(){var _setup4=setup({justifyContent:{base:"space-between",sm:"center",md:"flex-end",lg:"flex-start"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup4.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on alignContent prop",function(){var _setup5=setup({alignContent:{base:"space-between",sm:"center",md:"flex-end",lg:"flex-start"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup5.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on alignSelf prop",function(){var _setup6=setup({alignSelf:{base:"baseline",sm:"center",md:"flex-end",lg:"flex-start"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup6.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on justifySelf prop",function(){var _setup7=setup({justifySelf:{base:"baseline",sm:"center",md:"flex-end",lg:"flex-start"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup7.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on spacing prop",function(){var _setup8=setup({spacing:{base:4,sm:8,md:12,lg:20}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup8.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on wrap prop",function(){var _setup9=setup({wrap:{base:"wrap",sm:"wrap-reverse",md:"nowrap",lg:"wrap"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup9.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on grow prop",function(){var _setup10=setup({grow:{base:"1",sm:"2",md:"3",lg:"4"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup10.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on shrink prop",function(){var _setup11=setup({shrink:{base:"1",sm:"2",md:"3",lg:"4"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup11.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on basis prop",function(){var _setup12=setup({basis:{base:"100%",sm:"100%",md:"50%",lg:"25%"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup12.container;expect(container).toBeInTheDocument()}),it("should it render the flex component with breakpoints on all props",function(){var _setup13=setup({direction:{base:"column",sm:"row",md:"row-reverse",lg:"column-reverse"},alignItems:{base:"baseline",sm:"center",md:"flex-end",lg:"flex-start"},justifyContent:{base:"space-between",sm:"center",md:"flex-end",lg:"flex-start"},alignContent:{base:"space-between",sm:"center",md:"flex-end",lg:"flex-start"},alignSelf:{base:"baseline",sm:"center",md:"flex-end",lg:"flex-start"},justifySelf:{base:"baseline",sm:"center",md:"flex-end",lg:"flex-start"},spacing:{base:4,sm:8,md:12,lg:20},wrap:{base:"wrap",sm:"wrap-reverse",md:"nowrap",lg:"wrap"},grow:{base:"1",sm:"2",md:"3",lg:"4"},shrink:{base:"1",sm:"2",md:"3",lg:"4"},basis:{base:"100%",sm:"100%",md:"50%",lg:"25%"}},/*#__PURE__*/(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"1"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"2"}),/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{children:"3"})]})),container=_setup13.container;expect(container).toBeInTheDocument()})});
|
|
@@ -1,49 +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 _styles = require("./styles");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
var _excluded = ["basis", "children", "direction", "grow", "alignItems", "alignContent", "justifyContent", "alignSelf", "justifySelf", "shrink", "spacing", "wrap"];
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
var Flex = function Flex(_ref) {
|
|
19
|
-
var basis = _ref.basis,
|
|
20
|
-
children = _ref.children,
|
|
21
|
-
direction = _ref.direction,
|
|
22
|
-
grow = _ref.grow,
|
|
23
|
-
alignItems = _ref.alignItems,
|
|
24
|
-
alignContent = _ref.alignContent,
|
|
25
|
-
justifyContent = _ref.justifyContent,
|
|
26
|
-
alignSelf = _ref.alignSelf,
|
|
27
|
-
justifySelf = _ref.justifySelf,
|
|
28
|
-
shrink = _ref.shrink,
|
|
29
|
-
spacing = _ref.spacing,
|
|
30
|
-
wrap = _ref.wrap,
|
|
31
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.StyledFlexContainer, _objectSpread(_objectSpread({
|
|
33
|
-
alignItems: alignItems,
|
|
34
|
-
alignSelf: alignSelf,
|
|
35
|
-
basis: basis,
|
|
36
|
-
flexDirection: direction,
|
|
37
|
-
grow: grow,
|
|
38
|
-
justifyContent: justifyContent,
|
|
39
|
-
justifySelf: justifySelf,
|
|
40
|
-
shrink: shrink,
|
|
41
|
-
spacing: spacing,
|
|
42
|
-
wrap: wrap,
|
|
43
|
-
alignContent: alignContent
|
|
44
|
-
}, rest), {}, {
|
|
45
|
-
children: children
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
48
|
-
var _default = Flex;
|
|
49
|
-
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 _styles=require("./styles"),_jsxRuntime=require("react/jsx-runtime"),_excluded=["basis","children","direction","grow","alignItems","alignContent","justifyContent","alignSelf","justifySelf","shrink","spacing","wrap"];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 Flex=function(_ref){var basis=_ref.basis,children=_ref.children,direction=_ref.direction,grow=_ref.grow,alignItems=_ref.alignItems,alignContent=_ref.alignContent,justifyContent=_ref.justifyContent,alignSelf=_ref.alignSelf,justifySelf=_ref.justifySelf,shrink=_ref.shrink,spacing=_ref.spacing,wrap=_ref.wrap,rest=_objectWithoutProperties(_ref,_excluded);return/*#__PURE__*/(0,_jsxRuntime.jsx)(_styles.StyledFlexContainer,_objectSpread(_objectSpread({alignItems:alignItems,alignSelf:alignSelf,basis:basis,flexDirection:direction,grow:grow,justifyContent:justifyContent,justifySelf:justifySelf,shrink:shrink,spacing:spacing,wrap:wrap,alignContent:alignContent},rest),{},{children:children}))},_default=Flex;exports.default=_default;
|