@edvisor/product-language 0.8.5 → 0.8.6
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/index.js +28 -28
- package/lib/components/modal/modal-base.d.ts +16 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -10767,29 +10767,33 @@ const ModalFrame = /*#__PURE__*/styled(Flex).withConfig({
|
|
|
10767
10767
|
})(["background-color:", ";z-index:20010;width:", ";", ";border-radius:8px;animation:", " .1s ease-in;"], Surface.Default.Default, ({
|
|
10768
10768
|
widthValue
|
|
10769
10769
|
}) => widthValue, shadowXl, grow);
|
|
10770
|
-
const
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
10774
|
-
|
|
10775
|
-
|
|
10776
|
-
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10770
|
+
const MODAL_SIZE = {
|
|
10771
|
+
small: '456px',
|
|
10772
|
+
critical: '518px',
|
|
10773
|
+
default: '616px',
|
|
10774
|
+
large: '776px',
|
|
10775
|
+
xLarge: '936px'
|
|
10776
|
+
};
|
|
10777
|
+
const MODAL_SIZE_TEXT = {
|
|
10778
|
+
SMALL: 'small',
|
|
10779
|
+
CRITICAL: 'critical',
|
|
10780
|
+
DEFAULT: 'default',
|
|
10781
|
+
LARGE: 'large',
|
|
10782
|
+
XLARGE: 'xLarge'
|
|
10783
|
+
};
|
|
10784
|
+
|
|
10785
|
+
function getModalSize(size) {
|
|
10786
|
+
const isValidKey = Object.keys(MODAL_SIZE).includes(size);
|
|
10787
|
+
const validSize = isValidKey ? size : MODAL_SIZE_TEXT.DEFAULT;
|
|
10788
|
+
return MODAL_SIZE[validSize];
|
|
10789
|
+
}
|
|
10790
|
+
|
|
10787
10791
|
const ModalBase = props => {
|
|
10788
10792
|
const {
|
|
10789
10793
|
open,
|
|
10790
10794
|
children,
|
|
10791
10795
|
closeOnEsc = true,
|
|
10792
|
-
modalSize,
|
|
10796
|
+
modalSize = MODAL_SIZE_TEXT.DEFAULT,
|
|
10793
10797
|
onOverlayClick,
|
|
10794
10798
|
onClose
|
|
10795
10799
|
} = props; // eslint-disable-next-line no-null/no-null
|
|
@@ -10830,9 +10834,7 @@ const ModalBase = props => {
|
|
|
10830
10834
|
children: jsx(ModalFrame, Object.assign({
|
|
10831
10835
|
column: true,
|
|
10832
10836
|
role: "dialog",
|
|
10833
|
-
widthValue:
|
|
10834
|
-
/* MODAL_SIZE.DEFAULT */
|
|
10835
|
-
)],
|
|
10837
|
+
widthValue: getModalSize(modalSize),
|
|
10836
10838
|
"aria-modal": "true"
|
|
10837
10839
|
}, {
|
|
10838
10840
|
children: children
|
|
@@ -10852,7 +10854,7 @@ const CloseButton = /*#__PURE__*/styled(IconMinor.Xmark).withConfig({
|
|
|
10852
10854
|
const ModalContent$1 = /*#__PURE__*/styled.div.withConfig({
|
|
10853
10855
|
displayName: "modal__ModalContent",
|
|
10854
10856
|
componentId: "sc-11jj4lm-2"
|
|
10855
|
-
})(["max-height:70vh;overflow-y:auto;padding:", ";"], Padding.m);
|
|
10857
|
+
})(["max-height:70vh;overflow-y:auto;overflow-x:hidden;padding:", ";"], Padding.m);
|
|
10856
10858
|
const ModalFooter$1 = /*#__PURE__*/styled.footer.withConfig({
|
|
10857
10859
|
displayName: "modal__ModalFooter",
|
|
10858
10860
|
componentId: "sc-11jj4lm-3"
|
|
@@ -10866,7 +10868,7 @@ const Modal = props => {
|
|
|
10866
10868
|
primaryButtonLabel,
|
|
10867
10869
|
closeButtonLabel,
|
|
10868
10870
|
secondaryButtonLabel,
|
|
10869
|
-
|
|
10871
|
+
modalSize,
|
|
10870
10872
|
onOverlayClick,
|
|
10871
10873
|
onPrimaryAction,
|
|
10872
10874
|
onSecondaryAction,
|
|
@@ -10876,7 +10878,7 @@ const Modal = props => {
|
|
|
10876
10878
|
open: open,
|
|
10877
10879
|
onOverlayClick: onOverlayClick,
|
|
10878
10880
|
closeOnEsc: closeOnEsc,
|
|
10879
|
-
|
|
10881
|
+
modalSize: modalSize,
|
|
10880
10882
|
onClose: onClose
|
|
10881
10883
|
}, {
|
|
10882
10884
|
children: jsxs(Fragment, {
|
|
@@ -10943,9 +10945,7 @@ const ModalDestructive = props => {
|
|
|
10943
10945
|
open: open,
|
|
10944
10946
|
onOverlayClick: onOverlayClick,
|
|
10945
10947
|
closeOnEsc: closeOnEsc,
|
|
10946
|
-
modalSize:
|
|
10947
|
-
/* MODAL_SIZE.CRITICAL */
|
|
10948
|
-
,
|
|
10948
|
+
modalSize: MODAL_SIZE_TEXT.CRITICAL,
|
|
10949
10949
|
onClose: onClose
|
|
10950
10950
|
}, {
|
|
10951
10951
|
children: jsxs(Fragment, {
|
|
@@ -11201,4 +11201,4 @@ const ChoiceList = props => {
|
|
|
11201
11201
|
});
|
|
11202
11202
|
};
|
|
11203
11203
|
|
|
11204
|
-
export { Actions, AlertBanner, Avatar, BODY, BODY_LARGE, Background, Badge, Body, BodyLarge, Borders, Button, CAPTION, Caption, Card, CardFrame$1 as CardFrame, Center, CenterContainer, Checkbox, ChoiceList, DatePicker, Display, Divider, Flag, Flex, Focused, Gap, HTMLAnchor, HTMLInput, Heading1, Heading2, Heading3, Heading4, Icon, IconMinor, Icons, InputCheckbox, InputField$1 as InputField, InputNumber, InputText, Interactive, LABEL, Label$1 as Label, LeftRightCard, Link, Margin, MenuList, Modal, ModalBase, ModalDestructive, MultiChoiceList, Padding, Radio, RadioButton$1 as RadioButton, RangeSlider, Select, Slider, SpaceAround, SpaceBetween, Spinner, Surface, Tab$1 as Tab, Tabs, Tag, Text$1 as Text, Thumbnail, Tooltip, TooltipBox, TooltipPosition, TooltipWrapper, TreeView, Typography, _Typography, gridLayoutGenerator, leftRightLayoutGenerator, shadow, shadow2Xl, shadowInner, shadowLg, shadowMd, shadowSm, shadowXl };
|
|
11204
|
+
export { Actions, AlertBanner, Avatar, BODY, BODY_LARGE, Background, Badge, Body, BodyLarge, Borders, Button, CAPTION, Caption, Card, CardFrame$1 as CardFrame, Center, CenterContainer, Checkbox, ChoiceList, DatePicker, Display, Divider, Flag, Flex, Focused, Gap, HTMLAnchor, HTMLInput, Heading1, Heading2, Heading3, Heading4, Icon, IconMinor, Icons, InputCheckbox, InputField$1 as InputField, InputNumber, InputText, Interactive, LABEL, Label$1 as Label, LeftRightCard, Link, MODAL_SIZE, MODAL_SIZE_TEXT, Margin, MenuList, Modal, ModalBase, ModalDestructive, MultiChoiceList, Padding, Radio, RadioButton$1 as RadioButton, RangeSlider, Select, Slider, SpaceAround, SpaceBetween, Spinner, Surface, Tab$1 as Tab, Tabs, Tag, Text$1 as Text, Thumbnail, Tooltip, TooltipBox, TooltipPosition, TooltipWrapper, TreeView, Typography, _Typography, gridLayoutGenerator, leftRightLayoutGenerator, shadow, shadow2Xl, shadowInner, shadowLg, shadowMd, shadowSm, shadowXl };
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
import { FC } from '@helpers';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
interface Sizes {
|
|
4
|
+
small: string;
|
|
5
|
+
critical: string;
|
|
6
|
+
default: string;
|
|
7
|
+
large: string;
|
|
8
|
+
xLarge: string;
|
|
9
9
|
}
|
|
10
|
+
export declare const MODAL_SIZE: Sizes;
|
|
11
|
+
export declare const MODAL_SIZE_TEXT: {
|
|
12
|
+
SMALL: string;
|
|
13
|
+
CRITICAL: string;
|
|
14
|
+
DEFAULT: string;
|
|
15
|
+
LARGE: string;
|
|
16
|
+
XLARGE: string;
|
|
17
|
+
};
|
|
10
18
|
export interface IModalBaseProps {
|
|
11
19
|
open: boolean;
|
|
12
20
|
children: React.ReactElement;
|
|
13
21
|
closeOnEsc?: boolean;
|
|
14
|
-
modalSize?: MODAL_SIZE;
|
|
22
|
+
modalSize?: keyof typeof MODAL_SIZE;
|
|
15
23
|
onOverlayClick?: () => void;
|
|
16
24
|
onClose: () => void;
|
|
17
25
|
}
|
|
18
26
|
export declare type IModalBase = InputHTMLAttributes<HTMLInputElement> & IModalBaseProps;
|
|
19
27
|
export declare const ModalBase: FC<IModalBase>;
|
|
28
|
+
export {};
|