@soyfri/shared-library 1.1.3 → 1.1.5
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/cjs/components/Button/Button.cjs +1 -1
- package/cjs/components/Flyout/Flyout.cjs +2 -0
- package/cjs/components/Flyout/Flyout.cjs.map +1 -0
- package/cjs/components/Flyout.cjs +2 -0
- package/cjs/components/Flyout.cjs.map +1 -0
- package/cjs/components/InputGroup/InputGroup.cjs +2 -0
- package/cjs/components/InputGroup/InputGroup.cjs.map +1 -0
- package/cjs/components/InputGroup.cjs +2 -0
- package/cjs/components/InputGroup.cjs.map +1 -0
- package/cjs/node_modules/@mui/icons-material/esm/Close.cjs +2 -0
- package/cjs/node_modules/@mui/icons-material/esm/Close.cjs.map +1 -0
- package/components/Flyout/index.ts +1 -0
- package/components/InputGroup/index.ts +1 -0
- package/esm/components/Button/Button.d.ts +2 -1
- package/esm/components/Button/Button.js +1 -1
- package/esm/components/Flyout/Flyout.d.ts +13 -0
- package/esm/components/Flyout/Flyout.js +2 -0
- package/esm/components/Flyout/Flyout.js.map +1 -0
- package/esm/components/Flyout/Flyout.stories.d.ts +12 -0
- package/esm/components/Flyout/index.d.ts +1 -0
- package/esm/components/Flyout.js +2 -0
- package/esm/components/Flyout.js.map +1 -0
- package/esm/components/InputGroup/InputGroup.d.ts +13 -0
- package/esm/components/InputGroup/InputGroup.js +2 -0
- package/esm/components/InputGroup/InputGroup.js.map +1 -0
- package/esm/components/InputGroup/InputGroup.stories.d.ts +8 -0
- package/esm/components/InputGroup/index.d.ts +1 -0
- package/esm/components/InputGroup.js +2 -0
- package/esm/components/InputGroup.js.map +1 -0
- package/esm/node_modules/@mui/icons-material/esm/Close.js +2 -0
- package/esm/node_modules/@mui/icons-material/esm/Close.js.map +1 -0
- package/package.json +11 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/jsx-runtime.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/jsx-runtime.cjs"),t=require("@mui/material");const i=({children:i,variant:a,disabled:o,startIcon:n,endIcon:s,size:r,className:d,onClick:l,loading:c,loadingPosition:u,loadingIndicator:p,color:x,href:m,"data-testid":g,type:v})=>e.jsxRuntimeExports.jsx(t.Button,{disabled:o,variant:a,startIcon:n,endIcon:s,size:r,className:d,onClick:l,loading:c,loadingPosition:u,loadingIndicator:p,sx:{textTransform:"none"},disableRipple:!0,disableElevation:!0,color:x,"data-testid":g,href:m,type:v,children:i});exports.Button=i,exports.default=i;
|
|
2
2
|
//# sourceMappingURL=Button.cjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("../../_virtual/jsx-runtime.cjs"),t=require("react"),r=require("@mui/material"),s=require("../../node_modules/@mui/icons-material/esm/Close.cjs");module.exports=({open:o,onClose:i,title:n,anchor:a="right",children:l,size:x="medium",height:u="auto"})=>{const c=(e=>{switch(e){case"small":return Math.round(345);case"medium":default:return Math.round(517.5);case"large":return Math.round(690)}})(x),m=t.useMemo((()=>"left"===a||"right"===a?{width:c}:{height:u,width:"100%"}),[a,c,u]);return e.jsxRuntimeExports.jsx(r.Drawer,{anchor:a,open:o,onClose:i,disableEscapeKeyDown:!1,ModalProps:{keepMounted:!0},children:e.jsxRuntimeExports.jsxs(r.Box,{sx:Object.assign(Object.assign({},m),{display:"flex",flexDirection:"column",p:2,backgroundColor:e=>e.palette.background.paper,color:e=>e.palette.text.primary,height:"100%"}),role:"presentation",children:[e.jsxRuntimeExports.jsxs(r.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,flexShrink:0},children:[n&&e.jsxRuntimeExports.jsx(r.Typography,{variant:"h6",component:"div",sx:{fontWeight:"bold"},children:n}),e.jsxRuntimeExports.jsx(r.IconButton,{onClick:i,sx:{ml:"auto"},children:e.jsxRuntimeExports.jsx(s,{})})]}),e.jsxRuntimeExports.jsx(r.Divider,{sx:{mb:2}})," ",e.jsxRuntimeExports.jsx(r.Box,{sx:{flexGrow:1,overflowY:"auto"},children:l})]})})};
|
|
2
|
+
//# sourceMappingURL=Flyout.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flyout.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flyout.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("../../_virtual/jsx-runtime.cjs"),t=require("react"),r=require("@mui/material"),i=require("../Input/Input.cjs"),o=require("../Select/Select.cjs"),u=require("../DatePicker/DatePicker.cjs"),s=require("../../node_modules/@mui/x-date-pickers/esm/DatePicker/DatePicker.cjs");module.exports=({children:n})=>{const d=t.Children.toArray(n),a=d.map(((n,a)=>{if(t.isValidElement(n)){const l=n.props,p=n.type,c=p===r.TextField||p===i.Input||p===r.Select||p===o.Select||p===s.DatePicker||p===u.DatePicker?t.cloneElement(n,Object.assign(Object.assign({},l),{sx:Object.assign(Object.assign({},l.sx),{"& .MuiOutlinedInput-notchedOutline":{border:"none"},".MuiFormLabel-filled":{backgroundColor:"white"},".MuiInputLabel-shrink":{backgroundColor:"white"},fieldset:{border:"none !important"},"& .MuiInputBase-root .MuiButtonBase-root":{borderRight:"none"},".MuiFormControl-root .MuiFormControl-fullWidth > fieldset.MuiOutlinedInput-notchedOutline":{backgroundColor:"red"}})})):n;return e.jsxRuntimeExports.jsx(r.Box,{sx:{flexGrow:1,display:"flex",alignItems:"center",minWidth:0,borderRight:a<d.length-1?"1px solid #ccc":"none"},children:c},a)}return n}));return e.jsxRuntimeExports.jsx(r.Box,{sx:{display:"flex",justifyContent:"space-between",height:"33px",border:"0.7px solid #ccc",borderRadius:"10px",padding:"8px 10px","& .MuiInputBase-root, & .MuiButtonBase-root, & .MuiChip-root":{borderRadius:0},"& > div:first-of-type .MuiInputBase-root, & > div:first-of-type .MuiButtonBase-root, & > div:first-of-type .MuiChip-root":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"& > div:last-of-type .MuiInputBase-root, & > div:last-of-type .MuiButtonBase-root, & > div:last-of-type .MuiChip-root":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},children:a})};
|
|
2
|
+
//# sourceMappingURL=InputGroup.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("../../../../_virtual/jsx-runtime.cjs"),r=require("../../material/esm/utils/createSvgIcon.cjs")(e.jsxRuntimeExports.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");module.exports=r;
|
|
2
|
+
//# sourceMappingURL=Close.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Close.cjs","sources":["../../../../../../node_modules/@mui/icons-material/esm/Close.js"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');"],"names":["CloseIcon","createSvgIcon","_jsx","jsxRuntimeExports","jsx","d"],"mappings":"mEAIAA,uDAAeC,CAA2BC,EAAIC,kBAAAC,IAAC,OAAQ,CACrDC,EAAG,0GACD","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../esm/components/Flyout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../esm/components/InputGroup';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ButtonProps } from "@mui/material/Button";
|
|
2
2
|
import React from "react";
|
|
3
|
-
type PickButtonProps = Pick<ButtonProps, "href" | "children" | "onClick" | "color" | "disabled" | "className" | "endIcon" | "startIcon" | "loading" | "loadingIndicator" | "variant" | "size" | "loadingPosition">;
|
|
3
|
+
type PickButtonProps = Pick<ButtonProps, "href" | "children" | "onClick" | "color" | "disabled" | "className" | "endIcon" | "startIcon" | "loading" | "loadingIndicator" | "variant" | "size" | "loadingPosition" | "type">;
|
|
4
4
|
export interface MyButtonProps extends PickButtonProps {
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
variant?: "text" | "outlined" | "contained";
|
|
@@ -16,6 +16,7 @@ export interface MyButtonProps extends PickButtonProps {
|
|
|
16
16
|
color?: "primary" | "success" | "error" | "info" | "warning";
|
|
17
17
|
href?: string;
|
|
18
18
|
"data-testid"?: string;
|
|
19
|
+
type?: "button" | "submit";
|
|
19
20
|
}
|
|
20
21
|
export declare const Button: React.FC<MyButtonProps>;
|
|
21
22
|
export default Button;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as a}from"../../_virtual/jsx-runtime.js";import{Button as i}from"@mui/material";const o=({children:o,variant:
|
|
1
|
+
import{j as a}from"../../_virtual/jsx-runtime.js";import{Button as i}from"@mui/material";const o=({children:o,variant:t,disabled:n,startIcon:e,endIcon:s,size:d,className:l,onClick:r,loading:c,loadingPosition:m,loadingIndicator:p,color:f,href:g,"data-testid":I,type:u})=>a.jsx(i,{disabled:n,variant:t,startIcon:e,endIcon:s,size:d,className:l,onClick:r,loading:c,loadingPosition:m,loadingIndicator:p,sx:{textTransform:"none"},disableRipple:!0,disableElevation:!0,color:f,"data-testid":I,href:g,type:u,children:o});export{o as Button,o as default};
|
|
2
2
|
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type FlyoutSize = 'small' | 'medium' | 'large';
|
|
3
|
+
export interface FlyoutProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
title?: string;
|
|
7
|
+
anchor?: 'left' | 'top' | 'right' | 'bottom';
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
size?: FlyoutSize;
|
|
10
|
+
height?: string | number;
|
|
11
|
+
}
|
|
12
|
+
declare const Flyout: React.FC<FlyoutProps>;
|
|
13
|
+
export default Flyout;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e}from"../../_virtual/jsx-runtime.js";import{useMemo as t}from"react";import{Drawer as r,Box as o,Typography as s,IconButton as i,Divider as n}from"@mui/material";import a from"../../node_modules/@mui/icons-material/esm/Close.js";const l=({open:l,onClose:c,title:d,anchor:m="right",children:h,size:u="medium",height:x="auto"})=>{const p=(e=>{switch(e){case"small":return Math.round(345);case"medium":default:return Math.round(517.5);case"large":return Math.round(690)}})(u),f=t((()=>"left"===m||"right"===m?{width:p}:{height:x,width:"100%"}),[m,p,x]);return e.jsx(r,{anchor:m,open:l,onClose:c,disableEscapeKeyDown:!1,ModalProps:{keepMounted:!0},children:e.jsxs(o,{sx:Object.assign(Object.assign({},f),{display:"flex",flexDirection:"column",p:2,backgroundColor:e=>e.palette.background.paper,color:e=>e.palette.text.primary,height:"100%"}),role:"presentation",children:[e.jsxs(o,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,flexShrink:0},children:[d&&e.jsx(s,{variant:"h6",component:"div",sx:{fontWeight:"bold"},children:d}),e.jsx(i,{onClick:c,sx:{ml:"auto"},children:e.jsx(a,{})})]}),e.jsx(n,{sx:{mb:2}})," ",e.jsx(o,{sx:{flexGrow:1,overflowY:"auto"},children:h})]})})};export{l as default};
|
|
2
|
+
//# sourceMappingURL=Flyout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flyout.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import Flyout from './Flyout';
|
|
3
|
+
declare const meta: Meta<typeof Flyout>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Flyout>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const SmallLeft: Story;
|
|
8
|
+
export declare const LargeRight: Story;
|
|
9
|
+
export declare const TopAnchor: Story;
|
|
10
|
+
export declare const BottomAnchor: Story;
|
|
11
|
+
export declare const NoTitle: Story;
|
|
12
|
+
export declare const CustomContent: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Flyout } from './Flyout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Flyout.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface InputGroupProps {
|
|
3
|
+
/**
|
|
4
|
+
* Los componentes hijos a ser agrupados.
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Componente que agrupa elementos de entrada de Material-UI, eliminando sus
|
|
10
|
+
* bordes y añadiendo un divisor entre ellos.
|
|
11
|
+
*/
|
|
12
|
+
declare const InputGroup: React.FC<InputGroupProps>;
|
|
13
|
+
export default InputGroup;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as t}from"../../_virtual/jsx-runtime.js";import{Children as o,isValidElement as e,cloneElement as r}from"react";import{Box as i,TextField as s,Select as n}from"@mui/material";import{Input as u}from"../Input/Input.js";import{Select as a}from"../Select/Select.js";import{DatePicker as d}from"../DatePicker/DatePicker.js";import{DatePicker as p}from"../../node_modules/@mui/x-date-pickers/esm/DatePicker/DatePicker.js";const l=({children:l})=>{const c=o.toArray(l),m=c.map(((o,l)=>{if(e(o)){const e=o.props,m=o.type,f=m===s||m===u||m===n||m===a||m===p||m===d?r(o,Object.assign(Object.assign({},e),{sx:Object.assign(Object.assign({},e.sx),{"& .MuiOutlinedInput-notchedOutline":{border:"none"},".MuiFormLabel-filled":{backgroundColor:"white"},".MuiInputLabel-shrink":{backgroundColor:"white"},fieldset:{border:"none !important"},"& .MuiInputBase-root .MuiButtonBase-root":{borderRight:"none"},".MuiFormControl-root .MuiFormControl-fullWidth > fieldset.MuiOutlinedInput-notchedOutline":{backgroundColor:"red"}})})):o;return t.jsx(i,{sx:{flexGrow:1,display:"flex",alignItems:"center",minWidth:0,borderRight:l<c.length-1?"1px solid #ccc":"none"},children:f},l)}return o}));return t.jsx(i,{sx:{display:"flex",justifyContent:"space-between",height:"33px",border:"0.7px solid #ccc",borderRadius:"10px",padding:"8px 10px","& .MuiInputBase-root, & .MuiButtonBase-root, & .MuiChip-root":{borderRadius:0},"& > div:first-of-type .MuiInputBase-root, & > div:first-of-type .MuiButtonBase-root, & > div:first-of-type .MuiChip-root":{borderTopLeftRadius:"10px",borderBottomLeftRadius:"10px"},"& > div:last-of-type .MuiInputBase-root, & > div:last-of-type .MuiButtonBase-root, & > div:last-of-type .MuiChip-root":{borderTopRightRadius:"10px",borderBottomRightRadius:"10px"}},children:m})};export{l as default};
|
|
2
|
+
//# sourceMappingURL=InputGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import InputGroup from './InputGroup';
|
|
3
|
+
declare const meta: Meta<typeof InputGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof InputGroup>;
|
|
6
|
+
export declare const BasicInputGroup: Story;
|
|
7
|
+
export declare const CombinedInputGroup: Story;
|
|
8
|
+
export declare const DatePickerInputGroup: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as InputGroup } from './InputGroup';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as r}from"../../../../_virtual/jsx-runtime.js";import t from"../../material/esm/utils/createSvgIcon.js";var a=t(r.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{a as default};
|
|
2
|
+
//# sourceMappingURL=Close.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Close.js","sources":["../../../../../../node_modules/@mui/icons-material/esm/Close.js"],"sourcesContent":["\"use client\";\n\nimport createSvgIcon from \"./utils/createSvgIcon.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon(/*#__PURE__*/_jsx(\"path\", {\n d: \"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"\n}), 'Close');"],"names":["CloseIcon","createSvgIcon","_jsx","jsx","d"],"mappings":"iHAIA,IAAAA,EAAeC,EAA2BC,EAAIC,IAAC,OAAQ,CACrDC,EAAG,0GACD","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soyfri/shared-library",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
"require": "./cjs/components/Select.cjs",
|
|
49
49
|
"types": "./esm/components/Select/Select.d.ts"
|
|
50
50
|
},
|
|
51
|
+
"./components/InputGroup": {
|
|
52
|
+
"import": "./esm/components/InputGroup.js",
|
|
53
|
+
"require": "./cjs/components/InputGroup.cjs",
|
|
54
|
+
"types": "./esm/components/InputGroup/InputGroup.d.ts"
|
|
55
|
+
},
|
|
51
56
|
"./components/Input": {
|
|
52
57
|
"import": "./esm/components/Input.js",
|
|
53
58
|
"require": "./cjs/components/Input.cjs",
|
|
@@ -58,6 +63,11 @@
|
|
|
58
63
|
"require": "./cjs/components/Icon.cjs",
|
|
59
64
|
"types": "./esm/components/Icon/Icon.d.ts"
|
|
60
65
|
},
|
|
66
|
+
"./components/Flyout": {
|
|
67
|
+
"import": "./esm/components/Flyout.js",
|
|
68
|
+
"require": "./cjs/components/Flyout.cjs",
|
|
69
|
+
"types": "./esm/components/Flyout/Flyout.d.ts"
|
|
70
|
+
},
|
|
61
71
|
"./components/DateTimePicker": {
|
|
62
72
|
"import": "./esm/components/DateTimePicker.js",
|
|
63
73
|
"require": "./cjs/components/DateTimePicker.cjs",
|