@edvisor/product-language 0.8.4 → 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 CHANGED
@@ -10755,41 +10755,45 @@ function useKeyDown(targetKey, handler) {
10755
10755
  return;
10756
10756
  }
10757
10757
 
10758
- const fadeIn = /*#__PURE__*/keyframes(["from{opacity:0;}to{opacity:1;}"]);
10758
+ const fadeIn = /*#__PURE__*/keyframes(["from{opacity:.4;}to{opacity:1;}"]);
10759
10759
  const grow = /*#__PURE__*/keyframes(["from{transform:scale(.8)}to{transform:scale(1)}"]);
10760
10760
  const OverlayFrame = /*#__PURE__*/styled(Flex).withConfig({
10761
10761
  displayName: "modal-base__OverlayFrame",
10762
10762
  componentId: "r4sytz-0"
10763
- })(["position:fixed;top:0;left:0;width:100%;height:100vh;z-index:20000;background-color:", ";justify-content:center;animation:", " .1s ease-out;"], Background.Overlay, fadeIn);
10763
+ })(["position:fixed;top:0;left:0;width:100%;height:100%;z-index:20000;background-color:", ";justify-content:center;animation:", " .2s ease-out;"], Background.Overlay, fadeIn);
10764
10764
  const ModalFrame = /*#__PURE__*/styled(Flex).withConfig({
10765
10765
  displayName: "modal-base__ModalFrame",
10766
10766
  componentId: "r4sytz-1"
10767
- })(["background-color:", ";z-index:20010;width:", ";position:fixed;transform:translate(-50%,-50%);", ";border-radius:8px;animation:", " .1s ease-in;"], Surface.Default.Default, ({
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 modalSizeToPixelSize = {
10771
- [0
10772
- /* MODAL_SIZE.SMALL */
10773
- ]: '456px',
10774
- [1
10775
- /* MODAL_SIZE.CRITICAL */
10776
- ]: '518px',
10777
- [2
10778
- /* MODAL_SIZE.DEFAULT */
10779
- ]: '616px',
10780
- [3
10781
- /* MODAL_SIZE.LARGE */
10782
- ]: '776px',
10783
- [4
10784
- /* MODAL_SIZE.X_LARGE */
10785
- ]: '936px'
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: modalSizeToPixelSize[defaultTo(modalSize, 2
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
- size,
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
- size: size,
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: 1
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
- export declare const enum MODAL_SIZE {
4
- SMALL = 0,
5
- CRITICAL = 1,
6
- DEFAULT = 2,
7
- LARGE = 3,
8
- X_LARGE = 4
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 {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edvisor/product-language",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "license": "MIT",
5
5
  "description": "Edvisor.io product-language components",
6
6
  "repository": "https://github.com/edvisor-io/front-end/",