@nuskin/foundation-ui-components 1.19.2 → 1.19.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/foundation-ui-components",
3
- "version": "1.19.2",
3
+ "version": "1.19.3",
4
4
  "description": "It is a foundation library written in react, that provides common components to all UI pages",
5
5
  "main": "src/common/index.ts",
6
6
  "repository": {
@@ -46,7 +46,7 @@
46
46
  "@mui/material": "5.14.16",
47
47
  "@mui/utils": "^5.14.16",
48
48
  "@next/font": "13.5.6",
49
- "@nuskin/foundation-theme": "^1.4.0",
49
+ "@nuskin/foundation-theme": "1.4.1",
50
50
  "@types/react": "^18.2.34",
51
51
  "@types/react-dom": "^18.2.14",
52
52
  "cliui": "^8.0.1",
@@ -1,21 +1,27 @@
1
1
  import React from 'react';
2
+
2
3
  import Dialog from '@mui/material/Dialog';
3
- import { useMediaQuery } from '@mui/material';
4
- import { useTheme } from '@mui/material/styles';
4
+
5
5
  import { ModalVariantMap } from './model/NsModalVariantMap';
6
6
  import { NsModalProps } from './types';
7
7
 
8
8
  const NsModal = (props: NsModalProps) => {
9
- const { open, handleClose, header, body, additionalProps, footer, statusInfo, variant = 'default' } = props;
9
+ const {
10
+ open,
11
+ handleClose,
12
+ header,
13
+ body,
14
+ additionalProps,
15
+ footer,
16
+ statusInfo,
17
+ variant = 'default',
18
+ fullScreen,
19
+ } = props;
10
20
 
11
21
  const { className, scrollType = 'paper', ariaLabel } = additionalProps || {};
12
22
 
13
23
  const { ariaLabelledby = 'alert-dialog-title', ariaDescribedby = 'alert-dialog-description' } = ariaLabel || {};
14
24
 
15
- const theme = useTheme();
16
-
17
- const fullScreen: boolean = useMediaQuery(theme.breakpoints.down('md'));
18
-
19
25
  const Component = ModalVariantMap[variant];
20
26
 
21
27
  return (
@@ -9,6 +9,7 @@ export interface DialogTitleProps {
9
9
 
10
10
  export interface NsModalProps extends NsModalComponentProps {
11
11
  open: boolean;
12
+ fullScreen?: boolean;
12
13
  }
13
14
 
14
15
  export interface NsModalComponentProps {
@@ -2,21 +2,15 @@ import React from 'react';
2
2
  import { render } from '@testing-library/react';
3
3
 
4
4
  import NsTypography from './NsTypography';
5
- import GlobalFontInter from './GlobalFontInter';
6
5
 
7
6
  describe('GlobalFontInter', () => {
8
- it('1. should apply the Inter font to the body element', () => {
9
- render(<GlobalFontInter />);
10
- const fontStyle = window.getComputedStyle(document.body).fontFamily;
11
- expect(fontStyle).toContain('Inter');
12
- });
13
- it('2. renders without crashing', () => {
7
+ it('1. renders without crashing', () => {
14
8
  const text = 'Hello Typo!';
15
9
  const { getByText } = render(<NsTypography variant={'h1'}>{text}</NsTypography>);
16
10
  expect(getByText(text)).toBeInTheDocument();
17
11
  });
18
12
 
19
- it('3. renders without crashing with p-l variant', () => {
13
+ it('2. renders without crashing with p-l variant', () => {
20
14
  const text = 'Hello Typo!';
21
15
  const { getByText } = render(
22
16
  <NsTypography
@@ -33,7 +27,7 @@ describe('GlobalFontInter', () => {
33
27
  expect(getByText(text)).toBeInTheDocument();
34
28
  });
35
29
 
36
- it('4. should not render with default color primary when color is passed', () => {
30
+ it('3. should not render with default color primary when color is passed', () => {
37
31
  const text = 'Hello Typo!';
38
32
  const { getByText } = render(
39
33
  <NsTypography