@zimyo/ui 1.1.10 → 1.2.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import React$1 from 'react';
2
- import { ButtonProps as ButtonProps$1, SelectProps as SelectProps$1, SelectChangeEvent, AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps, SwitchProps as SwitchProps$1, TextFieldProps, TypographyProps, SxProps as SxProps$1 } from '@mui/material';
1
+ import React$1, { ReactNode } from 'react';
2
+ import { ButtonProps as ButtonProps$1, SelectProps as SelectProps$1, SelectChangeEvent, AccordionProps as AccordionProps$1, AccordionSummaryProps, AccordionDetailsProps, SwitchProps as SwitchProps$1, TextFieldProps, TypographyProps, SxProps as SxProps$1, DialogProps } from '@mui/material';
3
3
  import { SxProps } from '@mui/system';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { Theme } from '@mui/material/styles';
@@ -132,6 +132,17 @@ interface CodeProps {
132
132
  }
133
133
  declare const Code: ({ children, sx }: CodeProps) => react_jsx_runtime.JSX.Element;
134
134
 
135
+ interface ModalProps extends Omit<DialogProps, 'title'> {
136
+ open: boolean;
137
+ onClose: () => void;
138
+ title?: ReactNode;
139
+ content?: ReactNode;
140
+ actions?: ReactNode;
141
+ maxWidth?: DialogProps['maxWidth'];
142
+ fullWidth?: boolean;
143
+ }
144
+ declare const Modal: ({ open, onClose, title, content, actions, fullWidth, maxWidth, ...rest }: ModalProps) => react_jsx_runtime.JSX.Element;
145
+
135
146
  interface UILibraryThemeProviderProps {
136
147
  children: React$1.ReactNode;
137
148
  primaryColor?: string;
@@ -218,5 +229,5 @@ declare const designTokens: {
218
229
  };
219
230
  };
220
231
 
221
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Blockquote, Button, Caption, Code, Heading, Lead, Muted, RadioGroup, Select, Strong, Switch, Text, TextInput, UILibraryThemeProvider, createCustomTheme, designTokens, theme };
222
- export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, ButtonProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, TextInputProps, ThemeConfig, UILibraryThemeProviderProps };
232
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Blockquote, Button, Caption, Code, Heading, Lead, Modal, Muted, RadioGroup, Select, Strong, Switch, Text, TextInput, UILibraryThemeProvider, createCustomTheme, designTokens, theme };
233
+ export type { AccordionContentProps, AccordionItemProps, AccordionProps, AccordionTriggerProps, ButtonProps, ModalProps, RadioGroupProps, RadioOption, SelectProps, SwitchProps, TextInputProps, ThemeConfig, UILibraryThemeProviderProps };
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import React, { forwardRef, createElement } from 'react';
3
- import { Button as Button$1, CircularProgress, useTheme, Card, CardHeader as CardHeader$1, Typography, CardActions as CardActions$1, Box, Skeleton, FormControl, Select as Select$1, OutlinedInput, IconButton, MenuItem, ListItemText, FormHelperText, Chip, Accordion as Accordion$1, AccordionSummary, AccordionDetails, FormControlLabel, Switch as Switch$1, TextField, InputAdornment, FormLabel, RadioGroup as RadioGroup$1, Radio, GlobalStyles, CssBaseline } from '@mui/material';
3
+ import { Button as Button$1, CircularProgress, useTheme, Card, CardHeader as CardHeader$1, Typography, CardActions as CardActions$1, Box, Skeleton, FormControl, Select as Select$1, OutlinedInput, IconButton, MenuItem, ListItemText, FormHelperText, Chip, Accordion as Accordion$1, AccordionSummary, AccordionDetails, FormControlLabel, Switch as Switch$1, TextField, InputAdornment, FormLabel, RadioGroup as RadioGroup$1, Radio, Dialog, DialogTitle, DialogContent, DialogActions, GlobalStyles, CssBaseline } from '@mui/material';
4
4
  import MuiCardContent from '@mui/material/CardContent';
5
5
  import CardMedia from '@mui/material/CardMedia';
6
6
  import { createTheme, ThemeProvider } from '@mui/material/styles';
@@ -518,6 +518,17 @@ const Code = ({ children, sx }) => {
518
518
  }, children: children }));
519
519
  };
520
520
 
521
+ const Modal = ({ open, onClose, title, content, actions, fullWidth = true, maxWidth = 'sm', ...rest }) => {
522
+ const theme = useTheme();
523
+ return (jsxs(Dialog, { open: open, onClose: onClose, fullWidth: fullWidth, maxWidth: maxWidth, scroll: "body", PaperProps: {
524
+ sx: {
525
+ borderRadius: 1.5,
526
+ p: 1,
527
+ backgroundColor: theme.palette.background.paper,
528
+ },
529
+ }, ...rest, children: [!!title && (jsxs(DialogTitle, { sx: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [jsx(Heading, { level: 6, children: title }), jsx(IconButton, { edge: "end", onClick: onClose, children: jsx(X, { size: 18, strokeWidth: 2 }) })] })), !!content && jsx(DialogContent, { dividers: true, children: content }), !!actions && jsx(DialogActions, { children: actions })] }));
530
+ };
531
+
521
532
  const designTokens = {
522
533
  colors: {
523
534
  primary: {
@@ -645,7 +656,7 @@ const createCustomTheme = (config = {}) => {
645
656
  styleOverrides: {
646
657
  root: {
647
658
  textTransform: 'none',
648
- fontWeight: 500,
659
+ fontWeight: 400,
649
660
  letterSpacing: '0.5px',
650
661
  padding: '6px 12px',
651
662
  },
@@ -747,4 +758,4 @@ const UILibraryThemeProvider = ({ children, primaryColor, secondaryColor, enable
747
758
  return (jsxs(ThemeProvider, { theme: theme, children: [enableCssBaseline && jsx(CssBaseline, {}), jsx(Fonts, {}), children] }));
748
759
  };
749
760
 
750
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Blockquote, Button, Caption, Code, Heading, Lead, Muted, RadioGroup, Select, Strong, Switch, Text, TextInput, UILibraryThemeProvider, createCustomTheme, designTokens, theme };
761
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Blockquote, Button, Caption, Code, Heading, Lead, Modal, Muted, RadioGroup, Select, Strong, Switch, Text, TextInput, UILibraryThemeProvider, createCustomTheme, designTokens, theme };
package/dist/index.js CHANGED
@@ -520,6 +520,17 @@ const Code = ({ children, sx }) => {
520
520
  }, children: children }));
521
521
  };
522
522
 
523
+ const Modal = ({ open, onClose, title, content, actions, fullWidth = true, maxWidth = 'sm', ...rest }) => {
524
+ const theme = material.useTheme();
525
+ return (jsxRuntime.jsxs(material.Dialog, { open: open, onClose: onClose, fullWidth: fullWidth, maxWidth: maxWidth, scroll: "body", PaperProps: {
526
+ sx: {
527
+ borderRadius: 1.5,
528
+ p: 1,
529
+ backgroundColor: theme.palette.background.paper,
530
+ },
531
+ }, ...rest, children: [!!title && (jsxRuntime.jsxs(material.DialogTitle, { sx: { display: 'flex', justifyContent: 'space-between', alignItems: 'center' }, children: [jsxRuntime.jsx(Heading, { level: 6, children: title }), jsxRuntime.jsx(material.IconButton, { edge: "end", onClick: onClose, children: jsxRuntime.jsx(X, { size: 18, strokeWidth: 2 }) })] })), !!content && jsxRuntime.jsx(material.DialogContent, { dividers: true, children: content }), !!actions && jsxRuntime.jsx(material.DialogActions, { children: actions })] }));
532
+ };
533
+
523
534
  const designTokens = {
524
535
  colors: {
525
536
  primary: {
@@ -647,7 +658,7 @@ const createCustomTheme = (config = {}) => {
647
658
  styleOverrides: {
648
659
  root: {
649
660
  textTransform: 'none',
650
- fontWeight: 500,
661
+ fontWeight: 400,
651
662
  letterSpacing: '0.5px',
652
663
  padding: '6px 12px',
653
664
  },
@@ -759,6 +770,7 @@ exports.Caption = Caption;
759
770
  exports.Code = Code;
760
771
  exports.Heading = Heading;
761
772
  exports.Lead = Lead;
773
+ exports.Modal = Modal;
762
774
  exports.Muted = Muted;
763
775
  exports.RadioGroup = RadioGroup;
764
776
  exports.Select = Select;
@@ -129,7 +129,7 @@ const createCustomTheme = (config = {}) => {
129
129
  styleOverrides: {
130
130
  root: {
131
131
  textTransform: 'none',
132
- fontWeight: 500,
132
+ fontWeight: 400,
133
133
  letterSpacing: '0.5px',
134
134
  padding: '6px 12px',
135
135
  },
@@ -131,7 +131,7 @@ const createCustomTheme = (config = {}) => {
131
131
  styleOverrides: {
132
132
  root: {
133
133
  textTransform: 'none',
134
- fontWeight: 500,
134
+ fontWeight: 400,
135
135
  letterSpacing: '0.5px',
136
136
  padding: '6px 12px',
137
137
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zimyo/ui",
3
- "version": "1.1.10",
3
+ "version": "1.2.0",
4
4
  "description": "Zimyo UI library built on MUI Material",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",