@dfds-ui/react-components 1.1.14-alpha.17d32fe3 → 1.1.14-alpha.4244ab5f
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/accordion/Accordion.js +26 -34
- package/accordion/AccordionContent.js +3 -8
- package/accordion/AccordionSmall.js +14 -22
- package/app-bar/AppBar.js +40 -73
- package/app-bar/AppBarContext.js +6 -17
- package/app-bar/AppBarDrawer.js +3 -12
- package/app-bar/AppBarIconButton.js +4 -12
- package/app-bar/AppBarItem.js +17 -43
- package/app-bar/AppBarListItem.js +0 -2
- package/assertions/banner/Banner.js +36 -75
- package/assertions/banner/BannerAction.js +3 -13
- package/assertions/banner/BannerTypography.js +0 -6
- package/assertions/toast/Toast.js +6 -22
- package/assertions/toast/Toaster.js +10 -48
- package/badge/Badge.js +9 -17
- package/button/BadgeIcon.js +1 -1
- package/button/BaseButton.js +0 -2
- package/button/Button.js +14 -38
- package/button/IconButton.js +23 -49
- package/button/LinkButton.js +0 -1
- package/button/button-style.js +0 -1
- package/button/index.js +2 -1
- package/button-stack/ButtonStack.js +9 -21
- package/card/Card.js +32 -85
- package/card/CardActions.js +1 -9
- package/card/CardContent.js +2 -10
- package/card/CardMedia.js +4 -14
- package/card/CardPriceTag.js +4 -17
- package/card/CardTitle.js +5 -15
- package/chip/Chip.js +16 -40
- package/cjs/accordion/Accordion.js +19 -41
- package/cjs/accordion/AccordionContent.js +3 -15
- package/cjs/accordion/AccordionSmall.js +9 -30
- package/cjs/accordion/index.js +0 -6
- package/cjs/app-bar/AppBar.js +40 -82
- package/cjs/app-bar/AppBarContext.js +6 -25
- package/cjs/app-bar/AppBarDrawer.js +3 -21
- package/cjs/app-bar/AppBarIconButton.js +4 -17
- package/cjs/app-bar/AppBarItem.js +16 -56
- package/cjs/app-bar/AppBarListItem.js +0 -6
- package/cjs/app-bar/index.js +0 -7
- package/cjs/assertions/banner/Banner.js +28 -81
- package/cjs/assertions/banner/BannerAction.js +3 -21
- package/cjs/assertions/banner/BannerTypography.js +0 -12
- package/cjs/assertions/banner/index.js +0 -6
- package/cjs/assertions/index.js +0 -4
- package/cjs/assertions/toast/Toast.js +6 -28
- package/cjs/assertions/toast/Toaster.js +9 -50
- package/cjs/assertions/toast/index.js +0 -5
- package/cjs/badge/Badge.js +9 -24
- package/cjs/badge/index.js +0 -4
- package/cjs/button/BadgeIcon.js +0 -6
- package/cjs/button/BaseButton.js +0 -8
- package/cjs/button/Button.js +14 -39
- package/cjs/button/IconButton.js +23 -57
- package/cjs/button/LinkButton.js +0 -10
- package/cjs/button/button-style.js +0 -4
- package/cjs/button/index.js +0 -10
- package/cjs/button-stack/ButtonStack.js +7 -23
- package/cjs/button-stack/index.js +0 -2
- package/cjs/card/Card.js +34 -91
- package/cjs/card/CardActions.js +1 -15
- package/cjs/card/CardContent.js +2 -15
- package/cjs/card/CardMedia.js +4 -17
- package/cjs/card/CardPriceTag.js +4 -16
- package/cjs/card/CardTitle.js +5 -21
- package/cjs/card/index.js +0 -7
- package/cjs/chip/Chip.js +15 -47
- package/cjs/chip/index.js +0 -4
- package/cjs/common/LockBodyScroll.js +3 -21
- package/cjs/common/arrow.js +2 -8
- package/cjs/common/emotionCloneElement.js +0 -6
- package/cjs/common/intent.js +0 -8
- package/cjs/common/miniMoize.js +0 -7
- package/cjs/common/polymorphic.js +2 -8
- package/cjs/common/use-media.js +16 -23
- package/cjs/common/useOnClickOutside.js +1 -10
- package/cjs/common/utils.js +0 -5
- package/cjs/counter/Counter.js +3 -26
- package/cjs/counter/PluralCounter.js +8 -35
- package/cjs/counter/index.js +0 -3
- package/cjs/data-table/DataTable.js +15 -42
- package/cjs/data-table/index.js +0 -2
- package/cjs/date-range-picker/DatePickerDefaultStyles.js +0 -3
- package/cjs/date-range-picker/DatePickerDfdsStyles.js +0 -3
- package/cjs/date-range-picker/DateRangePicker.js +34 -88
- package/cjs/date-range-picker/index.js +0 -2
- package/cjs/divider/Divider.js +5 -18
- package/cjs/divider/index.js +0 -2
- package/cjs/drawer/Drawer.js +10 -24
- package/cjs/drawer/index.js +0 -2
- package/cjs/dropdown-menu/Dropdown.js +17 -58
- package/cjs/dropdown-menu/DropdownContext.js +0 -11
- package/cjs/dropdown-menu/MenuCheckbox.js +1 -15
- package/cjs/dropdown-menu/MenuItem.js +17 -51
- package/cjs/dropdown-menu/MenuTitle.js +1 -14
- package/cjs/dropdown-menu/index.js +0 -8
- package/cjs/elevation/index.js +0 -10
- package/cjs/flexbox/FlexBox.js +6 -23
- package/cjs/flexbox/index.js +0 -2
- package/cjs/footer/Footer.js +0 -8
- package/cjs/footer/index.js +0 -2
- package/cjs/forms/assistive-text/AssistiveText.js +0 -5
- package/cjs/forms/asterisk/Asterisk.js +0 -8
- package/cjs/forms/checkbox/Checkbox.js +14 -34
- package/cjs/forms/checkbox/ExampleControlComponent.js +5 -23
- package/cjs/forms/checkbox/index.js +0 -2
- package/cjs/forms/email-field/EmailField.js +0 -9
- package/cjs/forms/error-text/ErrorText.js +0 -8
- package/cjs/forms/field/Field.js +0 -9
- package/cjs/forms/index.js +0 -19
- package/cjs/forms/input/Input.js +13 -35
- package/cjs/forms/input/InputComposition.js +22 -47
- package/cjs/forms/label/Label.js +3 -17
- package/cjs/forms/number-field/NumberField.js +2 -11
- package/cjs/forms/password-field/PasswordField.js +3 -25
- package/cjs/forms/radio/Radio.js +9 -26
- package/cjs/forms/reactselect/ReactSelect.js +33 -64
- package/cjs/forms/searchable-select/AsyncSearchableSelect.js +27 -45
- package/cjs/forms/select/Select.js +10 -30
- package/cjs/forms/select-field/SelectField.js +12 -32
- package/cjs/forms/switch/Switch.js +15 -33
- package/cjs/forms/tel-field/TelField.js +1 -9
- package/cjs/forms/text-field/TextField.js +15 -36
- package/cjs/global-styles/GlobalStyles.js +1 -12
- package/cjs/global-styles/ResetStyles.js +0 -7
- package/cjs/global-styles/sanitize.js +0 -3
- package/cjs/grid/Column.js +5 -16
- package/cjs/grid/Container.js +3 -23
- package/cjs/grid/index.js +0 -3
- package/cjs/hero/Hero.js +0 -12
- package/cjs/hero/index.js +0 -2
- package/cjs/hero/stripes.js +0 -6
- package/cjs/ie-banner/IEBanner.js +9 -27
- package/cjs/ie-banner/index.js +0 -2
- package/cjs/index.js +0 -85
- package/cjs/layout/LayoutLegacy.js +0 -7
- package/cjs/lists/FeatureList.js +5 -18
- package/cjs/lists/ListAddon.js +4 -16
- package/cjs/lists/ListDivider.js +4 -16
- package/cjs/lists/ListIcon.js +9 -23
- package/cjs/lists/ListItem.js +19 -35
- package/cjs/lists/ListText.js +8 -25
- package/cjs/lists/ListTextGroup.js +8 -20
- package/cjs/lists/ListTitle.js +2 -15
- package/cjs/lists/index.js +0 -9
- package/cjs/loader/DfdsLoader.js +0 -13
- package/cjs/loader/Loader.js +0 -10
- package/cjs/loader/index.js +0 -3
- package/cjs/localization/LocaleFlag.js +3 -18
- package/cjs/localization/index.js +0 -4
- package/cjs/localization/locales.js +1 -5
- package/cjs/logo/Logo.js +1 -17
- package/cjs/logo/index.js +0 -2
- package/cjs/media/index.js +0 -2
- package/cjs/menu/Menu.js +13 -34
- package/cjs/menu/index.js +0 -4
- package/cjs/mobile-stepper/MobileStepper.js +7 -23
- package/cjs/mobile-stepper/index.js +0 -2
- package/cjs/nav-bar/NavBar.js +23 -56
- package/cjs/nav-bar/index.js +0 -4
- package/cjs/nav-menu/NavMenuItem.js +0 -10
- package/cjs/nav-menu/index.js +0 -2
- package/cjs/pagination/Pagination.js +3 -22
- package/cjs/pagination/Pagination.styles.js +0 -4
- package/cjs/pagination/index.js +0 -2
- package/cjs/popper/Popper.js +17 -35
- package/cjs/popper/index.js +0 -2
- package/cjs/progress-bar/ProgressBar.js +0 -11
- package/cjs/progress-bar/index.js +0 -4
- package/cjs/schedule/ScheduleItem.js +0 -8
- package/cjs/schedule/ScheduleList.js +1 -13
- package/cjs/schedule/index.js +0 -3
- package/cjs/side-sheet/SideSheet.js +32 -66
- package/cjs/side-sheet/SideSheetCloseButton.js +8 -21
- package/cjs/side-sheet/SideSheetContent.js +2 -14
- package/cjs/side-sheet/SideSheetFooter.js +2 -14
- package/cjs/side-sheet/SideSheetHeader.js +5 -19
- package/cjs/side-sheet/SideSheetHeadline.js +0 -7
- package/cjs/side-sheet/index.js +0 -7
- package/cjs/site-layout/SiteLayout.js +16 -39
- package/cjs/site-layout/index.js +0 -4
- package/cjs/skeleton/Skeleton.js +1 -15
- package/cjs/skeleton/index.js +0 -2
- package/cjs/social-media-link-list/SocialMediaLinkList.js +10 -24
- package/cjs/social-media-link-list/index.js +0 -2
- package/cjs/spinner/Spinner.js +9 -25
- package/cjs/spinner/index.js +0 -2
- package/cjs/step/Step.js +21 -44
- package/cjs/step/Step.styles.js +0 -4
- package/cjs/step/StepButton.js +9 -27
- package/cjs/step/StepContent.js +1 -12
- package/cjs/step/StepContext.js +0 -4
- package/cjs/step/StepLabel.js +2 -12
- package/cjs/step/index.js +0 -2
- package/cjs/stepper/Stepper.js +8 -31
- package/cjs/stepper/StepperContext.js +0 -4
- package/cjs/stepper/index.js +0 -2
- package/cjs/stepper-feedback-message/StepperFeedbackMessage.js +0 -8
- package/cjs/stepper-feedback-message/index.js +0 -2
- package/cjs/styles/index.js +0 -6
- package/cjs/styles/media.js +1 -7
- package/cjs/styles/rem.js +0 -2
- package/cjs/styles/style-helpers.js +0 -5
- package/cjs/styles/theme.js +0 -3
- package/cjs/surface/Surface.js +6 -36
- package/cjs/surface/index.js +0 -2
- package/cjs/tab/Tab.js +7 -25
- package/cjs/tab/TabPanel.js +1 -10
- package/cjs/tab/Tabs.js +22 -60
- package/cjs/tab/TabsContext.js +0 -11
- package/cjs/tab/index.js +0 -6
- package/cjs/table/Table.js +5 -20
- package/cjs/table/TableBody.js +1 -11
- package/cjs/table/TableDataCell.js +3 -17
- package/cjs/table/TableHead.js +3 -17
- package/cjs/table/TableHeaderCell.js +3 -18
- package/cjs/table/TableRow.js +5 -19
- package/cjs/table/index.js +0 -12
- package/cjs/test/Test.js +0 -5
- package/cjs/tooltip/Tooltip.js +8 -29
- package/cjs/tooltip/index.js +0 -3
- package/cjs/typography/Headlines.js +8 -22
- package/cjs/typography/Text.js +0 -4
- package/cjs/typography/index.js +0 -4
- package/common/LockBodyScroll.js +9 -19
- package/common/arrow.js +2 -8
- package/common/emotionCloneElement.js +2 -6
- package/common/intent.js +0 -6
- package/common/miniMoize.js +0 -6
- package/common/polymorphic.js +5 -6
- package/common/use-media.js +17 -22
- package/common/useOnClickOutside.js +0 -7
- package/common/utils.js +0 -5
- package/counter/Counter.js +3 -24
- package/counter/PluralCounter.js +8 -27
- package/data-table/DataTable.js +15 -37
- package/date-range-picker/DatePickerDefaultStyles.js +2 -3
- package/date-range-picker/DateRangePicker.js +37 -78
- package/divider/Divider.js +5 -11
- package/drawer/Drawer.js +13 -21
- package/dropdown-menu/Dropdown.js +17 -46
- package/dropdown-menu/DropdownContext.js +1 -5
- package/dropdown-menu/MenuCheckbox.js +10 -16
- package/dropdown-menu/MenuItem.js +17 -41
- package/dropdown-menu/MenuTitle.js +4 -11
- package/elevation/index.js +2 -9
- package/flexbox/FlexBox.js +6 -18
- package/footer/Footer.js +2 -7
- package/forms/assistive-text/AssistiveText.js +0 -2
- package/forms/asterisk/Asterisk.js +0 -3
- package/forms/checkbox/Checkbox.js +14 -27
- package/forms/checkbox/ExampleControlComponent.js +5 -19
- package/forms/email-field/EmailField.js +2 -5
- package/forms/error-text/ErrorText.js +0 -6
- package/forms/field/Field.js +3 -10
- package/forms/input/Input.js +13 -31
- package/forms/input/InputComposition.js +24 -43
- package/forms/label/Label.js +3 -11
- package/forms/number-field/NumberField.js +2 -5
- package/forms/password-field/PasswordField.js +3 -17
- package/forms/radio/Radio.js +9 -19
- package/forms/reactselect/ReactSelect.js +33 -51
- package/forms/searchable-select/AsyncSearchableSelect.js +27 -36
- package/forms/select/Select.js +10 -24
- package/forms/select-field/SelectField.js +12 -21
- package/forms/switch/Switch.js +15 -30
- package/forms/tel-field/TelField.js +2 -5
- package/forms/text-field/TextField.js +15 -23
- package/global-styles/GlobalStyles.js +11 -12
- package/global-styles/ResetStyles.js +1 -4
- package/global-styles/sanitize.js +0 -1
- package/grid/Column.js +5 -12
- package/grid/Container.js +5 -16
- package/hero/Hero.js +0 -16
- package/hero/stripes.js +0 -2
- package/ie-banner/IEBanner.js +12 -26
- package/layout/LayoutLegacy.js +8 -10
- package/lists/FeatureList.js +5 -12
- package/lists/ListAddon.js +4 -11
- package/lists/ListDivider.js +4 -11
- package/lists/ListIcon.js +10 -19
- package/lists/ListItem.js +24 -31
- package/lists/ListText.js +10 -23
- package/lists/ListTextGroup.js +8 -15
- package/lists/ListTitle.js +2 -11
- package/loader/DfdsLoader.js +3 -9
- package/loader/Loader.js +0 -10
- package/localization/LocaleFlag.js +3 -8
- package/localization/locales.js +1 -4
- package/logo/Logo.js +1 -9
- package/menu/Menu.js +13 -26
- package/mobile-stepper/MobileStepper.js +7 -24
- package/nav-bar/NavBar.js +23 -46
- package/nav-menu/NavMenuItem.js +6 -12
- package/package.json +13 -13
- package/pagination/Pagination.js +14 -26
- package/pagination/Pagination.styles.js +0 -3
- package/popper/Popper.js +17 -28
- package/progress-bar/ProgressBar.js +6 -13
- package/schedule/ScheduleItem.js +2 -4
- package/schedule/ScheduleList.js +1 -8
- package/side-sheet/SideSheet.js +38 -62
- package/side-sheet/SideSheetCloseButton.js +8 -13
- package/side-sheet/SideSheetContent.js +2 -7
- package/side-sheet/SideSheetFooter.js +2 -7
- package/side-sheet/SideSheetHeader.js +5 -10
- package/side-sheet/SideSheetHeadline.js +1 -1
- package/site-layout/SiteLayout.js +16 -31
- package/skeleton/Skeleton.js +1 -12
- package/social-media-link-list/SocialMediaLinkList.js +10 -15
- package/spinner/Spinner.js +9 -22
- package/step/Step.js +21 -29
- package/step/Step.styles.js +2 -2
- package/step/StepButton.js +11 -22
- package/step/StepContent.js +1 -8
- package/step/StepLabel.js +3 -9
- package/stepper/Stepper.js +8 -19
- package/stepper-feedback-message/StepperFeedbackMessage.js +0 -4
- package/styles/media.js +1 -5
- package/styles/style-helpers.js +2 -3
- package/surface/Surface.js +7 -21
- package/tab/Tab.js +7 -18
- package/tab/TabPanel.js +2 -7
- package/tab/Tabs.js +24 -52
- package/tab/TabsContext.js +1 -3
- package/table/Table.js +5 -12
- package/table/TableBody.js +1 -6
- package/table/TableDataCell.js +3 -10
- package/table/TableHead.js +3 -10
- package/table/TableHeaderCell.js +3 -10
- package/table/TableRow.js +5 -13
- package/tooltip/Tooltip.js +19 -29
- package/typography/Headlines.js +8 -13
- package/typography/Text.js +0 -2
|
@@ -4,94 +4,64 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _reactDates = require("react-dates");
|
|
9
|
-
|
|
10
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
|
|
12
9
|
var _moment = _interopRequireDefault(require("moment"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
require("react-dates/initialize");
|
|
17
|
-
|
|
18
12
|
var _react2 = require("@emotion/react");
|
|
19
|
-
|
|
20
13
|
var _icons = require("@dfds-ui/icons");
|
|
21
|
-
|
|
22
14
|
var _useMedia2 = _interopRequireDefault(require("../common/use-media"));
|
|
23
|
-
|
|
24
15
|
var _miniMoize = require("../common/miniMoize");
|
|
25
|
-
|
|
26
16
|
var _DatePickerDefaultStyles = _interopRequireDefault(require("./DatePickerDefaultStyles"));
|
|
27
|
-
|
|
28
17
|
var _DatePickerDfdsStyles = _interopRequireDefault(require("./DatePickerDfdsStyles"));
|
|
29
|
-
|
|
30
18
|
var _LockBodyScroll = _interopRequireDefault(require("../common/LockBodyScroll"));
|
|
31
|
-
|
|
32
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
33
|
-
|
|
34
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
|
-
|
|
36
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
-
|
|
38
22
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
39
|
-
|
|
40
23
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
41
|
-
|
|
42
24
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
43
|
-
|
|
44
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."); }
|
|
45
|
-
|
|
46
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); }
|
|
47
|
-
|
|
48
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; }
|
|
49
|
-
|
|
50
28
|
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
51
|
-
|
|
52
29
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
53
|
-
|
|
54
30
|
// Do a wrapper to support styled components: https://github.com/airbnb/react-dates/issues/1030#issuecomment-388227454
|
|
55
31
|
const DateRangePicker = props => {
|
|
56
32
|
const _useState = (0, _react.useState)(toMoment(props.startDates.initial)),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
startDate = _useState2[0],
|
|
35
|
+
setStartDate = _useState2[1];
|
|
61
36
|
const _useState3 = (0, _react.useState)(toMoment(props.endDates.initial)),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
37
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
38
|
+
endDate = _useState4[0],
|
|
39
|
+
setEndDate = _useState4[1];
|
|
66
40
|
const _useState5 = (0, _react.useState)(false),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
41
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
42
|
+
showCalendar = _useState6[0],
|
|
43
|
+
setShowCalendar = _useState6[1];
|
|
71
44
|
const _useState7 = (0, _react.useState)('startDate'),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
45
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
46
|
+
focusedInput = _useState8[0],
|
|
47
|
+
setFocusedInput = _useState8[1];
|
|
76
48
|
const _useMedia = (0, _useMedia2.default)(['(max-width: 64em)', '(min-width: 78.063em)'], [{
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
49
|
+
numberOfMonths: props.numberOfMobileMonths || 12,
|
|
50
|
+
mobileState: true,
|
|
51
|
+
size: 40
|
|
52
|
+
}, {
|
|
53
|
+
numberOfMonths: 2,
|
|
54
|
+
mobileState: false,
|
|
55
|
+
size: 48
|
|
56
|
+
}], {
|
|
57
|
+
numberOfMonths: 1,
|
|
58
|
+
mobileState: false,
|
|
59
|
+
size: 48
|
|
60
|
+
}),
|
|
61
|
+
numberOfMonths = _useMedia.numberOfMonths,
|
|
62
|
+
mobileState = _useMedia.mobileState,
|
|
63
|
+
size = _useMedia.size;
|
|
93
64
|
_moment.default.locale(props.locale);
|
|
94
|
-
|
|
95
65
|
(0, _moment.default)().weekday(0);
|
|
96
66
|
(0, _react.useEffect)(() => {
|
|
97
67
|
setStartDate(toMoment(props.startDates.initial));
|
|
@@ -99,29 +69,24 @@ const DateRangePicker = props => {
|
|
|
99
69
|
}, [props.startDates.initial, props.endDates.initial]);
|
|
100
70
|
const closeExceptionDivOut = (0, _react.useRef)(null);
|
|
101
71
|
const closeExceptionImgOut = (0, _react.useRef)(null);
|
|
102
|
-
|
|
103
72
|
const startCalendarClicked = () => {
|
|
104
73
|
setShowCalendar(prev => !prev);
|
|
105
74
|
setFocusedInput('startDate');
|
|
106
75
|
};
|
|
107
|
-
|
|
108
76
|
const endCalendarClicked = () => {
|
|
109
77
|
setShowCalendar(prev => !prev);
|
|
110
78
|
setFocusedInput('endDate');
|
|
111
79
|
};
|
|
112
|
-
|
|
113
80
|
const onOutsideClick = ({
|
|
114
81
|
target
|
|
115
82
|
}) => {
|
|
116
83
|
if (target === closeExceptionDivOut.current || target === closeExceptionImgOut.current) {
|
|
117
84
|
return;
|
|
118
85
|
}
|
|
119
|
-
|
|
120
86
|
setShowCalendar(false);
|
|
121
87
|
setFocusedInput('startDate');
|
|
122
88
|
props.onDateChange(getKeyStr(startDate), getKeyStr(endDate));
|
|
123
89
|
};
|
|
124
|
-
|
|
125
90
|
const renderCalendarInfo = () => props.infoLabel ? (0, _react2.jsx)("div", {
|
|
126
91
|
className: "dateRangePickerInfo"
|
|
127
92
|
}, (0, _react2.jsx)("span", {
|
|
@@ -129,55 +94,41 @@ const DateRangePicker = props => {
|
|
|
129
94
|
}), (0, _react2.jsx)("p", {
|
|
130
95
|
className: "dateRangePickerInfo__info"
|
|
131
96
|
}, props.infoLabel)) : '';
|
|
132
|
-
|
|
133
97
|
const disabledDates = (0, _miniMoize.miniMoize)((focusedInput, start, startDisabledDates, endDisabledDates) => buildMap(focusedInput !== 'endDate' ? startDisabledDates : (startDisabledDates || []).filter(d => d < start).concat(endDisabledDates)));
|
|
134
|
-
|
|
135
98
|
const _isDayBlocked = date => {
|
|
136
99
|
const startDateStr = getKeyStr(startDate);
|
|
137
100
|
const disabled = disabledDates(focusedInput, startDateStr, props.startDates.disabledDates, props.endDates.disabledDates);
|
|
138
101
|
const dateN = getKeyStr(date);
|
|
139
|
-
|
|
140
102
|
if (!dateN) {
|
|
141
103
|
return false;
|
|
142
104
|
}
|
|
143
|
-
|
|
144
105
|
const d = focusedInput !== 'endDate' ? props.startDates : props.endDates;
|
|
145
106
|
const min = props.startDates.minDate;
|
|
146
|
-
|
|
147
107
|
if (disabled[dateN]) {
|
|
148
108
|
return true;
|
|
149
109
|
}
|
|
150
|
-
|
|
151
110
|
if (min && dateN && dateN < min) {
|
|
152
111
|
return true;
|
|
153
112
|
}
|
|
154
|
-
|
|
155
113
|
if (d.maxDate && dateN && dateN > d.maxDate) {
|
|
156
114
|
return true;
|
|
157
115
|
}
|
|
158
|
-
|
|
159
116
|
if (focusedInput === 'endDate' && startDateStr && startDateStr < dateN && dateN < props.endDates.minDate) {
|
|
160
117
|
return true;
|
|
161
118
|
}
|
|
162
|
-
|
|
163
119
|
return false;
|
|
164
120
|
};
|
|
165
|
-
|
|
166
121
|
const offerDates = (0, _miniMoize.miniMoize)((focusedInput, startOffers, endOffers) => buildMap(focusedInput !== 'endDate' ? startOffers : endOffers));
|
|
167
|
-
|
|
168
122
|
const isOfferValid = date => {
|
|
169
123
|
const map = offerDates(focusedInput, props.startDates.offerDates, props.endDates.offerDates);
|
|
170
124
|
return map[getKeyStr(date)];
|
|
171
125
|
};
|
|
172
|
-
|
|
173
126
|
const minimumNights = () => {
|
|
174
127
|
const start = toMoment(props.startDates.initial);
|
|
175
128
|
const end = toMoment(props.endDates.minDate);
|
|
176
129
|
return end && start ? end.diff(start, 'days') : 0;
|
|
177
130
|
};
|
|
178
|
-
|
|
179
131
|
const initialMonth = () => (mobileState ? toMoment(props.startDates.minDate) : startDate) || (0, _moment.default)();
|
|
180
|
-
|
|
181
132
|
const sharedCustomProps = {
|
|
182
133
|
hideKeyboardShortcutsPanel: true,
|
|
183
134
|
navPrev: (0, _react2.jsx)(_icons.LeftLink, {
|
|
@@ -270,7 +221,8 @@ const DateRangePicker = props => {
|
|
|
270
221
|
disabled: props.endDateDisabled
|
|
271
222
|
}))), showCalendar && !props.endDateDisabled && (0, _react2.jsx)(_reactDates.DayPickerRangeController, _extends({
|
|
272
223
|
onNextMonthClick: props.onNextMonthClick,
|
|
273
|
-
onPrevMonthClick: props.onPrevMonthClick
|
|
224
|
+
onPrevMonthClick: props.onPrevMonthClick
|
|
225
|
+
// Required props
|
|
274
226
|
,
|
|
275
227
|
onDatesChange: ({
|
|
276
228
|
startDate,
|
|
@@ -286,7 +238,8 @@ const DateRangePicker = props => {
|
|
|
286
238
|
onFocusChange: focusedInput => {
|
|
287
239
|
setFocusedInput(focusedInput || 'startDate');
|
|
288
240
|
setShowCalendar(!!focusedInput);
|
|
289
|
-
}
|
|
241
|
+
}
|
|
242
|
+
// We use phrases to disable extra stuff from aria-label
|
|
290
243
|
,
|
|
291
244
|
phrases: {
|
|
292
245
|
chooseAvailableStartDate: a => a.date,
|
|
@@ -294,7 +247,8 @@ const DateRangePicker = props => {
|
|
|
294
247
|
},
|
|
295
248
|
minimumNights: minimumNights(),
|
|
296
249
|
orientation: mobileState ? 'verticalScrollable' : 'horizontal'
|
|
297
|
-
}, sharedCustomProps)), showCalendar && props.endDateDisabled && (0, _react2.jsx)(_reactDates.DayPickerSingleDateController
|
|
250
|
+
}, sharedCustomProps)), showCalendar && props.endDateDisabled && (0, _react2.jsx)(_reactDates.DayPickerSingleDateController
|
|
251
|
+
// Required props
|
|
298
252
|
, _extends({
|
|
299
253
|
onDateChange: date => {
|
|
300
254
|
setStartDate(date);
|
|
@@ -308,25 +262,19 @@ const DateRangePicker = props => {
|
|
|
308
262
|
orientation: mobileState ? 'verticalScrollable' : 'horizontal'
|
|
309
263
|
}, sharedCustomProps)))));
|
|
310
264
|
};
|
|
311
|
-
|
|
312
265
|
function getKeyStr(m) {
|
|
313
266
|
return m && m.format('YYYY-MM-DD');
|
|
314
267
|
}
|
|
315
|
-
|
|
316
268
|
function toMoment(n) {
|
|
317
269
|
return n ? (0, _moment.default)(n, 'YYYY-MM-DD') : null;
|
|
318
270
|
}
|
|
319
|
-
|
|
320
271
|
function buildMap(dates) {
|
|
321
272
|
const map = {};
|
|
322
|
-
|
|
323
273
|
if (!dates) {
|
|
324
274
|
return map;
|
|
325
275
|
}
|
|
326
|
-
|
|
327
276
|
var _iterator = _createForOfIteratorHelper(dates),
|
|
328
|
-
|
|
329
|
-
|
|
277
|
+
_step;
|
|
330
278
|
try {
|
|
331
279
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
332
280
|
const d = _step.value;
|
|
@@ -337,9 +285,7 @@ function buildMap(dates) {
|
|
|
337
285
|
} finally {
|
|
338
286
|
_iterator.f();
|
|
339
287
|
}
|
|
340
|
-
|
|
341
288
|
return map;
|
|
342
289
|
}
|
|
343
|
-
|
|
344
290
|
var _default = DateRangePicker;
|
|
345
291
|
exports.default = _default;
|
|
@@ -9,7 +9,5 @@ Object.defineProperty(exports, "DateRangePicker", {
|
|
|
9
9
|
return _DateRangePicker.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
|
|
13
12
|
var _DateRangePicker = _interopRequireDefault(require("./DateRangePicker"));
|
|
14
|
-
|
|
15
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/cjs/divider/Divider.js
CHANGED
|
@@ -4,32 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.dividerBorder = exports.default = exports.Divider = void 0;
|
|
7
|
-
|
|
8
7
|
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
-
|
|
10
8
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _react2 = require("@emotion/react");
|
|
13
|
-
|
|
14
10
|
var _theme = require("@dfds-ui/theme");
|
|
15
|
-
|
|
16
11
|
const _excluded = ["light", "indent", "margins"];
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
16
|
+
const colors = _theme.theme.colors;
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
// Can be used to create a simple divider with a css border and still adhere to the colors defined for dividers.
|
|
28
19
|
const dividerBorder = (light, placement) => {
|
|
29
20
|
const border = `1px solid ${light ? colors.divider.light : colors.divider.dark}`;
|
|
30
21
|
return /*#__PURE__*/(0, _react2.css)("border-top:", placement === 'top' && border, ";border-bottom:", placement === 'bottom' && border, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:dividerBorder;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9kaXZpZGVyL0RpdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtDWSIsImZpbGUiOiIuLi8uLi8uLi9zcmMvZGl2aWRlci9EaXZpZGVyLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tICdyZWFjdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgeyB0aGVtZSB9IGZyb20gJ0BkZmRzLXVpL3RoZW1lJ1xuXG5leHBvcnQgdHlwZSBEaXZpZGVyUHJvcHMgPSB7XG4gIC8vdG9kbzogY29udmVydCB0byBzdXJmYWNlIGNvbmNlcHQgYW5kIHJlbW92ZSBsaWdodFxuICAvKipcbiAgICogRGlzcGxheSB0aGUgRGl2aWRlciBpbiBcImxpZ2h0XCIgbW9kZS5cbiAgICovXG4gIGxpZ2h0PzogYm9vbGVhblxuICAvKipcbiAgICogRGlzcGxheSB0aGUgRGl2aWRlciBpbiBcImluZGVudFwiIHN0eWxlXG4gICAqL1xuICBpbmRlbnQ/OiBib29sZWFuXG4gIC8qKlxuICAgKiAgRGlzcGxheSB0aGUgRGl2aWRlciBpbiBcIm1hcmdpblwiIHN0eWxlXG4gICAqL1xuICBtYXJnaW5zPzogYm9vbGVhblxuICAvKipcbiAgICogSFRNTCB0YWcgb3IgY3VzdG9tIGNvbXBvbmVudCBiZWluZyByZW5kZXJlZFxuICAgKi9cbiAgYXM/OiBSZWFjdC5FbGVtZW50VHlwZVxuICAvKipcbiAgICogQ2xhc3MgbmFtZSB0byBiZSBhc3NpZ25lZCB0byB0aGUgY29t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cubSA6IDApfTtcbmBcblxuZXhwb3J0IGNvbnN0IERpdmlkZXIgPSAoeyBsaWdodCwgaW5kZW50LCBtYXJnaW5zLCAuLi5yZXN0IH06IERpdmlkZXJQcm9wcykgPT4ge1xuICByZXR1cm4gPFN0eWxlZERpdmlkZXIgbGlnaHQ9e2xpZ2h0fSBpbmRlbnQ9e2luZGVudH0gbWFyZ2lucz17bWFyZ2luc30gcm9sZT1cInNlcGFyYXRvclwiIHsuLi5yZXN0fSAvPlxufVxuXG5leHBvcnQgZGVmYXVsdCBEaXZpZGVyXG4iXX0= */");
|
|
31
22
|
};
|
|
32
|
-
|
|
33
23
|
exports.dividerBorder = dividerBorder;
|
|
34
24
|
const StyledDivider = /*#__PURE__*/(0, _base.default)("hr", process.env.NODE_ENV === "production" ? {
|
|
35
25
|
target: "e1rrvlkn0"
|
|
@@ -37,13 +27,11 @@ const StyledDivider = /*#__PURE__*/(0, _base.default)("hr", process.env.NODE_ENV
|
|
|
37
27
|
target: "e1rrvlkn0",
|
|
38
28
|
label: "StyledDivider"
|
|
39
29
|
})("border:none;background-color:", p => p.light ? colors.divider.light : colors.divider.dark, ";max-width:100%;height:1px;margin:0 ", p => p.margins ? _theme.theme.spacing.m : 0, " 0 ", p => p.margins || p.indent ? _theme.theme.spacing.m : 0, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9kaXZpZGVyL0RpdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdDeUYiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2RpdmlkZXIvRGl2aWRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IGNzcyB9IGZ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|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
indent = _ref.indent,
|
|
33
|
+
margins = _ref.margins,
|
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
47
35
|
return (0, _react2.jsx)(StyledDivider, _extends({
|
|
48
36
|
light: light,
|
|
49
37
|
indent: indent,
|
|
@@ -51,7 +39,6 @@ const Divider = _ref => {
|
|
|
51
39
|
role: "separator"
|
|
52
40
|
}, rest));
|
|
53
41
|
};
|
|
54
|
-
|
|
55
42
|
exports.Divider = Divider;
|
|
56
43
|
var _default = Divider;
|
|
57
44
|
exports.default = _default;
|
package/cjs/divider/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _Divider = require("./Divider");
|
|
8
|
-
|
|
9
7
|
Object.keys(_Divider).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _Divider[key]) return;
|
package/cjs/drawer/Drawer.js
CHANGED
|
@@ -4,49 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Drawer = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _react2 = require("@emotion/react");
|
|
11
|
-
|
|
12
9
|
var _theme = require("@dfds-ui/theme");
|
|
13
|
-
|
|
14
10
|
var _arrow = _interopRequireDefault(require("../common/arrow"));
|
|
15
|
-
|
|
16
11
|
const _excluded = ["className", "children", "position", "verticalPosition", "showArrow", "elevation"];
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
14
|
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; }
|
|
23
|
-
|
|
24
15
|
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; }
|
|
25
|
-
|
|
26
16
|
const getArrowPlacement = (vertical, horizontal) => {
|
|
27
17
|
return `${vertical ? vertical : 'top'}-${horizontal ? horizontal : 'left'}`;
|
|
28
18
|
};
|
|
29
|
-
|
|
30
19
|
const drawerStyles = ({
|
|
31
20
|
position,
|
|
32
21
|
verticalPosition,
|
|
33
22
|
showArrow,
|
|
34
23
|
elevation
|
|
35
24
|
}) => /*#__PURE__*/(0, _react2.css)("z-index:1;position:absolute;height:auto;min-height:50px;left:", position === 'left' && 0, ";right:", position === 'right' && 0, ";min-width:112px;border-radius:2px;box-shadow:", _theme.theme.elevation[elevation], ";background-color:", _theme.theme.colors.surface.primary, ";display:grid;cursor:default;", !showArrow ? '' : (0, _arrow.default)(10, _theme.theme.colors.surface.primary, 20, getArrowPlacement(verticalPosition, position)), ";" + (process.env.NODE_ENV === "production" ? "" : ";label:drawerStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL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37
25
|
const Drawer = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
38
26
|
let className = _ref.className,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
_ref$position = _ref.position,
|
|
29
|
+
position = _ref$position === void 0 ? 'left' : _ref$position,
|
|
30
|
+
_ref$verticalPosition = _ref.verticalPosition,
|
|
31
|
+
verticalPosition = _ref$verticalPosition === void 0 ? 'bottom' : _ref$verticalPosition,
|
|
32
|
+
_ref$showArrow = _ref.showArrow,
|
|
33
|
+
showArrow = _ref$showArrow === void 0 ? true : _ref$showArrow,
|
|
34
|
+
_ref$elevation = _ref.elevation,
|
|
35
|
+
elevation = _ref$elevation === void 0 ? '4' : _ref$elevation,
|
|
36
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
50
37
|
return (0, _react2.jsx)("div", _extends({
|
|
51
38
|
className: className,
|
|
52
39
|
css: drawerStyles({
|
|
@@ -58,7 +45,6 @@ const Drawer = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
58
45
|
ref: ref
|
|
59
46
|
}, rest), (0, _react2.jsx)("div", null, children));
|
|
60
47
|
});
|
|
61
|
-
|
|
62
48
|
exports.Drawer = Drawer;
|
|
63
49
|
var _default = Drawer;
|
|
64
50
|
exports.default = _default;
|
package/cjs/drawer/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _Drawer = require("./Drawer");
|
|
8
|
-
|
|
9
7
|
Object.keys(_Drawer).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _Drawer[key]) return;
|