@via-profit/ui-kit 0.5.0 → 0.6.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/Accordion/AccordionActions.d.ts +1 -1
- package/Accordion/AccordionActions.js +2 -1
- package/Accordion/AccordionContainer.d.ts +1 -1
- package/Accordion/AccordionContainer.js +2 -14
- package/Accordion/AccordionContent.d.ts +1 -1
- package/Accordion/AccordionContent.js +5 -1
- package/Accordion/AccordionHeader.d.ts +2 -2
- package/Accordion/AccordionHeader.js +6 -2
- package/Accordion/index.d.ts +9 -9
- package/Accordion/index.js +18 -9
- package/Autocomplete/AutocompleteContainer.d.ts +2 -2
- package/Autocomplete/AutocompleteContainer.js +17 -7
- package/Autocomplete/AutocompleteItem.js +2 -1
- package/Autocomplete/context.d.ts +3 -3
- package/Autocomplete/index.d.ts +2 -2
- package/Avatar/AvatarContainer.d.ts +2 -2
- package/Avatar/AvatarPicture.d.ts +2 -2
- package/Avatar/index.js +1 -2
- package/Badge/BadgeBase.d.ts +1 -1
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeDeleteButton.d.ts +2 -2
- package/Badge/BadgeStyled.js +1 -1
- package/Badge/index.d.ts +1 -1
- package/Badge/index.js +1 -2
- package/Button/ButtonBase.d.ts +2 -2
- package/Button/ButtonContainer.d.ts +4 -4
- package/Button/ButtonContainer.js +22 -5
- package/Button/ButtonIconWrapper.d.ts +1 -1
- package/Button/ButtonStyled.d.ts +1 -1
- package/Button/ButtonTextWrapper.d.ts +1 -1
- package/Button/buttonVariants.d.ts +1 -1
- package/Button/buttonVariants.js +3 -2
- package/Button/index.d.ts +1 -1
- package/Button/index.js +1 -20
- package/ButtonGroup/index.js +4 -3
- package/CHANGELOG.md +32 -1
- package/Calendar/CalendarComponent.js +18 -9
- package/Calendar/CalendarControlButton.d.ts +2 -2
- package/Calendar/CalendarPaper.js +1 -1
- package/Calendar/CalendarWeekDayLabel.d.ts +2 -2
- package/Calendar/CalendarWeekRowButton.d.ts +1 -1
- package/Calendar/IconChevronDown.js +17 -7
- package/Calendar/index.d.ts +1 -1
- package/Calendar/index.js +17 -7
- package/Checkbox/CheckboxAsterisk.js +17 -7
- package/Checkbox/CheckboxBox.d.ts +2 -2
- package/Checkbox/CheckboxBox.js +1 -1
- package/Checkbox/CheckboxContainer.d.ts +2 -2
- package/Checkbox/CheckboxErrorText.js +17 -7
- package/Checkbox/index.d.ts +10 -10
- package/Checkbox/index.js +1 -2
- package/Checkbox/useCheckboxColor.d.ts +1 -1
- package/ClickOutside/index.js +5 -2
- package/DatePicker/index.d.ts +1 -1
- package/ErrorBoundary/RenderError.js +17 -7
- package/ErrorBoundary/index.d.ts +1 -1
- package/Grid/index.d.ts +17 -5
- package/Grid/index.js +7 -2
- package/Highlighted/index.js +1 -2
- package/LoadingIndicator/LoadingOverlay.js +17 -7
- package/LoadingIndicator/Spinner.js +17 -7
- package/LoadingIndicator/SpinnerCircle.d.ts +2 -3
- package/Menu/MenuContainer.d.ts +2 -2
- package/Menu/MenuContainer.js +19 -10
- package/Menu/MenuItem.js +5 -1
- package/Menu/MenuList.js +1 -1
- package/Menu/context.d.ts +1 -1
- package/Menu/index.d.ts +1 -1
- package/Modal/BaseModal/ModalInner.js +2 -0
- package/Modal/BaseModal/ModalWrapper.js +30 -37
- package/Modal/BaseModal/context.d.ts +1 -1
- package/Modal/BaseModal/index.js +1 -2
- package/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
- package/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
- package/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
- package/Modal/ConfirmBox/index.js +1 -2
- package/Modal/Dialog/DialogInner.js +5 -1
- package/Modal/Dialog/index.js +18 -9
- package/Modal/Drawer/DrawerCloseIcon.js +17 -7
- package/Modal/Drawer/DrawerFooter.js +5 -1
- package/Modal/Drawer/DrawerHeader.d.ts +4 -4
- package/Modal/Drawer/DrawerHeader.js +5 -1
- package/Modal/Drawer/index.js +18 -9
- package/Modal/MessageBox/MessageBoxContent.js +5 -1
- package/Modal/MessageBox/MessageBoxFooter.js +5 -1
- package/Modal/MessageBox/MessageBoxHeader.js +5 -1
- package/Modal/MessageBox/index.js +18 -9
- package/Modal/index.js +17 -7
- package/Pagination/PaginationContainer.d.ts +9 -0
- package/Pagination/PaginationContainer.js +34 -0
- package/Pagination/PaginationGap.d.ts +4 -0
- package/Pagination/PaginationGap.js +22 -0
- package/Pagination/PaginationIcons.d.ts +6 -0
- package/Pagination/PaginationIcons.js +21 -0
- package/Pagination/PaginationItem.d.ts +44 -0
- package/Pagination/PaginationItem.js +59 -0
- package/Pagination/getPaginationItems.d.ts +22 -0
- package/Pagination/getPaginationItems.js +42 -0
- package/Pagination/index.d.ts +104 -0
- package/Pagination/index.js +98 -0
- package/Pagination/usePagination.d.ts +105 -0
- package/Pagination/usePagination.js +66 -0
- package/PhoneField/CountryFlagComponent.d.ts +1 -1
- package/PhoneField/UnknownFlag.d.ts +0 -1
- package/PhoneField/flags/BY.js +17 -7
- package/PhoneField/flags/CN.js +17 -7
- package/PhoneField/flags/IL.js +17 -7
- package/PhoneField/flags/JP.js +17 -7
- package/PhoneField/flags/KZ.js +17 -7
- package/PhoneField/flags/RU.js +17 -7
- package/PhoneField/flags/UA.js +17 -7
- package/PhoneField/flags/US.js +17 -7
- package/PhoneField/flags/Unknown.js +17 -7
- package/PhoneField/templates.d.ts +2 -2
- package/Popper/Popper.js +1 -2
- package/Radio/RadioBox.d.ts +1 -1
- package/Radio/RadioBox.js +1 -1
- package/Radio/RadioContainer.d.ts +2 -2
- package/Radio/index.d.ts +5 -5
- package/Radio/index.js +1 -2
- package/Radio/useRadioColor.d.ts +1 -1
- package/RadioGroup/RadioGroupAsterisk.js +17 -7
- package/RadioGroup/RadioGroupErrorText.js +17 -7
- package/RadioGroup/RadioGroupItems.d.ts +1 -1
- package/RadioGroup/index.d.ts +11 -11
- package/RadioGroup/index.js +1 -2
- package/Selectbox/SelectboxButton.d.ts +4 -4
- package/Selectbox/SelectboxButton.js +25 -10
- package/Selectbox/SelectboxButtonWrapper.d.ts +2 -2
- package/Selectbox/SelectboxButtonWrapper.js +19 -10
- package/Selectbox/SelectboxMenu.d.ts +2 -2
- package/Selectbox/SelectboxMenu.js +17 -7
- package/Selectbox/index.d.ts +2 -2
- package/Selectbox/index.js +18 -9
- package/Slider/SliderRail.d.ts +1 -1
- package/Slider/SliderThumb.d.ts +1 -1
- package/Slider/SliderTrack.d.ts +1 -1
- package/Slider/index.js +1 -2
- package/Slider/useSliderColor.d.ts +1 -1
- package/Stack/index.d.ts +18 -6
- package/Stack/index.js +7 -2
- package/Surface/SurfaceContainer.d.ts +3 -3
- package/Surface/SurfaceContainer.js +1 -1
- package/Surface/SurfaceContent.d.ts +2 -2
- package/Surface/SurfaceContent.js +18 -11
- package/Surface/SurfaceFooter.d.ts +2 -2
- package/Surface/SurfaceFooter.js +5 -1
- package/Surface/SurfaceHeader.d.ts +2 -2
- package/Surface/SurfaceHeader.js +6 -2
- package/Surface/SurfaceSubheader.d.ts +2 -2
- package/Surface/SurfaceSubheader.js +6 -2
- package/Surface/index.d.ts +10 -10
- package/Surface/index.js +18 -9
- package/Swiper/Swiper.d.ts +15 -15
- package/Swiper/Swiper.js +18 -9
- package/Swiper/SwiperContainer.d.ts +2 -2
- package/Swiper/SwiperSlide.js +17 -7
- package/Swiper/SwiperSlidesRenderer.js +17 -7
- package/Swiper/SwiperTrack.d.ts +2 -2
- package/Swiper/SwiperTrack.js +17 -7
- package/Swiper/SwiperWrapper.d.ts +2 -2
- package/Swiper/SwiperWrapper.js +17 -7
- package/Switch/SwitchAsterisk.js +17 -7
- package/Switch/SwitchContainer.d.ts +2 -2
- package/Switch/SwitchDot.d.ts +1 -1
- package/Switch/SwitchDot.js +2 -4
- package/Switch/SwitchErrorText.js +17 -7
- package/Switch/SwitchTrack.d.ts +1 -1
- package/Switch/index.d.ts +9 -9
- package/Switch/index.js +1 -2
- package/Switch/useSwitchColor.d.ts +1 -1
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +1 -1
- package/Table/TableCaption.js +5 -1
- package/Table/TableCell.js +6 -2
- package/Table/TableFooter.js +2 -1
- package/Table/TableHeaderCell.js +6 -2
- package/Tabs/Tab.js +4 -1
- package/Tabs/TabPanel.d.ts +1 -1
- package/Tabs/Tabs.d.ts +7 -7
- package/Tabs/Tabs.js +1 -2
- package/Tabs/useTabsColor.d.ts +1 -1
- package/TextArea/TextAreaIconWrapper.d.ts +3 -3
- package/TextArea/TextAreaIconWrapper.js +17 -7
- package/TextArea/TextAreaInput.js +23 -8
- package/TextArea/index.js +18 -9
- package/TextField/TextFieldContainer.js +17 -7
- package/TextField/TextFieldErrorText.js +17 -7
- package/TextField/TextFieldIconWrapper.d.ts +3 -3
- package/TextField/TextFieldIconWrapper.js +17 -7
- package/TextField/TextFieldInput.js +23 -8
- package/TextField/TextFieldInputWrapper.d.ts +5 -5
- package/TextField/TextFieldInputWrapper.js +22 -9
- package/TextField/TextFieldLabel.js +17 -7
- package/TextField/TextFieldLabelAsterisk.js +17 -7
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +18 -9
- package/ThemeProvider/createTheme.js +7 -3
- package/ThemeProvider/index.d.ts +45 -12
- package/ThemeProvider/index.js +1 -4
- package/ThemeProvider/tokens.d.ts +54 -3
- package/ThemeProvider/tokens.js +61 -3
- package/Toast/ToastCard.js +5 -2
- package/Toast/ToastContainer.js +1 -2
- package/Tooltip/TooltipContainer.js +2 -0
- package/Tooltip/index.js +3 -4
- package/Typography/Base.d.ts +2 -3
- package/Typography/Blockquote.d.ts +2 -3
- package/Typography/List.d.ts +6 -7
- package/Typography/Paragraph.d.ts +1 -1
- package/Typography/Paragraph.js +17 -7
- package/Typography/SectionDescription.d.ts +2 -3
- package/Typography/U.d.ts +2 -3
- package/esm/Accordion/AccordionActions.js +2 -1
- package/esm/Accordion/AccordionContainer.js +2 -14
- package/esm/Accordion/AccordionContent.js +5 -1
- package/esm/Accordion/AccordionHeader.js +7 -3
- package/esm/Accordion/index.js +1 -2
- package/esm/Autocomplete/AutocompleteItem.js +2 -1
- package/esm/Avatar/index.js +1 -2
- package/esm/Badge/BadgeStyled.js +2 -2
- package/esm/Badge/index.js +1 -2
- package/esm/Button/ButtonContainer.js +23 -6
- package/esm/Button/buttonVariants.js +3 -2
- package/esm/Button/index.js +1 -20
- package/esm/ButtonGroup/index.js +4 -3
- package/esm/Calendar/CalendarComponent.js +1 -2
- package/esm/Calendar/CalendarPaper.js +1 -1
- package/esm/Checkbox/CheckboxBox.js +2 -2
- package/esm/Checkbox/index.js +1 -2
- package/esm/ClickOutside/index.js +5 -2
- package/esm/Grid/index.js +7 -2
- package/esm/Highlighted/index.js +1 -2
- package/esm/Menu/MenuContainer.js +2 -3
- package/esm/Menu/MenuItem.js +5 -1
- package/esm/Menu/MenuList.js +1 -1
- package/esm/Modal/BaseModal/ModalInner.js +2 -0
- package/esm/Modal/BaseModal/ModalWrapper.js +30 -37
- package/esm/Modal/BaseModal/index.js +1 -2
- package/esm/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
- package/esm/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
- package/esm/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
- package/esm/Modal/ConfirmBox/index.js +1 -2
- package/esm/Modal/Dialog/DialogInner.js +5 -1
- package/esm/Modal/Dialog/index.js +1 -2
- package/esm/Modal/Drawer/DrawerFooter.js +5 -1
- package/esm/Modal/Drawer/DrawerHeader.js +5 -1
- package/esm/Modal/Drawer/index.js +1 -2
- package/esm/Modal/MessageBox/MessageBoxContent.js +5 -1
- package/esm/Modal/MessageBox/MessageBoxFooter.js +5 -1
- package/esm/Modal/MessageBox/MessageBoxHeader.js +5 -1
- package/esm/Modal/MessageBox/index.js +1 -2
- package/esm/Pagination/PaginationContainer.js +29 -0
- package/esm/Pagination/PaginationGap.js +17 -0
- package/esm/Pagination/PaginationIcons.js +15 -0
- package/esm/Pagination/PaginationItem.js +54 -0
- package/esm/Pagination/getPaginationItems.js +40 -0
- package/esm/Pagination/index.js +77 -0
- package/esm/Pagination/usePagination.js +61 -0
- package/esm/Popper/Popper.js +1 -2
- package/esm/Radio/RadioBox.js +2 -2
- package/esm/Radio/index.js +1 -2
- package/esm/RadioGroup/index.js +1 -2
- package/esm/Selectbox/SelectboxButton.js +8 -3
- package/esm/Selectbox/SelectboxButtonWrapper.js +2 -3
- package/esm/Selectbox/index.js +1 -2
- package/esm/Slider/index.js +1 -2
- package/esm/Stack/index.js +7 -2
- package/esm/Surface/SurfaceContainer.js +1 -1
- package/esm/Surface/SurfaceContent.js +18 -11
- package/esm/Surface/SurfaceFooter.js +5 -1
- package/esm/Surface/SurfaceHeader.js +6 -2
- package/esm/Surface/SurfaceSubheader.js +6 -2
- package/esm/Surface/index.js +1 -2
- package/esm/Swiper/Swiper.js +1 -2
- package/esm/Switch/SwitchDot.js +2 -4
- package/esm/Switch/index.js +1 -2
- package/esm/Table/Table.js +1 -1
- package/esm/Table/TableCaption.js +5 -1
- package/esm/Table/TableCell.js +6 -2
- package/esm/Table/TableFooter.js +2 -1
- package/esm/Table/TableHeaderCell.js +6 -2
- package/esm/Tabs/Tab.js +5 -2
- package/esm/Tabs/Tabs.js +1 -2
- package/esm/TextArea/TextAreaInput.js +6 -1
- package/esm/TextArea/index.js +1 -2
- package/esm/TextField/TextFieldInput.js +6 -1
- package/esm/TextField/TextFieldInputWrapper.js +5 -2
- package/esm/TextField/index.js +1 -2
- package/esm/ThemeProvider/createTheme.js +7 -3
- package/esm/ThemeProvider/index.js +0 -2
- package/esm/ThemeProvider/tokens.js +55 -2
- package/esm/Toast/ToastCard.js +6 -3
- package/esm/Toast/ToastContainer.js +1 -2
- package/esm/Tooltip/TooltipContainer.js +2 -0
- package/esm/Tooltip/index.js +3 -4
- package/esm/utils/getElementRef.js +13 -0
- package/package.json +46 -11
- package/utils/getElementRef.d.ts +8 -0
- package/utils/getElementRef.js +18 -0
- package/ThemeProvider/components.d.ts +0 -79
- package/ThemeProvider/components.js +0 -3
- package/ThemeProvider/useThemeProps.d.ts +0 -7
- package/ThemeProvider/useThemeProps.js +0 -34
- package/esm/ThemeProvider/components.js +0 -2
- package/esm/ThemeProvider/useThemeProps.js +0 -29
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const DEFAULT_SIZE = "2.4em";
|
|
3
2
|
export declare const toCssSize: (size: number | string) => string;
|
|
4
3
|
/**
|
|
@@ -6,8 +5,8 @@ export declare const toCssSize: (size: number | string) => string;
|
|
|
6
5
|
* A span, so the spinner can be placed inside phrasing content (e.g. a button)
|
|
7
6
|
*/
|
|
8
7
|
declare const SpinnerCircle: import("@emotion/styled").StyledComponent<{
|
|
9
|
-
theme?: import("@emotion/react").Theme
|
|
10
|
-
as?:
|
|
8
|
+
theme?: import("@emotion/react").Theme;
|
|
9
|
+
as?: React.ElementType;
|
|
11
10
|
} & {
|
|
12
11
|
readonly $size: string;
|
|
13
12
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
package/Menu/MenuContainer.d.ts
CHANGED
|
@@ -260,6 +260,6 @@ export type GetOptionSelected<T> = (payload: {
|
|
|
260
260
|
export type OnSelectItem<T, Multiple extends boolean | undefined = undefined> = (value: Multiple extends undefined ? T : readonly T[]) => void;
|
|
261
261
|
export type OnRequestClose = (event?: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement> | KeyboardEvent | MouseEvent) => void;
|
|
262
262
|
declare const _default: <T, Multiple extends boolean | undefined = undefined>(props: MenuProps<T, Multiple> & {
|
|
263
|
-
ref?: React.Ref<MenuRef
|
|
264
|
-
}) => JSX.Element;
|
|
263
|
+
ref?: React.Ref<MenuRef>;
|
|
264
|
+
}) => React.JSX.Element;
|
|
265
265
|
export default _default;
|
package/Menu/MenuContainer.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -31,7 +41,6 @@ const context_1 = __importStar(require("./context"));
|
|
|
31
41
|
const MenuList_1 = __importDefault(require("./MenuList"));
|
|
32
42
|
const Popper_1 = __importDefault(require("../Popper"));
|
|
33
43
|
const ClickOutside_1 = __importDefault(require("../ClickOutside"));
|
|
34
|
-
const useThemeProps_1 = __importDefault(require("../ThemeProvider/useThemeProps"));
|
|
35
44
|
const onRequestCloseDefault = () => undefined;
|
|
36
45
|
const isEqual = (a, b) => {
|
|
37
46
|
if (a === b) {
|
|
@@ -47,7 +56,7 @@ const isEqual = (a, b) => {
|
|
|
47
56
|
return keysA.every(key => Object.prototype.hasOwnProperty.call(b, key) && a[key] === b[key]);
|
|
48
57
|
};
|
|
49
58
|
const MenuContainer = react_1.default.forwardRef((props, ref) => {
|
|
50
|
-
const { items, value, anchorElement = null, overrides, children, closeOutsideClick = true, closeOnAnchorClick = false, isOpen = false, anchorPos = 'bottom', alternativePlacements = ['bottom', 'top'], positionStrategy, autoFlip, viewportMargin, offset, multiple = false, autofocus = true, closeOnSelect = !multiple, onRequestClose = onRequestCloseDefault, onAnchorPosChanged, zIndex, onSelectItem, getOptionSelected, maxWidth, } =
|
|
59
|
+
const { items, value, anchorElement = null, overrides, children, closeOutsideClick = true, closeOnAnchorClick = false, isOpen = false, anchorPos = 'bottom', alternativePlacements = ['bottom', 'top'], positionStrategy, autoFlip, viewportMargin, offset, multiple = false, autofocus = true, closeOnSelect = !multiple, onRequestClose = onRequestCloseDefault, onAnchorPosChanged, zIndex, onSelectItem, getOptionSelected, maxWidth, } = props;
|
|
51
60
|
const overridesMap = react_1.default.useMemo(() => ({
|
|
52
61
|
List: (overrides === null || overrides === void 0 ? void 0 : overrides.List) || MenuList_1.default,
|
|
53
62
|
Popper: (overrides === null || overrides === void 0 ? void 0 : overrides.Popper) || Popper_1.default,
|
|
@@ -56,7 +65,7 @@ const MenuContainer = react_1.default.forwardRef((props, ref) => {
|
|
|
56
65
|
const menuPopperRef = react_1.default.useRef(null);
|
|
57
66
|
// Starts as `false` so that a menu mounted in the open state is focused and scrolled too
|
|
58
67
|
const isOpenRef = react_1.default.useRef(false);
|
|
59
|
-
const focusTimeoutRef = react_1.default.useRef();
|
|
68
|
+
const focusTimeoutRef = react_1.default.useRef(undefined);
|
|
60
69
|
// Whether the focus is inside the list: then it is returned to the anchor on close
|
|
61
70
|
const hasFocusRef = react_1.default.useRef(false);
|
|
62
71
|
// The parent often resets the anchor together with isOpen, so the last one is kept
|
package/Menu/MenuItem.js
CHANGED
|
@@ -18,12 +18,16 @@ exports.MenuItem = void 0;
|
|
|
18
18
|
const react_1 = __importDefault(require("react"));
|
|
19
19
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
20
20
|
const react_2 = require("@emotion/react");
|
|
21
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
21
22
|
const StyledMenuItem = styled_1.default.div `
|
|
22
23
|
cursor: pointer;
|
|
23
24
|
user-select: none;
|
|
24
25
|
display: flex;
|
|
25
26
|
align-items: center;
|
|
26
|
-
padding:
|
|
27
|
+
padding: ${({ theme }) => {
|
|
28
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'item');
|
|
29
|
+
return `${y} ${x}`;
|
|
30
|
+
}};
|
|
27
31
|
transition: all 240ms ease-out;
|
|
28
32
|
border-radius: ${({ theme }) => theme.shape.radiusFactor}em;
|
|
29
33
|
background-color: ${({ theme, selected, hovered }) => {
|
package/Menu/MenuList.js
CHANGED
|
@@ -26,7 +26,7 @@ const StyledMenuList = styled_1.default.div `
|
|
|
26
26
|
opacity: ${props => (props.$isOpen ? 1 : 0)};
|
|
27
27
|
background-color: ${({ theme }) => theme.color.surface.toString()};
|
|
28
28
|
border-radius: ${({ theme }) => theme.shape.radiusFactor * 2}em;
|
|
29
|
-
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'popup'
|
|
29
|
+
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'popup')};
|
|
30
30
|
|
|
31
31
|
${({ $maxWidth }) => {
|
|
32
32
|
if (typeof $maxWidth === 'number') {
|
package/Menu/context.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface ActionSetMenuState {
|
|
|
9
9
|
readonly type: 'setMenuState';
|
|
10
10
|
readonly payload: Partial<MenuState>;
|
|
11
11
|
}
|
|
12
|
-
export declare const actionSetmenuState: (payload: ActionSetMenuState[
|
|
12
|
+
export declare const actionSetmenuState: (payload: ActionSetMenuState["payload"]) => ActionSetMenuState;
|
|
13
13
|
export declare const defaultState: MenuState;
|
|
14
14
|
interface MenuContextProviderProps {
|
|
15
15
|
readonly children: React.ReactNode | readonly React.ReactNode[];
|
package/Menu/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export * from './MenuContainer';
|
|
|
6
6
|
export * from './MenuItem';
|
|
7
7
|
export * from './MenuList';
|
|
8
8
|
declare const _default: <T, Multiple extends boolean | undefined = undefined>(props: MenuProps<T, Multiple> & {
|
|
9
|
-
ref?: React.Ref<MenuRef
|
|
9
|
+
ref?: React.Ref<MenuRef>;
|
|
10
10
|
}) => React.ReactElement;
|
|
11
11
|
export default _default;
|
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const react_2 = require("@emotion/react");
|
|
20
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
20
21
|
const StyledModalInner = styled_1.default.div `
|
|
21
22
|
opacity: 0;
|
|
22
23
|
z-index: ${({ theme }) => theme.zIndex.modal};
|
|
@@ -24,6 +25,7 @@ const StyledModalInner = styled_1.default.div `
|
|
|
24
25
|
pointer-events: all;
|
|
25
26
|
position: relative;
|
|
26
27
|
background-color: ${({ theme }) => theme.color.surface.toString()};
|
|
28
|
+
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'popup')};
|
|
27
29
|
border-radius: ${({ theme }) => theme.shape.radiusFactor * 2}em;
|
|
28
30
|
margin-top: 2em;
|
|
29
31
|
transition:
|
|
@@ -11,6 +11,32 @@ const TabManager_1 = __importDefault(require("../../utils/TabManager"));
|
|
|
11
11
|
* Count of the modals which lock the body scroll
|
|
12
12
|
*/
|
|
13
13
|
let bodyLocksCount = 0;
|
|
14
|
+
const SCROLL_WIDTH_PROPERTY = '--modal-scroll-width';
|
|
15
|
+
/**
|
|
16
|
+
* The first modal hides the scrollbar of the page and puts the margin of the same width instead,
|
|
17
|
+
* so the page does not move. The width is measured before the scrollbar is hidden:
|
|
18
|
+
* the scrollbar of the window, not of the body (`0` for the overlay scrollbars)
|
|
19
|
+
*/
|
|
20
|
+
const lockPageScroll = () => {
|
|
21
|
+
var _a;
|
|
22
|
+
if (bodyLocksCount === 0) {
|
|
23
|
+
const scrollWidth = Math.max(window.innerWidth - window.document.documentElement.clientWidth, 0);
|
|
24
|
+
window.document.documentElement.style.setProperty(SCROLL_WIDTH_PROPERTY, `${scrollWidth}px`);
|
|
25
|
+
(_a = window.document.body) === null || _a === void 0 ? void 0 : _a.classList.add('-modal-over');
|
|
26
|
+
}
|
|
27
|
+
bodyLocksCount += 1;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The last modal returns the scrollbar of the page
|
|
31
|
+
*/
|
|
32
|
+
const unlockPageScroll = () => {
|
|
33
|
+
var _a;
|
|
34
|
+
bodyLocksCount = Math.max(0, bodyLocksCount - 1);
|
|
35
|
+
if (bodyLocksCount === 0) {
|
|
36
|
+
(_a = window.document.body) === null || _a === void 0 ? void 0 : _a.classList.remove('-modal-over');
|
|
37
|
+
window.document.documentElement.style.removeProperty(SCROLL_WIDTH_PROPERTY);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
14
40
|
const ModalWrapper = props => {
|
|
15
41
|
const { children, isOpen: isOpenProp, autofocus = true } = props;
|
|
16
42
|
const { state, dispatch } = (0, context_1.useContext)();
|
|
@@ -34,46 +60,16 @@ const ModalWrapper = props => {
|
|
|
34
60
|
}
|
|
35
61
|
};
|
|
36
62
|
}, [isOpen, autofocus]);
|
|
37
|
-
const getScrollWidth = react_1.default.useCallback(() => {
|
|
38
|
-
var _a;
|
|
39
|
-
const outer = window.document.createElement('div');
|
|
40
|
-
const inner = window.document.createElement('div');
|
|
41
|
-
const isVerticalScrollbar = window.document.body.scrollHeight > window.document.body.clientHeight;
|
|
42
|
-
if (!isVerticalScrollbar) {
|
|
43
|
-
return 0;
|
|
44
|
-
}
|
|
45
|
-
let widthNoScroll = 0;
|
|
46
|
-
let widthWithScroll = 0;
|
|
47
|
-
outer.style.visibility = 'hidden';
|
|
48
|
-
outer.style.width = '100px';
|
|
49
|
-
window.document.body.appendChild(outer);
|
|
50
|
-
widthNoScroll = outer.offsetWidth;
|
|
51
|
-
// force scrollbars
|
|
52
|
-
outer.style.overflow = 'scroll';
|
|
53
|
-
// add innerdiv
|
|
54
|
-
inner.style.width = '100%';
|
|
55
|
-
outer.appendChild(inner);
|
|
56
|
-
widthWithScroll = inner.offsetWidth;
|
|
57
|
-
// remove div
|
|
58
|
-
(_a = outer.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(outer);
|
|
59
|
-
return widthNoScroll - widthWithScroll;
|
|
60
|
-
}, []);
|
|
61
63
|
const lockBody = react_1.default.useCallback(() => {
|
|
62
|
-
var _a;
|
|
63
64
|
if (!bodyLockedRef.current) {
|
|
64
65
|
bodyLockedRef.current = true;
|
|
65
|
-
|
|
66
|
-
(_a = window.document.body) === null || _a === void 0 ? void 0 : _a.classList.add('-modal-over');
|
|
66
|
+
lockPageScroll();
|
|
67
67
|
}
|
|
68
68
|
}, []);
|
|
69
69
|
const unlockBody = react_1.default.useCallback(() => {
|
|
70
|
-
var _a;
|
|
71
70
|
if (bodyLockedRef.current) {
|
|
72
71
|
bodyLockedRef.current = false;
|
|
73
|
-
|
|
74
|
-
if (bodyLocksCount === 0) {
|
|
75
|
-
(_a = window.document.body) === null || _a === void 0 ? void 0 : _a.classList.remove('-modal-over');
|
|
76
|
-
}
|
|
72
|
+
unlockPageScroll();
|
|
77
73
|
}
|
|
78
74
|
}, []);
|
|
79
75
|
/**
|
|
@@ -165,13 +161,10 @@ const ModalWrapper = props => {
|
|
|
165
161
|
return react_1.default.useMemo(() => isMounted ? (react_1.default.createElement("div", { ref: containerRef, tabIndex: -1, id: id },
|
|
166
162
|
children,
|
|
167
163
|
react_1.default.createElement(react_2.Global, { styles: (0, react_2.css) `
|
|
168
|
-
:root {
|
|
169
|
-
--modal-scroll-width: ${getScrollWidth()}px;
|
|
170
|
-
}
|
|
171
164
|
body.-modal-over {
|
|
172
165
|
overflow: hidden;
|
|
173
|
-
margin-right: var(
|
|
166
|
+
margin-right: var(${SCROLL_WIDTH_PROPERTY}, 0px);
|
|
174
167
|
}
|
|
175
|
-
` }))) : null, [children,
|
|
168
|
+
` }))) : null, [children, isMounted, id]);
|
|
176
169
|
};
|
|
177
170
|
exports.default = ModalWrapper;
|
|
@@ -18,7 +18,7 @@ export type ActionSetState = {
|
|
|
18
18
|
};
|
|
19
19
|
export type Action = ActionSetState;
|
|
20
20
|
export declare const defaultState: State;
|
|
21
|
-
export declare const actionSetState: (payload: ActionSetState[
|
|
21
|
+
export declare const actionSetState: (payload: ActionSetState["payload"]) => ActionSetState;
|
|
22
22
|
export interface ContextProviderProps {
|
|
23
23
|
readonly children: React.ReactNode | readonly React.ReactNode[];
|
|
24
24
|
readonly initialState: Omit<State, 'isMounted'>;
|
package/Modal/BaseModal/index.js
CHANGED
|
@@ -12,9 +12,8 @@ const ModalInnerContainer_1 = __importDefault(require("./ModalInnerContainer"));
|
|
|
12
12
|
const ModalWrapper_1 = __importDefault(require("./ModalWrapper"));
|
|
13
13
|
const RenderModal_1 = __importDefault(require("./RenderModal"));
|
|
14
14
|
const NoSSR_1 = __importDefault(require("../../NoSSR"));
|
|
15
|
-
const useThemeProps_1 = __importDefault(require("../../ThemeProvider/useThemeProps"));
|
|
16
15
|
const BaseModal = props => {
|
|
17
|
-
const { isOpen, children, overrides, autofocus = true, closeOnOverlayClick = context_1.defaultState.closeOnOverlayClick, closeOnEscape = context_1.defaultState.closeOnEscape, destroyTimeout = context_1.defaultState.destroyTimeout, onRequestClose, } =
|
|
16
|
+
const { isOpen, children, overrides, autofocus = true, closeOnOverlayClick = context_1.defaultState.closeOnOverlayClick, closeOnEscape = context_1.defaultState.closeOnEscape, destroyTimeout = context_1.defaultState.destroyTimeout, onRequestClose, } = props;
|
|
18
17
|
const [domLoaded, setDomLoaded] = react_1.default.useState(false);
|
|
19
18
|
const overridesMap = react_1.default.useMemo(() => ({
|
|
20
19
|
Overlay: (overrides === null || overrides === void 0 ? void 0 : overrides.Overlay) || ModalOverlay_1.default,
|
|
@@ -16,9 +16,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
19
20
|
const StyledConfirmBoxContent = styled_1.default.div `
|
|
20
21
|
flex: 1;
|
|
21
|
-
padding:
|
|
22
|
+
padding: ${({ theme }) => {
|
|
23
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
24
|
+
return `${y} ${x}`;
|
|
25
|
+
}};
|
|
22
26
|
`;
|
|
23
27
|
const ConfirmBoxContent = (props, ref) => {
|
|
24
28
|
const { children, dialogID } = props, nativeProps = __rest(props, ["children", "dialogID"]);
|
|
@@ -17,11 +17,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const Button_1 = __importDefault(require("../../Button"));
|
|
20
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
20
21
|
const StyledConfirmBoxFooter = styled_1.default.div `
|
|
21
22
|
display: flex;
|
|
22
23
|
justify-content: flex-end;
|
|
23
24
|
align-items: center;
|
|
24
|
-
padding:
|
|
25
|
+
padding: ${({ theme }) => {
|
|
26
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
27
|
+
return `${y} ${x}`;
|
|
28
|
+
}};
|
|
25
29
|
|
|
26
30
|
& > button {
|
|
27
31
|
border-radius: 0;
|
|
@@ -16,8 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
19
20
|
const StyedConfirmBoxHeader = styled_1.default.div `
|
|
20
|
-
padding:
|
|
21
|
+
padding: ${({ theme }) => {
|
|
22
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
23
|
+
return `${y} ${x} 0 ${x}`;
|
|
24
|
+
}};
|
|
21
25
|
`;
|
|
22
26
|
const ConfirmBoxTitle = styled_1.default.div `
|
|
23
27
|
font-size: 1.4rem;
|
|
@@ -22,9 +22,8 @@ const ConfirmBoxFooter_1 = __importDefault(require("./ConfirmBoxFooter"));
|
|
|
22
22
|
const ConfirmBoxHeader_1 = __importDefault(require("./ConfirmBoxHeader"));
|
|
23
23
|
const ModalOverlay_1 = __importDefault(require("../BaseModal/ModalOverlay"));
|
|
24
24
|
const useDialogID_1 = __importDefault(require("../BaseModal/useDialogID"));
|
|
25
|
-
const useThemeProps_1 = __importDefault(require("../../ThemeProvider/useThemeProps"));
|
|
26
25
|
const ConfirmBox = props => {
|
|
27
|
-
const
|
|
26
|
+
const { header, children, onRequestYes, onRequestClose, overrides, isOpen, dismissButtonLabel, confirmButtonLabel } = props, otherProps = __rest(props, ["header", "children", "onRequestYes", "onRequestClose", "overrides", "isOpen", "dismissButtonLabel", "confirmButtonLabel"]);
|
|
28
27
|
const dialogID = (0, useDialogID_1.default)('dialog-confirm');
|
|
29
28
|
const overridesMap = react_1.default.useMemo(() => ({
|
|
30
29
|
Container: (overrides === null || overrides === void 0 ? void 0 : overrides.Container) || ConfirmBoxContainer_1.default,
|
|
@@ -17,8 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const ModalInner_1 = __importDefault(require("../BaseModal/ModalInner"));
|
|
20
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
20
21
|
const StyledDialogInner = (0, styled_1.default)(ModalInner_1.default) `
|
|
21
|
-
padding:
|
|
22
|
+
padding: ${({ theme }) => {
|
|
23
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
24
|
+
return `${y} ${x}`;
|
|
25
|
+
}};
|
|
22
26
|
`;
|
|
23
27
|
const DialogInner = (props, ref) => {
|
|
24
28
|
const { children, dialogID } = props, restProps = __rest(props, ["children", "dialogID"]);
|
package/Modal/Dialog/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -41,9 +51,8 @@ const React = __importStar(require("react"));
|
|
|
41
51
|
const BaseModal_1 = __importDefault(require("../BaseModal"));
|
|
42
52
|
const DialogInner_1 = __importDefault(require("./DialogInner"));
|
|
43
53
|
const useDialogID_1 = __importDefault(require("../BaseModal/useDialogID"));
|
|
44
|
-
const useThemeProps_1 = __importDefault(require("../../ThemeProvider/useThemeProps"));
|
|
45
54
|
const Dialog = props => {
|
|
46
|
-
const
|
|
55
|
+
const { children, overrides } = props, restProps = __rest(props, ["children", "overrides"]);
|
|
47
56
|
const dialogID = (0, useDialogID_1.default)('dialog');
|
|
48
57
|
// Created once: a component created during the render is a new type on every render,
|
|
49
58
|
// so React would remount the whole dialog content (inputs lose the focus and the state)
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const React = __importStar(require("react"));
|
|
27
37
|
const react_1 = require("react");
|
|
@@ -16,8 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
19
20
|
const StyledDrawerFooter = styled_1.default.div `
|
|
20
|
-
padding:
|
|
21
|
+
padding: ${({ theme }) => {
|
|
22
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
23
|
+
return `calc(${y} / 2) ${x}`;
|
|
24
|
+
}};
|
|
21
25
|
`;
|
|
22
26
|
const DrawerFooter = (props, ref) => {
|
|
23
27
|
const { children } = props, nativeProps = __rest(props, ["children"]);
|
|
@@ -31,20 +31,20 @@ declare const _default: React.ForwardRefExoticComponent<Omit<React.HTMLAttribute
|
|
|
31
31
|
/**
|
|
32
32
|
* Display close button in the header
|
|
33
33
|
*/
|
|
34
|
-
readonly showCloseButton?: boolean
|
|
34
|
+
readonly showCloseButton?: boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Accessible label of the close button\
|
|
37
37
|
* \
|
|
38
38
|
* **Default**: `'Close'`
|
|
39
39
|
*/
|
|
40
|
-
readonly closeButtonLabel?: string
|
|
40
|
+
readonly closeButtonLabel?: string;
|
|
41
41
|
/**
|
|
42
42
|
* Drawer unique ID, the title gets the `${dialogID}-title` id for `aria-labelledby`
|
|
43
43
|
*/
|
|
44
|
-
readonly dialogID?: string
|
|
44
|
+
readonly dialogID?: string;
|
|
45
45
|
/**
|
|
46
46
|
* On close request
|
|
47
47
|
*/
|
|
48
|
-
readonly onRequestClose?: (
|
|
48
|
+
readonly onRequestClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
49
49
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
50
50
|
export default _default;
|
|
@@ -19,8 +19,12 @@ const styled_1 = __importDefault(require("@emotion/styled"));
|
|
|
19
19
|
const Span_1 = __importDefault(require("../../Typography/Span"));
|
|
20
20
|
const DrawerCloseIcon_1 = __importDefault(require("./DrawerCloseIcon"));
|
|
21
21
|
const Button_1 = __importDefault(require("../../Button"));
|
|
22
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
22
23
|
const StyledDrawerHeader = styled_1.default.div `
|
|
23
|
-
padding:
|
|
24
|
+
padding: ${({ theme }) => {
|
|
25
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
26
|
+
return `${y} ${x}`;
|
|
27
|
+
}};
|
|
24
28
|
display: flex;
|
|
25
29
|
align-items: center;
|
|
26
30
|
justify-content: space-between;
|
package/Modal/Drawer/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -46,9 +56,8 @@ const DrawerContent_1 = __importDefault(require("./DrawerContent"));
|
|
|
46
56
|
const DrawerFooter_1 = __importDefault(require("./DrawerFooter"));
|
|
47
57
|
const ModalOverlay_1 = __importDefault(require("../BaseModal/ModalOverlay"));
|
|
48
58
|
const useDialogID_1 = __importDefault(require("../BaseModal/useDialogID"));
|
|
49
|
-
const useThemeProps_1 = __importDefault(require("../../ThemeProvider/useThemeProps"));
|
|
50
59
|
const Drawer = props => {
|
|
51
|
-
const
|
|
60
|
+
const { children, onRequestClose, showCloseButton, header, closeButtonLabel, anchor, toolbar, footer, overrides } = props, otherProps = __rest(props, ["children", "onRequestClose", "showCloseButton", "header", "closeButtonLabel", "anchor", "toolbar", "footer", "overrides"]);
|
|
52
61
|
const hasFooter = React.useMemo(() => typeof footer !== 'undefined' && footer !== null, [footer]);
|
|
53
62
|
const hasHeader = React.useMemo(() => typeof header !== 'undefined' ||
|
|
54
63
|
typeof toolbar !== 'undefined' ||
|
|
@@ -16,9 +16,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
19
20
|
const Content = styled_1.default.div `
|
|
20
21
|
flex: 1;
|
|
21
|
-
padding:
|
|
22
|
+
padding: ${({ theme }) => {
|
|
23
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
24
|
+
return `${y} ${x}`;
|
|
25
|
+
}};
|
|
22
26
|
`;
|
|
23
27
|
const MessageBoxContent = (props, ref) => {
|
|
24
28
|
const { children, dialogID } = props, nativeProps = __rest(props, ["children", "dialogID"]);
|
|
@@ -17,11 +17,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const Button_1 = __importDefault(require("../../Button"));
|
|
20
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
20
21
|
const Footer = styled_1.default.div `
|
|
21
22
|
display: flex;
|
|
22
23
|
justify-content: flex-end;
|
|
23
24
|
align-items: center;
|
|
24
|
-
padding:
|
|
25
|
+
padding: ${({ theme }) => {
|
|
26
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
27
|
+
return `${y} ${x}`;
|
|
28
|
+
}};
|
|
25
29
|
|
|
26
30
|
& > button {
|
|
27
31
|
border-radius: 0;
|
|
@@ -16,8 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../../ThemeProvider/tokens");
|
|
19
20
|
const Header = styled_1.default.div `
|
|
20
|
-
padding:
|
|
21
|
+
padding: ${({ theme }) => {
|
|
22
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
23
|
+
return `${y} ${x} 0 ${x}`;
|
|
24
|
+
}};
|
|
21
25
|
`;
|
|
22
26
|
const HeaderTitle = styled_1.default.div `
|
|
23
27
|
font-size: 1.4rem;
|