@pautena/react-design-system 0.14.1 → 0.14.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/action/cjs/index.js +1 -1
- package/action/cjs/index.js.map +1 -1
- package/action/index.js +1 -1
- package/action/index.js.map +1 -1
- package/autocomplete/autocomplete.d.ts +2 -1
- package/autocomplete/cjs/index.js +1 -23
- package/autocomplete/cjs/index.js.map +1 -1
- package/autocomplete/index.js +1 -23
- package/autocomplete/index.js.map +1 -1
- package/board/board.d.ts +1 -1
- package/board/cjs/index.js +1 -1
- package/board/cjs/index.js.map +1 -1
- package/board/index.js +1 -1
- package/board/index.js.map +1 -1
- package/bootstrap-dialog/cjs/index.js +1 -1
- package/bootstrap-dialog/cjs/index.js.map +1 -1
- package/bootstrap-dialog/index.js +1 -1
- package/bootstrap-dialog/index.js.map +1 -1
- package/bullet/bullet.d.ts +1 -1
- package/bullet/cjs/index.js +1 -1
- package/bullet/cjs/index.js.map +1 -1
- package/bullet/index.js +1 -1
- package/bullet/index.js.map +1 -1
- package/center-container/center-container.d.ts +1 -1
- package/center-container/cjs/index.js +1 -1
- package/center-container/cjs/index.js.map +1 -1
- package/center-container/index.js +1 -1
- package/center-container/index.js.map +1 -1
- package/cjs/index.js +4 -4
- package/cjs/index.js.map +1 -1
- package/confirm-dialog/cjs/index.js +1 -1
- package/confirm-dialog/cjs/index.js.map +1 -1
- package/confirm-dialog/index.js +1 -1
- package/confirm-dialog/index.js.map +1 -1
- package/content/cjs/index.js +1 -1
- package/content/cjs/index.js.map +1 -1
- package/content/index.js +1 -1
- package/content/index.js.map +1 -1
- package/content-placeholder/cjs/index.js +1 -1
- package/content-placeholder/cjs/index.js.map +1 -1
- package/content-placeholder/index.js +1 -1
- package/content-placeholder/index.js.map +1 -1
- package/date-range-calendar/cjs/index.js +1 -1
- package/date-range-calendar/cjs/index.js.map +1 -1
- package/date-range-calendar/index.js +1 -1
- package/date-range-calendar/index.js.map +1 -1
- package/date-range-picker/cjs/index.js +1 -1
- package/date-range-picker/cjs/index.js.map +1 -1
- package/date-range-picker/index.js +1 -1
- package/date-range-picker/index.js.map +1 -1
- package/drawer/cjs/index.js +1 -1
- package/drawer/cjs/index.js.map +1 -1
- package/drawer/drawer.d.ts +3 -3
- package/drawer/drawer.types.d.ts +2 -1
- package/drawer/index.js +1 -1
- package/drawer/index.js.map +1 -1
- package/drawer-app-bar/cjs/index.js +1 -1
- package/drawer-app-bar/cjs/index.js.map +1 -1
- package/drawer-app-bar/index.js +1 -1
- package/drawer-app-bar/index.js.map +1 -1
- package/drawer-content/cjs/index.js +1 -1
- package/drawer-content/cjs/index.js.map +1 -1
- package/drawer-content/drawer-content.d.ts +1 -1
- package/drawer-content/index.js +1 -1
- package/drawer-content/index.js.map +1 -1
- package/drawer-item/cjs/index.js +1 -1
- package/drawer-item/cjs/index.js.map +1 -1
- package/drawer-item/drawer-item-link.d.ts +2 -2
- package/drawer-item/drawer-item.d.ts +1 -1
- package/drawer-item/drawer-menu-item.d.ts +2 -2
- package/drawer-item/index.js +1 -1
- package/drawer-item/index.js.map +1 -1
- package/drawer-layout/cjs/index.js +1 -1
- package/drawer-layout/cjs/index.js.map +1 -1
- package/drawer-layout/drawer-layout.d.ts +2 -2
- package/drawer-layout/index.js +1 -1
- package/drawer-layout/index.js.map +1 -1
- package/drawer-main/cjs/index.js +1 -1
- package/drawer-main/cjs/index.js.map +1 -1
- package/drawer-main/index.js +1 -1
- package/drawer-main/index.js.map +1 -1
- package/drawer-provider/cjs/index.js +1 -1
- package/drawer-provider/cjs/index.js.map +1 -1
- package/drawer-provider/drawer-context.d.ts +1 -1
- package/drawer-provider/drawer.provider.d.ts +1 -1
- package/drawer-provider/index.js +1 -1
- package/drawer-provider/index.js.map +1 -1
- package/drawer-section/cjs/index.js +1 -1
- package/drawer-section/cjs/index.js.map +1 -1
- package/drawer-section/drawer-section.d.ts +1 -1
- package/drawer-section/index.js +1 -1
- package/drawer-section/index.js.map +1 -1
- package/drawer-subheader/cjs/index.js +1 -1
- package/drawer-subheader/cjs/index.js.map +1 -1
- package/drawer-subheader/drawer-subheader.d.ts +5 -5
- package/drawer-subheader/index.js +1 -1
- package/drawer-subheader/index.js.map +1 -1
- package/enhanced-remote-table/cjs/index.js +4 -4
- package/enhanced-remote-table/cjs/index.js.map +1 -1
- package/enhanced-remote-table/enhanced-remote-table.mock.d.ts +1 -1
- package/enhanced-remote-table/index.js +4 -4
- package/enhanced-remote-table/index.js.map +1 -1
- package/enhanced-table/cjs/index.js +4 -4
- package/enhanced-table/cjs/index.js.map +1 -1
- package/enhanced-table/index.js +4 -4
- package/enhanced-table/index.js.map +1 -1
- package/expandable-alert/cjs/index.js +1 -1
- package/expandable-alert/cjs/index.js.map +1 -1
- package/expandable-alert/expandable-alert.d.ts +3 -3
- package/expandable-alert/index.js +1 -1
- package/expandable-alert/index.js.map +1 -1
- package/form-dialog/cjs/index.js +1 -1
- package/form-dialog/cjs/index.js.map +1 -1
- package/form-dialog/form-dialog.d.ts +1 -1
- package/form-dialog/index.js +1 -1
- package/form-dialog/index.js.map +1 -1
- package/group-value-card/cjs/index.js +1 -1
- package/group-value-card/cjs/index.js.map +1 -1
- package/group-value-card/group-value-card.d.ts +1 -1
- package/group-value-card/index.js +1 -1
- package/group-value-card/index.js.map +1 -1
- package/header/cjs/index.js +1 -1
- package/header/cjs/index.js.map +1 -1
- package/header/index.js +1 -1
- package/header/index.js.map +1 -1
- package/header-layout/cjs/index.js +1 -1
- package/header-layout/cjs/index.js.map +1 -1
- package/header-layout/header-layout.d.ts +3 -3
- package/header-layout/index.js +1 -1
- package/header-layout/index.js.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/label/cjs/index.js +1 -1
- package/label/cjs/index.js.map +1 -1
- package/label/index.js +1 -1
- package/label/index.js.map +1 -1
- package/label/label.d.ts +1 -1
- package/link/cjs/index.js +1 -1
- package/link/cjs/index.js.map +1 -1
- package/link/index.js +1 -1
- package/link/index.js.map +1 -1
- package/link/link.d.ts +5 -5
- package/link-card/cjs/index.js +1 -1
- package/link-card/cjs/index.js.map +1 -1
- package/link-card/index.js +1 -1
- package/link-card/index.js.map +1 -1
- package/link-card/link-card.d.ts +1 -1
- package/list-panel/cjs/index.js +1 -1
- package/list-panel/cjs/index.js.map +1 -1
- package/list-panel/index.js +1 -1
- package/list-panel/index.js.map +1 -1
- package/loading-area/cjs/index.js +1 -1
- package/loading-area/cjs/index.js.map +1 -1
- package/loading-area/index.js +1 -1
- package/loading-area/index.js.map +1 -1
- package/lorem-ipsum-placeholder/cjs/index.js +1 -1
- package/lorem-ipsum-placeholder/cjs/index.js.map +1 -1
- package/lorem-ipsum-placeholder/index.js +1 -1
- package/lorem-ipsum-placeholder/index.js.map +1 -1
- package/markdown/cjs/index.js +1 -1
- package/markdown/cjs/index.js.map +1 -1
- package/markdown/index.js +1 -1
- package/markdown/index.js.map +1 -1
- package/model-form/cjs/index.js +1 -1
- package/model-form/cjs/index.js.map +1 -1
- package/model-form/index.js +1 -1
- package/model-form/index.js.map +1 -1
- package/model-form/model-form-field.d.ts +1 -1
- package/model-form/model-form.d.ts +1 -1
- package/model-router/cjs/index.js +4 -4
- package/model-router/cjs/index.js.map +1 -1
- package/model-router/index.js +4 -4
- package/model-router/index.js.map +1 -1
- package/model-router/model-router.d.ts +1 -1
- package/model-router/screens/add-screen.d.ts +2 -2
- package/model-router/screens/details-screen.d.ts +2 -2
- package/model-router/screens/list-screen.d.ts +2 -2
- package/model-router/screens/screens.types.d.ts +1 -1
- package/model-router/screens/update-screen.d.ts +2 -2
- package/notification-center/cjs/index.js +1 -1
- package/notification-center/cjs/index.js.map +1 -1
- package/notification-center/index.js +1 -1
- package/notification-center/index.js.map +1 -1
- package/notification-center/notification-center.context.d.ts +3 -3
- package/object-details/cjs/index.js +1 -1
- package/object-details/cjs/index.js.map +1 -1
- package/object-details/index.js +1 -1
- package/object-details/index.js.map +1 -1
- package/object-details/object-details.d.ts +1 -1
- package/package.json +1 -1
- package/placeholder/cjs/index.js +1 -1
- package/placeholder/cjs/index.js.map +1 -1
- package/placeholder/index.js +1 -1
- package/placeholder/index.js.map +1 -1
- package/query-container/cjs/index.js +1 -1
- package/query-container/cjs/index.js.map +1 -1
- package/query-container/index.js +1 -1
- package/query-container/index.js.map +1 -1
- package/search-input/cjs/index.js +1 -1
- package/search-input/cjs/index.js.map +1 -1
- package/search-input/index.js +1 -1
- package/search-input/index.js.map +1 -1
- package/search-input/search-input.d.ts +1 -1
- package/select/cjs/index.js +1 -1
- package/select/cjs/index.js.map +1 -1
- package/select/index.js +1 -1
- package/select/index.js.map +1 -1
- package/select/select.d.ts +2 -2
- package/sign-in/cjs/index.js +1 -1
- package/sign-in/cjs/index.js.map +1 -1
- package/sign-in/index.js +1 -1
- package/sign-in/index.js.map +1 -1
- package/skeleton-card/cjs/index.js +1 -1
- package/skeleton-card/cjs/index.js.map +1 -1
- package/skeleton-card/index.js +1 -1
- package/skeleton-card/index.js.map +1 -1
- package/skeleton-grid/cjs/index.js +1 -1
- package/skeleton-grid/cjs/index.js.map +1 -1
- package/skeleton-grid/index.js +1 -1
- package/skeleton-grid/index.js.map +1 -1
- package/tab-card/cjs/index.js +1 -1
- package/tab-card/cjs/index.js.map +1 -1
- package/tab-card/index.js +1 -1
- package/tab-card/index.js.map +1 -1
- package/tab-panel/cjs/index.js +1 -1
- package/tab-panel/cjs/index.js.map +1 -1
- package/tab-panel/index.js +1 -1
- package/tab-panel/index.js.map +1 -1
- package/tab-panel/tab-panel.d.ts +1 -1
- package/tab-provider/cjs/index.js +1 -1
- package/tab-provider/cjs/index.js.map +1 -1
- package/tab-provider/index.js +1 -1
- package/tab-provider/index.js.map +1 -1
- package/table-list/cjs/index.js +4 -4
- package/table-list/cjs/index.js.map +1 -1
- package/table-list/index.js +4 -4
- package/table-list/index.js.map +1 -1
- package/table-list/table-list.d.ts +1 -1
- package/text-field/cjs/index.js +1 -23
- package/text-field/cjs/index.js.map +1 -1
- package/text-field/index.js +1 -23
- package/text-field/index.js.map +1 -1
- package/text-field/text-field.d.ts +1 -1
- package/value-base/cjs/index.js +1 -1
- package/value-base/cjs/index.js.map +1 -1
- package/value-base/index.js +1 -1
- package/value-base/index.js.map +1 -1
- package/value-base/value-edit.d.ts +3 -3
- package/value-boolean/cjs/index.js +1 -1
- package/value-boolean/cjs/index.js.map +1 -1
- package/value-boolean/index.js +1 -1
- package/value-boolean/index.js.map +1 -1
- package/value-card/cjs/index.js +1 -1
- package/value-card/cjs/index.js.map +1 -1
- package/value-card/index.js +1 -1
- package/value-card/index.js.map +1 -1
- package/value-content/cjs/index.js +1 -1
- package/value-content/cjs/index.js.map +1 -1
- package/value-content/index.js +1 -1
- package/value-content/index.js.map +1 -1
- package/value-content/value-content.d.ts +2 -2
- package/value-datetime/cjs/index.js +1 -1
- package/value-datetime/cjs/index.js.map +1 -1
- package/value-datetime/index.js +1 -1
- package/value-datetime/index.js.map +1 -1
- package/value-datetime/value-datetime.d.ts +1 -1
- package/value-image/cjs/index.js +1 -1
- package/value-image/cjs/index.js.map +1 -1
- package/value-image/index.js +1 -1
- package/value-image/index.js.map +1 -1
- package/value-image/value-image.d.ts +1 -1
- package/value-item/cjs/index.js +1 -1
- package/value-item/cjs/index.js.map +1 -1
- package/value-item/index.js +1 -1
- package/value-item/index.js.map +1 -1
- package/value-item/value-item.d.ts +1 -1
- package/value-label/cjs/index.js +1 -1
- package/value-label/cjs/index.js.map +1 -1
- package/value-label/index.js +1 -1
- package/value-label/index.js.map +1 -1
- package/value-label/value-label.d.ts +1 -1
- package/value-rating/cjs/index.js +1 -1
- package/value-rating/cjs/index.js.map +1 -1
- package/value-rating/index.js +1 -1
- package/value-rating/index.js.map +1 -1
- package/value-rating/value-rating.d.ts +1 -1
- package/value-text/cjs/index.js +1 -1
- package/value-text/cjs/index.js.map +1 -1
- package/value-text/index.js +1 -1
- package/value-text/index.js.map +1 -1
package/select/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{useId as i}from"react";import{styled as t}from"@mui/material/styles";import l from"@mui/material/Box";import o from"@mui/material/CircularProgress";import n from"@mui/material/FormControl";import m from"@mui/material/InputLabel";import a from"@mui/material/LinearProgress";import c from"@mui/material/Select";function u({children:r,centerVertical:i=!0,centerHorizontal:t=!0,sx:o}){return e(l,{width:1,height:1,sx:{...o,display:"flex",flexDirection:"column",justifyContent:i?"center":"flex-start",alignItems:t?"center":"flex-start"},children:r})}const s={small:15,medium:20},d=({label:d,value:f,loading:h=!1,fetching:p=!1,size:x="medium",fullWidth:b=!1,color:g,children:C,onChange:z})=>{const I=i(),y=t(n)((()=>g?{label:{color:g},".MuiOutlinedInput-notchedOutline":{borderColor:`${g} !important`},".MuiInputBase-root":{color:g},".MuiSelect-icon":{fill:g}}:{}));return r(y,{fullWidth:b,children:[e(m,{id:I,children:d}),e(c,{labelId:I,id:I,value:f,label:d,onChange:z,disabled:p,size:x,renderValue:i=>p?e(u,{centerVertical:!0,centerHorizontal:!0,children:e(o,{color:"inherit",size:s[x]})}):h?r(l,{display:"flex",flexDirection:"column",children:[i,e(a,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})]}):i,children:C})]})};export{d as Select};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/select/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/center-container/center-container.tsx","../../src/select/select.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/center-container/center-container.tsx","../../src/select/select.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\nimport Box from \"@mui/material/Box\";\nimport { SxProps, Theme } from \"@mui/material/styles\";\n\nexport interface CenterContainerProps {\n children: ReactNode | undefined;\n centerVertical?: boolean;\n centerHorizontal?: boolean;\n sx?: SxProps<Theme>;\n}\n\nexport function CenterContainer({\n children,\n centerVertical = true,\n centerHorizontal = true,\n sx,\n}: CenterContainerProps) {\n return (\n <Box\n width={1}\n height={1}\n sx={{\n ...sx,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: centerVertical ? \"center\" : \"flex-start\",\n alignItems: centerHorizontal ? \"center\" : \"flex-start\",\n }}\n >\n {children}\n </Box>\n );\n}\n","import { ReactNode, useId } from \"react\";\nimport { styled } from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport FormControl from \"@mui/material/FormControl\";\nimport InputLabel from \"@mui/material/InputLabel\";\nimport LinearProgress from \"@mui/material/LinearProgress\";\nimport MuiSelect from \"@mui/material/Select\";\nimport { CenterContainer } from \"../center-container\";\nimport { SelectInputProps } from \"@mui/material/Select/SelectInput\";\n\nexport type SelectSize = \"small\" | \"medium\";\n\nexport interface SelectProps<T> {\n label: string;\n value: T;\n loading?: boolean;\n fetching?: boolean;\n size?: SelectSize;\n color?: string;\n fullWidth?: boolean;\n children?: ReactNode;\n onChange?: SelectInputProps<T>[\"onChange\"];\n}\n\nconst ProgressSize: Record<SelectSize, number> = {\n small: 15,\n medium: 20,\n};\n\nexport const Select = <T extends ReactNode>({\n label,\n value,\n loading = false,\n fetching = false,\n size = \"medium\",\n fullWidth = false,\n color,\n children,\n onChange,\n}: SelectProps<T>) => {\n const id = useId();\n\n const renderValue = (value: T): ReactNode => {\n if (fetching) {\n return (\n <CenterContainer centerVertical centerHorizontal>\n <CircularProgress color=\"inherit\" size={ProgressSize[size]} />\n </CenterContainer>\n );\n }\n\n if (loading) {\n return (\n <Box display=\"flex\" flexDirection=\"column\">\n {value}\n <LinearProgress\n color=\"inherit\"\n sx={{ position: \"absolute\", left: 0, right: 0, bottom: 0 }}\n />\n </Box>\n );\n }\n\n return value;\n };\n\n const StyledFormControl = styled(FormControl)(() => {\n if (!color) {\n return {};\n }\n\n return {\n label: {\n color,\n },\n \".MuiOutlinedInput-notchedOutline\": {\n borderColor: `${color} !important`,\n },\n \".MuiInputBase-root\": {\n color,\n },\n \".MuiSelect-icon\": {\n fill: color,\n },\n };\n });\n\n return (\n <StyledFormControl fullWidth={fullWidth}>\n <InputLabel id={id}>{label}</InputLabel>\n <MuiSelect\n labelId={id}\n id={id}\n value={value}\n label={label}\n onChange={onChange}\n disabled={fetching}\n size={size}\n renderValue={renderValue}\n >\n {children}\n </MuiSelect>\n </StyledFormControl>\n );\n};\n"],"names":["CenterContainer","children","centerVertical","centerHorizontal","sx","_jsx","Box","width","height","display","flexDirection","justifyContent","alignItems","ProgressSize","small","medium","Select","label","value","loading","fetching","size","fullWidth","color","onChange","id","useId","StyledFormControl","styled","FormControl","borderColor","fill","_jsxs","InputLabel","MuiSelect","labelId","disabled","renderValue","CircularProgress","LinearProgress","position","left","right","bottom"],"mappings":"8WAWgB,SAAAA,GAAgBC,SAC9BA,EAAQC,eACRA,GAAiB,EAAIC,iBACrBA,GAAmB,EAAIC,GACvBA,IAEA,OACEC,EAACC,EAAG,CACFC,MAAO,EACPC,OAAQ,EACRJ,GAAI,IACCA,EACHK,QAAS,OACTC,cAAe,SACfC,eAAgBT,EAAiB,SAAW,aAC5CU,WAAYT,EAAmB,SAAW,cAG3CF,SAAAA,GAGP,CCPA,MAAMY,EAA2C,CAC/CC,MAAO,GACPC,OAAQ,IAGGC,EAAS,EACpBC,QACAC,QACAC,WAAU,EACVC,YAAW,EACXC,OAAO,SACPC,aAAY,EACZC,QACAtB,WACAuB,eAEA,MAAMC,EAAKC,IA0BLC,EAAoBC,EAAOC,EAAPD,EAAoB,IACvCL,EAIE,CACLN,MAAO,CACLM,SAEF,mCAAoC,CAClCO,YAAa,GAAGP,gBAElB,qBAAsB,CACpBA,SAEF,kBAAmB,CACjBQ,KAAMR,IAdD,KAmBX,OACES,EAACL,EAAkB,CAAAL,UAAWA,EAC5BrB,SAAA,CAAAI,EAAC4B,EAAU,CAACR,GAAIA,EAAKxB,SAAAgB,IACrBZ,EAAC6B,EACC,CAAAC,QAASV,EACTA,GAAIA,EACJP,MAAOA,EACPD,MAAOA,EACPO,SAAUA,EACVY,SAAUhB,EACVC,KAAMA,EACNgB,YAxDenB,GACfE,EAEAf,EAACL,EAAgB,CAAAE,kBAAeC,kBAAgB,EAAAF,SAC9CI,EAACiC,EAAiB,CAAAf,MAAM,UAAUF,KAAMR,EAAaQ,OAKvDF,EAEAa,EAAC1B,GAAIG,QAAQ,OAAOC,cAAc,SAAQT,SAAA,CACvCiB,EACDb,EAACkC,EACC,CAAAhB,MAAM,UACNnB,GAAI,CAAEoC,SAAU,WAAYC,KAAM,EAAGC,MAAO,EAAGC,OAAQ,QAMxDzB,EAmCqBjB,SAEvBA,MAGL"}
|
package/select/select.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
import { SelectInputProps } from "@mui/material/Select/SelectInput";
|
|
3
3
|
export type SelectSize = "small" | "medium";
|
|
4
4
|
export interface SelectProps<T> {
|
|
@@ -12,4 +12,4 @@ export interface SelectProps<T> {
|
|
|
12
12
|
children?: ReactNode;
|
|
13
13
|
onChange?: SelectInputProps<T>["onChange"];
|
|
14
14
|
}
|
|
15
|
-
export declare const Select: <T extends
|
|
15
|
+
export declare const Select: <T extends ReactNode>({ label, value, loading, fetching, size, fullWidth, color, children, onChange, }: SelectProps<T>) => JSX.Element;
|
package/sign-in/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@mui/material"),a=require("@mui/lab");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("@mui/material/Stack"),i=require("@mui/material/Box"),a=require("@mui/material/TextField"),l=require("@mui/material/Typography"),n=require("@mui/material/Alert"),o=require("@mui/lab/LoadingButton");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=u(r),d=u(i),m=u(a),p=u(l),f=u(n),c=u(o);exports.SignIn=({title:r,subtitle:i,loading:a,error:l,onSubmitSignIn:n})=>{const[o,u]=t.useState(""),[h,g]=t.useState("");return e.jsxs(e.Fragment,{children:[e.jsxs(d.default,{marginBottom:2,children:[e.jsx(p.default,{component:"h1",variant:"h4",children:r}),e.jsx(p.default,{variant:"body1",children:i})]}),e.jsxs(d.default,{component:"form",onSubmit:function(e){e.preventDefault(),u(""),g("");const t=new FormData(e.currentTarget),r=t.get("email")?.toString(),i=t.get("password")?.toString();r||u("Please fill out this field"),i||g("Please fill out this field"),r&&i&&n(r,i)},children:[l&&e.jsx(s.default,{width:"100%",marginTop:1,children:e.jsx(f.default,{variant:"filled",severity:"error",children:l.message})}),e.jsx(m.default,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:a,type:"email",inputProps:{role:"input"},error:!!o,helperText:o}),e.jsx(m.default,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:a,autoComplete:"current-password",inputProps:{role:"input"},error:!!h,helperText:h}),e.jsx(c.default,{type:"submit",fullWidth:!0,variant:"contained",loading:a,disabled:a,role:"button",sx:{mt:2},children:"Sign In"})]})]})};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/sign-in/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/sign-in/sign-in.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/sign-in/sign-in.tsx"],"sourcesContent":["import { FormEvent, useState } from \"react\";\nimport Stack from \"@mui/material/Stack\";\nimport Box from \"@mui/material/Box\";\nimport TextField from \"@mui/material/TextField\";\nimport Typography from \"@mui/material/Typography\";\nimport Alert from \"@mui/material/Alert\";\nimport LoadingButton from \"@mui/lab/LoadingButton\";\n\nexport interface SignInProps {\n title: string;\n subtitle: string;\n error?: Error;\n loading?: boolean;\n onSubmitSignIn: (email: string, password: string) => void;\n}\n\nexport const SignIn = ({ title, subtitle, loading, error, onSubmitSignIn }: SignInProps) => {\n const [emailError, setEmailError] = useState(\"\");\n const [passwordError, setPasswordError] = useState(\"\");\n\n function handleSubmit(e: FormEvent<HTMLFormElement>) {\n e.preventDefault();\n setEmailError(\"\");\n setPasswordError(\"\");\n\n const data = new FormData(e.currentTarget);\n const email = data.get(\"email\")?.toString();\n const password = data.get(\"password\")?.toString();\n\n if (!email) {\n setEmailError(\"Please fill out this field\");\n }\n\n if (!password) {\n setPasswordError(\"Please fill out this field\");\n }\n\n if (email && password) {\n onSubmitSignIn(email, password);\n }\n }\n\n return (\n <>\n <Box marginBottom={2}>\n <Typography component=\"h1\" variant=\"h4\">\n {title}\n </Typography>\n <Typography variant=\"body1\">{subtitle}</Typography>\n </Box>\n <Box component=\"form\" onSubmit={handleSubmit}>\n {error && (\n <Stack width=\"100%\" marginTop={1}>\n <Alert variant=\"filled\" severity=\"error\">\n {error.message}\n </Alert>\n </Stack>\n )}\n <TextField\n margin=\"normal\"\n fullWidth\n id=\"email\"\n label=\"Email Address\"\n name=\"email\"\n autoComplete=\"email\"\n autoFocus\n disabled={loading}\n type=\"email\"\n inputProps={{ role: \"input\" }}\n error={!!emailError}\n helperText={emailError}\n />\n <TextField\n margin=\"normal\"\n fullWidth\n role=\"input\"\n name=\"password\"\n label=\"Password\"\n type=\"password\"\n id=\"password\"\n disabled={loading}\n autoComplete=\"current-password\"\n inputProps={{ role: \"input\" }}\n error={!!passwordError}\n helperText={passwordError}\n />\n <LoadingButton\n type=\"submit\"\n fullWidth\n variant=\"contained\"\n loading={loading}\n disabled={loading}\n role=\"button\"\n sx={{ mt: 2 }}\n >\n Sign In\n </LoadingButton>\n </Box>\n </>\n );\n};\n"],"names":["title","subtitle","loading","error","onSubmitSignIn","emailError","setEmailError","useState","passwordError","setPasswordError","_jsxs","_Fragment","children","jsxs","Box","marginBottom","_jsx","Typography","component","variant","onSubmit","e","preventDefault","data","FormData","currentTarget","email","get","toString","password","Stack","width","marginTop","Alert","severity","message","jsx","TextField","margin","fullWidth","id","label","name","autoComplete","autoFocus","disabled","type","inputProps","role","helperText","LoadingButton","sx","mt"],"mappings":"+cAgBsB,EAAGA,QAAOC,WAAUC,UAASC,QAAOC,qBACxD,MAAOC,EAAYC,GAAiBC,EAAQA,SAAC,KACtCC,EAAeC,GAAoBF,EAAQA,SAAC,IAwBnD,OACEG,EAAAA,KACEC,EAAAA,SAAA,CAAAC,SAAA,CAAAF,EAAAG,KAACC,EAAG,QAAA,CAACC,aAAc,EACjBH,SAAA,CAAAI,EAAAA,IAACC,EAAU,QAAA,CAACC,UAAU,KAAKC,QAAQ,cAChCnB,IAEHgB,MAACC,EAAAA,QAAU,CAACE,QAAQ,QAASP,SAAAX,OAE/BS,OAACI,EAAAA,QAAI,CAAAI,UAAU,OAAOE,SA9B1B,SAAsBC,GACpBA,EAAEC,iBACFhB,EAAc,IACdG,EAAiB,IAEjB,MAAMc,EAAO,IAAIC,SAASH,EAAEI,eACtBC,EAAQH,EAAKI,IAAI,UAAUC,WAC3BC,EAAWN,EAAKI,IAAI,aAAaC,WAElCF,GACHpB,EAAc,8BAGXuB,GACHpB,EAAiB,8BAGfiB,GAASG,GACXzB,EAAesB,EAAOG,EAEzB,EAU+CjB,SAAA,CACzCT,GACCa,MAACc,EAAAA,QAAM,CAAAC,MAAM,OAAOC,UAAW,EAACpB,SAC9BI,EAAAA,IAACiB,EAAAA,SAAMd,QAAQ,SAASe,SAAS,QAC9BtB,SAAAT,EAAMgC,YAIbnB,EAAAoB,IAACC,EAAS,QAAA,CACRC,OAAO,SACPC,WACA,EAAAC,GAAG,QACHC,MAAM,gBACNC,KAAK,QACLC,aAAa,QACbC,WACA,EAAAC,SAAU3C,EACV4C,KAAK,QACLC,WAAY,CAAEC,KAAM,SACpB7C,QAASE,EACT4C,WAAY5C,IAEdW,EAAAoB,IAACC,EAAS,QACR,CAAAC,OAAO,SACPC,aACAS,KAAK,QACLN,KAAK,WACLD,MAAM,WACNK,KAAK,WACLN,GAAG,WACHK,SAAU3C,EACVyC,aAAa,mBACbI,WAAY,CAAEC,KAAM,SACpB7C,QAASK,EACTyC,WAAYzC,IAEdQ,EAAAA,IAACkC,EAAa,SACZJ,KAAK,SACLP,WAAS,EACTpB,QAAQ,YACRjB,QAASA,EACT2C,SAAU3C,EACV8C,KAAK,SACLG,GAAI,CAAEC,GAAI,GAGIxC,SAAA,iBAGpB"}
|
package/sign-in/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{jsxs as r,Fragment as t,jsx as e}from"react/jsx-runtime";import{useState as i}from"react";import o from"@mui/material/Stack";import a from"@mui/material/Box";import l from"@mui/material/TextField";import n from"@mui/material/Typography";import m from"@mui/material/Alert";import d from"@mui/lab/LoadingButton";const p=({title:p,subtitle:s,loading:u,error:c,onSubmitSignIn:f})=>{const[h,g]=i(""),[b,w]=i("");return r(t,{children:[r(a,{marginBottom:2,children:[e(n,{component:"h1",variant:"h4",children:p}),e(n,{variant:"body1",children:s})]}),r(a,{component:"form",onSubmit:function(r){r.preventDefault(),g(""),w("");const t=new FormData(r.currentTarget),e=t.get("email")?.toString(),i=t.get("password")?.toString();e||g("Please fill out this field"),i||w("Please fill out this field"),e&&i&&f(e,i)},children:[c&&e(o,{width:"100%",marginTop:1,children:e(m,{variant:"filled",severity:"error",children:c.message})}),e(l,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:u,type:"email",inputProps:{role:"input"},error:!!h,helperText:h}),e(l,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:u,autoComplete:"current-password",inputProps:{role:"input"},error:!!b,helperText:b}),e(d,{type:"submit",fullWidth:!0,variant:"contained",loading:u,disabled:u,role:"button",sx:{mt:2},children:"Sign In"})]})]})};export{p as SignIn};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/sign-in/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/sign-in/sign-in.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/sign-in/sign-in.tsx"],"sourcesContent":["import { FormEvent, useState } from \"react\";\nimport Stack from \"@mui/material/Stack\";\nimport Box from \"@mui/material/Box\";\nimport TextField from \"@mui/material/TextField\";\nimport Typography from \"@mui/material/Typography\";\nimport Alert from \"@mui/material/Alert\";\nimport LoadingButton from \"@mui/lab/LoadingButton\";\n\nexport interface SignInProps {\n title: string;\n subtitle: string;\n error?: Error;\n loading?: boolean;\n onSubmitSignIn: (email: string, password: string) => void;\n}\n\nexport const SignIn = ({ title, subtitle, loading, error, onSubmitSignIn }: SignInProps) => {\n const [emailError, setEmailError] = useState(\"\");\n const [passwordError, setPasswordError] = useState(\"\");\n\n function handleSubmit(e: FormEvent<HTMLFormElement>) {\n e.preventDefault();\n setEmailError(\"\");\n setPasswordError(\"\");\n\n const data = new FormData(e.currentTarget);\n const email = data.get(\"email\")?.toString();\n const password = data.get(\"password\")?.toString();\n\n if (!email) {\n setEmailError(\"Please fill out this field\");\n }\n\n if (!password) {\n setPasswordError(\"Please fill out this field\");\n }\n\n if (email && password) {\n onSubmitSignIn(email, password);\n }\n }\n\n return (\n <>\n <Box marginBottom={2}>\n <Typography component=\"h1\" variant=\"h4\">\n {title}\n </Typography>\n <Typography variant=\"body1\">{subtitle}</Typography>\n </Box>\n <Box component=\"form\" onSubmit={handleSubmit}>\n {error && (\n <Stack width=\"100%\" marginTop={1}>\n <Alert variant=\"filled\" severity=\"error\">\n {error.message}\n </Alert>\n </Stack>\n )}\n <TextField\n margin=\"normal\"\n fullWidth\n id=\"email\"\n label=\"Email Address\"\n name=\"email\"\n autoComplete=\"email\"\n autoFocus\n disabled={loading}\n type=\"email\"\n inputProps={{ role: \"input\" }}\n error={!!emailError}\n helperText={emailError}\n />\n <TextField\n margin=\"normal\"\n fullWidth\n role=\"input\"\n name=\"password\"\n label=\"Password\"\n type=\"password\"\n id=\"password\"\n disabled={loading}\n autoComplete=\"current-password\"\n inputProps={{ role: \"input\" }}\n error={!!passwordError}\n helperText={passwordError}\n />\n <LoadingButton\n type=\"submit\"\n fullWidth\n variant=\"contained\"\n loading={loading}\n disabled={loading}\n role=\"button\"\n sx={{ mt: 2 }}\n >\n Sign In\n </LoadingButton>\n </Box>\n </>\n );\n};\n"],"names":["SignIn","title","subtitle","loading","error","onSubmitSignIn","emailError","setEmailError","useState","passwordError","setPasswordError","_jsxs","_Fragment","children","Box","marginBottom","_jsx","Typography","component","variant","onSubmit","e","preventDefault","data","FormData","currentTarget","email","get","toString","password","Stack","width","marginTop","Alert","severity","message","TextField","margin","fullWidth","id","label","name","autoComplete","autoFocus","disabled","type","inputProps","role","helperText","LoadingButton","sx","mt"],"mappings":"6TAgBa,MAAAA,EAAS,EAAGC,QAAOC,WAAUC,UAASC,QAAOC,qBACxD,MAAOC,EAAYC,GAAiBC,EAAS,KACtCC,EAAeC,GAAoBF,EAAS,IAwBnD,OACEG,EACEC,EAAA,CAAAC,SAAA,CAAAF,EAACG,EAAG,CAACC,aAAc,EACjBF,SAAA,CAAAG,EAACC,EAAU,CAACC,UAAU,KAAKC,QAAQ,cAChClB,IAEHe,EAACC,EAAU,CAACE,QAAQ,QAASN,SAAAX,OAE/BS,EAACG,EAAI,CAAAI,UAAU,OAAOE,SA9B1B,SAAsBC,GACpBA,EAAEC,iBACFf,EAAc,IACdG,EAAiB,IAEjB,MAAMa,EAAO,IAAIC,SAASH,EAAEI,eACtBC,EAAQH,EAAKI,IAAI,UAAUC,WAC3BC,EAAWN,EAAKI,IAAI,aAAaC,WAElCF,GACHnB,EAAc,8BAGXsB,GACHnB,EAAiB,8BAGfgB,GAASG,GACXxB,EAAeqB,EAAOG,EAEzB,EAU+ChB,SAAA,CACzCT,GACCY,EAACc,EAAM,CAAAC,MAAM,OAAOC,UAAW,EAACnB,SAC9BG,EAACiB,GAAMd,QAAQ,SAASe,SAAS,QAC9BrB,SAAAT,EAAM+B,YAIbnB,EAACoB,EAAS,CACRC,OAAO,SACPC,WACA,EAAAC,GAAG,QACHC,MAAM,gBACNC,KAAK,QACLC,aAAa,QACbC,WACA,EAAAC,SAAUzC,EACV0C,KAAK,QACLC,WAAY,CAAEC,KAAM,SACpB3C,QAASE,EACT0C,WAAY1C,IAEdU,EAACoB,EACC,CAAAC,OAAO,SACPC,aACAS,KAAK,QACLN,KAAK,WACLD,MAAM,WACNK,KAAK,WACLN,GAAG,WACHK,SAAUzC,EACVuC,aAAa,mBACbI,WAAY,CAAEC,KAAM,SACpB3C,QAASK,EACTuC,WAAYvC,IAEdO,EAACiC,GACCJ,KAAK,SACLP,WAAS,EACTnB,QAAQ,YACRhB,QAASA,EACTyC,SAAUzC,EACV4C,KAAK,SACLG,GAAI,CAAEC,GAAI,GAGItC,SAAA,iBAGpB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mui/material");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material/Box"),a=require("@mui/material/Skeleton");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(t),n=i(a);exports.SkeletonCard=({width:t="100%",animation:a=!1})=>e.jsxs(r.default,{width:t,children:[e.jsx(n.default,{animation:a,variant:"rectangular",height:118}),e.jsx(n.default,{animation:a,variant:"rectangular",height:16,sx:{my:1}}),e.jsx(n.default,{animation:a,variant:"rectangular",width:"80%",height:16})]});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/skeleton-card/skeleton-card.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/skeleton-card/skeleton-card.tsx"],"sourcesContent":["import Box from \"@mui/material/Box\";\nimport Skeleton from \"@mui/material/Skeleton\";\n\nexport interface SkeletonCardProps {\n width?: number | string;\n animation?: \"pulse\" | \"wave\" | false;\n}\n\nexport const SkeletonCard = ({ width = \"100%\", animation = false }: SkeletonCardProps) => {\n return (\n <Box width={width}>\n <Skeleton animation={animation} variant=\"rectangular\" height={118} />\n <Skeleton animation={animation} variant=\"rectangular\" height={16} sx={{ my: 1 }} />\n <Skeleton animation={animation} variant=\"rectangular\" width=\"80%\" height={16} />\n </Box>\n );\n};\n"],"names":["width","animation","_jsxs","jsxs","Box","children","_jsx","Skeleton","variant","height","sx","my","jsx"],"mappings":"yRAQ4B,EAAGA,QAAQ,OAAQC,aAAY,KAEvDC,EAAAC,KAACC,UAAG,CAACJ,MAAOA,EACVK,SAAA,CAAAC,EAAAA,IAACC,EAAQ,QAAA,CAACN,UAAWA,EAAWO,QAAQ,cAAcC,OAAQ,MAC9DH,EAAAA,IAACC,EAAQ,QAAA,CAACN,UAAWA,EAAWO,QAAQ,cAAcC,OAAQ,GAAIC,GAAI,CAAEC,GAAI,KAC5EL,EAAAM,IAACL,UAAS,CAAAN,UAAWA,EAAWO,QAAQ,cAAcR,MAAM,MAAMS,OAAQ"}
|
package/skeleton-card/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as i,jsx as t}from"react/jsx-runtime";import a from"@mui/material/Box";import r from"@mui/material/Skeleton";const n=({width:n="100%",animation:m=!1})=>i(a,{width:n,children:[t(r,{animation:m,variant:"rectangular",height:118}),t(r,{animation:m,variant:"rectangular",height:16,sx:{my:1}}),t(r,{animation:m,variant:"rectangular",width:"80%",height:16})]});export{n as SkeletonCard};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/skeleton-card/skeleton-card.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/skeleton-card/skeleton-card.tsx"],"sourcesContent":["import Box from \"@mui/material/Box\";\nimport Skeleton from \"@mui/material/Skeleton\";\n\nexport interface SkeletonCardProps {\n width?: number | string;\n animation?: \"pulse\" | \"wave\" | false;\n}\n\nexport const SkeletonCard = ({ width = \"100%\", animation = false }: SkeletonCardProps) => {\n return (\n <Box width={width}>\n <Skeleton animation={animation} variant=\"rectangular\" height={118} />\n <Skeleton animation={animation} variant=\"rectangular\" height={16} sx={{ my: 1 }} />\n <Skeleton animation={animation} variant=\"rectangular\" width=\"80%\" height={16} />\n </Box>\n );\n};\n"],"names":["SkeletonCard","width","animation","_jsxs","Box","children","_jsx","Skeleton","variant","height","sx","my"],"mappings":"yHAQO,MAAMA,EAAe,EAAGC,QAAQ,OAAQC,aAAY,KAEvDC,EAACC,EAAG,CAACH,MAAOA,EACVI,SAAA,CAAAC,EAACC,EAAQ,CAACL,UAAWA,EAAWM,QAAQ,cAAcC,OAAQ,MAC9DH,EAACC,EAAQ,CAACL,UAAWA,EAAWM,QAAQ,cAAcC,OAAQ,GAAIC,GAAI,CAAEC,GAAI,KAC5EL,EAACC,EAAS,CAAAL,UAAWA,EAAWM,QAAQ,cAAcP,MAAM,MAAMQ,OAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mui/material");
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("@mui/material/Grid");require("@mui/material");var t=require("@mui/material/Box"),a=require("@mui/material/Skeleton");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=r(i),u=r(t),l=r(a);const d=(e,i)=>new Array(e).fill(i),s=({width:i="100%",animation:t=!1})=>e.jsxs(u.default,{width:i,children:[e.jsx(l.default,{animation:t,variant:"rectangular",height:118}),e.jsx(l.default,{animation:t,variant:"rectangular",height:16,sx:{my:1}}),e.jsx(l.default,{animation:t,variant:"rectangular",width:"80%",height:16})]});exports.SkeletonGrid=({size:i=20})=>e.jsx(n.default,{container:!0,spacing:2,children:d(i,0).map(((i,t)=>e.jsx(n.default,{item:!0,xs:4,children:e.jsx(s,{width:1})},t)))});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/utils/arrays.ts","../../../src/skeleton-card/skeleton-card.tsx","../../../src/skeleton-grid/skeleton-grid.tsx"],"sourcesContent":["export const newArrayWithSize = <T>(size: number, fillValue: T) => new Array(size).fill(fillValue);\n\nexport const getRandomItem = <T>(items: T[]): { index: number; item: T } => {\n const index = Math.floor(Math.random() * items.length);\n const item = items[index];\n return { index, item };\n};\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/utils/arrays.ts","../../../src/skeleton-card/skeleton-card.tsx","../../../src/skeleton-grid/skeleton-grid.tsx"],"sourcesContent":["export const newArrayWithSize = <T>(size: number, fillValue: T) => new Array(size).fill(fillValue);\n\nexport const getRandomItem = <T>(items: T[]): { index: number; item: T } => {\n const index = Math.floor(Math.random() * items.length);\n const item = items[index];\n return { index, item };\n};\n","import Box from \"@mui/material/Box\";\nimport Skeleton from \"@mui/material/Skeleton\";\n\nexport interface SkeletonCardProps {\n width?: number | string;\n animation?: \"pulse\" | \"wave\" | false;\n}\n\nexport const SkeletonCard = ({ width = \"100%\", animation = false }: SkeletonCardProps) => {\n return (\n <Box width={width}>\n <Skeleton animation={animation} variant=\"rectangular\" height={118} />\n <Skeleton animation={animation} variant=\"rectangular\" height={16} sx={{ my: 1 }} />\n <Skeleton animation={animation} variant=\"rectangular\" width=\"80%\" height={16} />\n </Box>\n );\n};\n","import Grid from \"@mui/material/Grid\";\nimport { newArrayWithSize } from \"../utils\";\nimport { SkeletonCard } from \"../skeleton-card\";\n\nexport interface SkeletonGridProps {\n size?: number;\n}\n\nexport const SkeletonGrid = ({ size = 20 }: SkeletonGridProps) => {\n return (\n <Grid container spacing={2}>\n {newArrayWithSize(size, 0).map((_, i) => (\n <Grid item key={i} xs={4}>\n <SkeletonCard width={1} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":["newArrayWithSize","size","fillValue","Array","fill","SkeletonCard","width","animation","_jsxs","jsxs","Box","children","_jsx","Skeleton","variant","height","sx","my","jsx","Grid","container","spacing","map","_","i","item","xs"],"mappings":"wUAAO,MAAMA,EAAmB,CAAIC,EAAcC,IAAiB,IAAIC,MAAMF,GAAMG,KAAKF,GCQ3EG,EAAe,EAAGC,QAAQ,OAAQC,aAAY,KAEvDC,EAAAC,KAACC,UAAG,CAACJ,MAAOA,EACVK,SAAA,CAAAC,EAAAA,IAACC,EAAQ,QAAA,CAACN,UAAWA,EAAWO,QAAQ,cAAcC,OAAQ,MAC9DH,EAAAA,IAACC,EAAQ,QAAA,CAACN,UAAWA,EAAWO,QAAQ,cAAcC,OAAQ,GAAIC,GAAI,CAAEC,GAAI,KAC5EL,EAAAM,IAACL,UAAS,CAAAN,UAAWA,EAAWO,QAAQ,cAAcR,MAAM,MAAMS,OAAQ,6BCLpD,EAAGd,OAAO,MAElCW,EAAAA,IAACO,EAAAA,QAAI,CAACC,WAAU,EAAAC,QAAS,EACtBV,SAAAX,EAAiBC,EAAM,GAAGqB,KAAI,CAACC,EAAGC,IACjCZ,EAAAA,IAACO,EAAAA,QAAK,CAAAM,QAAaC,GAAI,EAACf,SACtBC,MAACP,GAAaC,MAAO,KADPkB"}
|
package/skeleton-grid/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as i,jsx as a}from"react/jsx-runtime";import t from"@mui/material/Grid";import"@mui/material";import r from"@mui/material/Box";import m from"@mui/material/Skeleton";const n=(i,a)=>new Array(i).fill(a),e=({width:t="100%",animation:n=!1})=>i(r,{width:t,children:[a(m,{animation:n,variant:"rectangular",height:118}),a(m,{animation:n,variant:"rectangular",height:16,sx:{my:1}}),a(m,{animation:n,variant:"rectangular",width:"80%",height:16})]}),o=({size:i=20})=>a(t,{container:!0,spacing:2,children:n(i,0).map(((i,r)=>a(t,{item:!0,xs:4,children:a(e,{width:1})},r)))});export{o as SkeletonGrid};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils/arrays.ts","../../src/skeleton-card/skeleton-card.tsx","../../src/skeleton-grid/skeleton-grid.tsx"],"sourcesContent":["export const newArrayWithSize = <T>(size: number, fillValue: T) => new Array(size).fill(fillValue);\n\nexport const getRandomItem = <T>(items: T[]): { index: number; item: T } => {\n const index = Math.floor(Math.random() * items.length);\n const item = items[index];\n return { index, item };\n};\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/utils/arrays.ts","../../src/skeleton-card/skeleton-card.tsx","../../src/skeleton-grid/skeleton-grid.tsx"],"sourcesContent":["export const newArrayWithSize = <T>(size: number, fillValue: T) => new Array(size).fill(fillValue);\n\nexport const getRandomItem = <T>(items: T[]): { index: number; item: T } => {\n const index = Math.floor(Math.random() * items.length);\n const item = items[index];\n return { index, item };\n};\n","import Box from \"@mui/material/Box\";\nimport Skeleton from \"@mui/material/Skeleton\";\n\nexport interface SkeletonCardProps {\n width?: number | string;\n animation?: \"pulse\" | \"wave\" | false;\n}\n\nexport const SkeletonCard = ({ width = \"100%\", animation = false }: SkeletonCardProps) => {\n return (\n <Box width={width}>\n <Skeleton animation={animation} variant=\"rectangular\" height={118} />\n <Skeleton animation={animation} variant=\"rectangular\" height={16} sx={{ my: 1 }} />\n <Skeleton animation={animation} variant=\"rectangular\" width=\"80%\" height={16} />\n </Box>\n );\n};\n","import Grid from \"@mui/material/Grid\";\nimport { newArrayWithSize } from \"../utils\";\nimport { SkeletonCard } from \"../skeleton-card\";\n\nexport interface SkeletonGridProps {\n size?: number;\n}\n\nexport const SkeletonGrid = ({ size = 20 }: SkeletonGridProps) => {\n return (\n <Grid container spacing={2}>\n {newArrayWithSize(size, 0).map((_, i) => (\n <Grid item key={i} xs={4}>\n <SkeletonCard width={1} />\n </Grid>\n ))}\n </Grid>\n );\n};\n"],"names":["newArrayWithSize","size","fillValue","Array","fill","SkeletonCard","width","animation","_jsxs","Box","children","_jsx","Skeleton","variant","height","sx","my","SkeletonGrid","Grid","container","spacing","map","_","i","item","xs"],"mappings":"iLAAO,MAAMA,EAAmB,CAAIC,EAAcC,IAAiB,IAAIC,MAAMF,GAAMG,KAAKF,GCQ3EG,EAAe,EAAGC,QAAQ,OAAQC,aAAY,KAEvDC,EAACC,EAAG,CAACH,MAAOA,EACVI,SAAA,CAAAC,EAACC,EAAQ,CAACL,UAAWA,EAAWM,QAAQ,cAAcC,OAAQ,MAC9DH,EAACC,EAAQ,CAACL,UAAWA,EAAWM,QAAQ,cAAcC,OAAQ,GAAIC,GAAI,CAAEC,GAAI,KAC5EL,EAACC,EAAS,CAAAL,UAAWA,EAAWM,QAAQ,cAAcP,MAAM,MAAMQ,OAAQ,QCLnEG,EAAe,EAAGhB,OAAO,MAElCU,EAACO,EAAI,CAACC,WAAU,EAAAC,QAAS,EACtBV,SAAAV,EAAiBC,EAAM,GAAGoB,KAAI,CAACC,EAAGC,IACjCZ,EAACO,EAAK,CAAAM,QAAaC,GAAI,EAACf,SACtBC,EAACN,GAAaC,MAAO,KADPiB"}
|
package/tab-card/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mui/material"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@mui/material/styles"),r=require("@mui/material/Paper"),a=require("@mui/material/Tabs"),i=require("@mui/material/Tab"),n=require("@mui/material/Box"),l=require("react"),o=require("@mui/material");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=s(r),d=s(a),c=s(i),p=s(n);const h=l.createContext([0,()=>null]),g=h.Provider,m=t.styled((t=>e.jsx(d.default,{...t,TabIndicatorProps:{children:e.jsx("span",{className:"MuiTabs-indicatorSpan"})}})))((({theme:e})=>({minHeight:e.spacing(5),"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:e.palette.primary.main}}))),x=t.styled(c.default)((({theme:e})=>({textTransform:"none",fontWeight:e.typography.fontWeightRegular,marginRight:e.spacing(1),color:e.palette.text.secondary,paddingTop:0,paddingBottom:0,minHeight:e.spacing(5),"&.Mui-selected":{color:e.palette.text.secondary,fontWeight:e.typography.fontWeightBold}})));exports.TabCard=({children:t,tabs:r,initialTab:a=0,onChangeTab:i=(()=>null)})=>{const n=(({lightWeight:e=100,darkWeight:t=900}={})=>{const{palette:r}=o.useTheme();return"light"===r.mode?r.grey[e]:r.grey[t]})(),[s,d]=l.useState(a);return e.jsx(g,{value:[s,d],children:e.jsxs(u.default,{variant:"outlined",children:[e.jsx(p.default,{bgcolor:n,children:e.jsx(m,{value:s,onChange:(e,t)=>{d(t),i(r[t],t)},children:r.map((({text:t,icon:r})=>e.jsx(x,{iconPosition:"start",disableRipple:!0,label:t,icon:r},t)))})}),t]})})},exports.TabCardPanel=({index:t,children:r,sx:a})=>{const[i]=l.useContext(h);let n=i===t;return Array.isArray(t)&&(n=t.includes(i)),n?e.jsx(p.default,{sx:a,children:r}):null};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/tab-card/tab-card.context.tsx","../../../src/tab-card/tab-card.tsx","../../../src/utils/theme.ts","../../../src/tab-card/tab-card-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction } from \"react\";\n\nexport const TabCardContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabCardContextProvider = TabCardContext.Provider;\n","import { Paper
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/tab-card/tab-card.context.tsx","../../../src/tab-card/tab-card.tsx","../../../src/utils/theme.ts","../../../src/tab-card/tab-card-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction } from \"react\";\n\nexport const TabCardContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabCardContextProvider = TabCardContext.Provider;\n","import { styled } from \"@mui/material/styles\";\nimport Paper from \"@mui/material/Paper\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\nimport Box from \"@mui/material/Box\";\nimport { PropsWithChildren, ReactElement, SyntheticEvent, useState } from \"react\";\nimport { TabCardContextProvider } from \"./tab-card.context\";\nimport { useGetDefaultThemeColor } from \"../utils\";\n\nexport interface TabData {\n text: string;\n icon?: ReactElement;\n}\n\ninterface StyledTabsProps {\n children?: React.ReactNode;\n value: number;\n onChange: (event: React.SyntheticEvent, newValue: number) => void;\n}\n\nconst StyledTabs = styled((props: StyledTabsProps) => (\n <Tabs {...props} TabIndicatorProps={{ children: <span className=\"MuiTabs-indicatorSpan\" /> }} />\n))(({ theme }) => ({\n minHeight: theme.spacing(5),\n \"& .MuiTabs-indicator\": {\n display: \"flex\",\n justifyContent: \"center\",\n backgroundColor: \"transparent\",\n },\n \"& .MuiTabs-indicatorSpan\": {\n maxWidth: 40,\n width: \"100%\",\n backgroundColor: theme.palette.primary.main,\n },\n}));\n\nconst StyledTab = styled(Tab)(({ theme }) => ({\n textTransform: \"none\",\n fontWeight: theme.typography.fontWeightRegular,\n marginRight: theme.spacing(1),\n color: theme.palette.text.secondary,\n paddingTop: 0,\n paddingBottom: 0,\n minHeight: theme.spacing(5),\n \"&.Mui-selected\": {\n color: theme.palette.text.secondary,\n fontWeight: theme.typography.fontWeightBold,\n },\n}));\n\nexport type TabCardProps = PropsWithChildren<{\n tabs: TabData[];\n initialTab?: number;\n onChangeTab?: (tab: TabData, index: number) => void;\n}>;\n\nexport const TabCard = ({\n children,\n tabs,\n initialTab = 0,\n onChangeTab = () => null,\n}: TabCardProps) => {\n const bgColor = useGetDefaultThemeColor();\n const [selectedTab, setSelectedTab] = useState(initialTab);\n\n const handleChangeTab = (_: SyntheticEvent<Element, Event>, index: number) => {\n setSelectedTab(index);\n onChangeTab(tabs[index], index);\n };\n\n return (\n <TabCardContextProvider value={[selectedTab, setSelectedTab]}>\n <Paper variant=\"outlined\">\n <Box bgcolor={bgColor}>\n <StyledTabs value={selectedTab} onChange={handleChangeTab}>\n {tabs.map(({ text, icon }) => (\n <StyledTab iconPosition=\"start\" disableRipple key={text} label={text} icon={icon} />\n ))}\n </StyledTabs>\n </Box>\n {children}\n </Paper>\n </TabCardContextProvider>\n );\n};\n","import { Color, useTheme } from \"@mui/material\";\n\ntype KeyColor = keyof Color;\n\nexport const useGetDefaultThemeColor = ({\n lightWeight = 100,\n darkWeight = 900,\n}: { lightWeight?: KeyColor; darkWeight?: KeyColor } = {}) => {\n const { palette } = useTheme();\n return palette.mode === \"light\" ? palette.grey[lightWeight] : palette.grey[darkWeight];\n};\n","import { PropsWithChildren, useContext } from \"react\";\nimport { TabCardContext } from \"./tab-card.context\";\nimport { SxProps, Theme } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\n\nexport type TabCardPanelProps = PropsWithChildren<{\n index: number | number[];\n sx?: SxProps<Theme>;\n}>;\n\nexport const TabCardPanel = ({ index, children, sx }: TabCardPanelProps) => {\n const [value] = useContext(TabCardContext);\n let isTab = value === index;\n if (Array.isArray(index)) {\n isTab = index.includes(value);\n }\n\n return isTab ? <Box sx={sx}>{children}</Box> : null;\n};\n"],"names":["TabCardContext","createContext","TabCardContextProvider","Provider","StyledTabs","styled","props","_jsx","Tabs","TabIndicatorProps","children","className","theme","minHeight","spacing","display","justifyContent","backgroundColor","maxWidth","width","palette","primary","main","StyledTab","Tab","textTransform","fontWeight","typography","fontWeightRegular","marginRight","color","text","secondary","paddingTop","paddingBottom","fontWeightBold","tabs","initialTab","onChangeTab","bgColor","lightWeight","darkWeight","useTheme","mode","grey","useGetDefaultThemeColor","selectedTab","setSelectedTab","useState","value","_jsxs","Paper","variant","jsx","Box","bgcolor","onChange","_","index","map","icon","iconPosition","disableRipple","label","sx","useContext","isTab","Array","isArray","includes"],"mappings":"8ZAEO,MAAMA,EAAiBC,EAAAA,cAA0D,CACtF,EACA,IAAM,OAEKC,EAAyBF,EAAeG,SCc/CC,EAAaC,EAAAA,QAAQC,GACzBC,MAACC,EAAI,QAAA,IAAKF,EAAOG,kBAAmB,CAAEC,SAAUH,cAAMI,UAAU,8BAD/CN,EAEhB,EAAGO,YAAa,CACjBC,UAAWD,EAAME,QAAQ,GACzB,uBAAwB,CACtBC,QAAS,OACTC,eAAgB,SAChBC,gBAAiB,eAEnB,2BAA4B,CAC1BC,SAAU,GACVC,MAAO,OACPF,gBAAiBL,EAAMQ,QAAQC,QAAQC,UAIrCC,EAAYlB,EAAAA,OAAOmB,EAAAA,QAAPnB,EAAY,EAAGO,YAAa,CAC5Ca,cAAe,OACfC,WAAYd,EAAMe,WAAWC,kBAC7BC,YAAajB,EAAME,QAAQ,GAC3BgB,MAAOlB,EAAMQ,QAAQW,KAAKC,UAC1BC,WAAY,EACZC,cAAe,EACfrB,UAAWD,EAAME,QAAQ,GACzB,iBAAkB,CAChBgB,MAAOlB,EAAMQ,QAAQW,KAAKC,UAC1BN,WAAYd,EAAMe,WAAWQ,oCAUV,EACrBzB,WACA0B,OACAC,aAAa,EACbC,cAAc,KAAM,UAEpB,MAAMC,EC1D+B,GACrCC,cAAc,IACdC,aAAa,KACwC,MACrD,MAAMrB,QAAEA,GAAYsB,EAAAA,WACpB,MAAwB,UAAjBtB,EAAQuB,KAAmBvB,EAAQwB,KAAKJ,GAAepB,EAAQwB,KAAKH,EAAW,EDqDtEI,IACTC,EAAaC,GAAkBC,EAAQA,SAACX,GAO/C,OACE9B,MAACL,EAAuB,CAAA+C,MAAO,CAACH,EAAaC,GAC3CrC,SAAAwC,EAAAA,KAACC,EAAK,QAAA,CAACC,QAAQ,WACb1C,SAAA,CAAAH,EAAA8C,IAACC,UAAI,CAAAC,QAAShB,WACZhC,EAAAA,IAACH,EAAW,CAAA6C,MAAOH,EAAaU,SAThB,CAACC,EAAmCC,KAC1DX,EAAeW,GACfpB,EAAYF,EAAKsB,GAAQA,EAAM,WAQtBtB,EAAKuB,KAAI,EAAG5B,OAAM6B,UACjBrD,MAACgB,EAAS,CAACsC,aAAa,QAAQC,eAAa,EAAYC,MAAOhC,EAAM6B,KAAMA,GAAzB7B,SAIxDrB,MAGL,uBEzEwB,EAAGgD,QAAOhD,WAAUsD,SAC9C,MAAOf,GAASgB,EAAUA,WAACjE,GAC3B,IAAIkE,EAAQjB,IAAUS,EAKtB,OAJIS,MAAMC,QAAQV,KAChBQ,EAAQR,EAAMW,SAASpB,IAGlBiB,EAAQ3D,MAAC+C,EAAAA,QAAI,CAAAU,GAAIA,WAAKtD,IAAkB,IAAI"}
|
package/tab-card/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsx as t,jsxs as i}from"react/jsx-runtime";import{styled as r}from"@mui/material/styles";import e from"@mui/material/Paper";import a from"@mui/material/Tabs";import n from"@mui/material/Tab";import o from"@mui/material/Box";import{createContext as l,useState as m,useContext as c}from"react";import{useTheme as p}from"@mui/material";const s=l([0,()=>null]),d=s.Provider,g=r((i=>t(a,{...i,TabIndicatorProps:{children:t("span",{className:"MuiTabs-indicatorSpan"})}})))((({theme:t})=>({minHeight:t.spacing(5),"& .MuiTabs-indicator":{display:"flex",justifyContent:"center",backgroundColor:"transparent"},"& .MuiTabs-indicatorSpan":{maxWidth:40,width:"100%",backgroundColor:t.palette.primary.main}}))),h=r(n)((({theme:t})=>({textTransform:"none",fontWeight:t.typography.fontWeightRegular,marginRight:t.spacing(1),color:t.palette.text.secondary,paddingTop:0,paddingBottom:0,minHeight:t.spacing(5),"&.Mui-selected":{color:t.palette.text.secondary,fontWeight:t.typography.fontWeightBold}}))),u=({children:r,tabs:a,initialTab:n=0,onChangeTab:l=(()=>null)})=>{const c=(({lightWeight:t=100,darkWeight:i=900}={})=>{const{palette:r}=p();return"light"===r.mode?r.grey[t]:r.grey[i]})(),[s,u]=m(n);return t(d,{value:[s,u],children:i(e,{variant:"outlined",children:[t(o,{bgcolor:c,children:t(g,{value:s,onChange:(t,i)=>{u(i),l(a[i],i)},children:a.map((({text:i,icon:r})=>t(h,{iconPosition:"start",disableRipple:!0,label:i,icon:r},i)))})}),r]})})},f=({index:i,children:r,sx:e})=>{const[a]=c(s);let n=a===i;return Array.isArray(i)&&(n=i.includes(a)),n?t(o,{sx:e,children:r}):null};export{u as TabCard,f as TabCardPanel};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/tab-card/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/tab-card/tab-card.context.tsx","../../src/tab-card/tab-card.tsx","../../src/utils/theme.ts","../../src/tab-card/tab-card-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction } from \"react\";\n\nexport const TabCardContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabCardContextProvider = TabCardContext.Provider;\n","import { Paper
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/tab-card/tab-card.context.tsx","../../src/tab-card/tab-card.tsx","../../src/utils/theme.ts","../../src/tab-card/tab-card-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction } from \"react\";\n\nexport const TabCardContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabCardContextProvider = TabCardContext.Provider;\n","import { styled } from \"@mui/material/styles\";\nimport Paper from \"@mui/material/Paper\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\nimport Box from \"@mui/material/Box\";\nimport { PropsWithChildren, ReactElement, SyntheticEvent, useState } from \"react\";\nimport { TabCardContextProvider } from \"./tab-card.context\";\nimport { useGetDefaultThemeColor } from \"../utils\";\n\nexport interface TabData {\n text: string;\n icon?: ReactElement;\n}\n\ninterface StyledTabsProps {\n children?: React.ReactNode;\n value: number;\n onChange: (event: React.SyntheticEvent, newValue: number) => void;\n}\n\nconst StyledTabs = styled((props: StyledTabsProps) => (\n <Tabs {...props} TabIndicatorProps={{ children: <span className=\"MuiTabs-indicatorSpan\" /> }} />\n))(({ theme }) => ({\n minHeight: theme.spacing(5),\n \"& .MuiTabs-indicator\": {\n display: \"flex\",\n justifyContent: \"center\",\n backgroundColor: \"transparent\",\n },\n \"& .MuiTabs-indicatorSpan\": {\n maxWidth: 40,\n width: \"100%\",\n backgroundColor: theme.palette.primary.main,\n },\n}));\n\nconst StyledTab = styled(Tab)(({ theme }) => ({\n textTransform: \"none\",\n fontWeight: theme.typography.fontWeightRegular,\n marginRight: theme.spacing(1),\n color: theme.palette.text.secondary,\n paddingTop: 0,\n paddingBottom: 0,\n minHeight: theme.spacing(5),\n \"&.Mui-selected\": {\n color: theme.palette.text.secondary,\n fontWeight: theme.typography.fontWeightBold,\n },\n}));\n\nexport type TabCardProps = PropsWithChildren<{\n tabs: TabData[];\n initialTab?: number;\n onChangeTab?: (tab: TabData, index: number) => void;\n}>;\n\nexport const TabCard = ({\n children,\n tabs,\n initialTab = 0,\n onChangeTab = () => null,\n}: TabCardProps) => {\n const bgColor = useGetDefaultThemeColor();\n const [selectedTab, setSelectedTab] = useState(initialTab);\n\n const handleChangeTab = (_: SyntheticEvent<Element, Event>, index: number) => {\n setSelectedTab(index);\n onChangeTab(tabs[index], index);\n };\n\n return (\n <TabCardContextProvider value={[selectedTab, setSelectedTab]}>\n <Paper variant=\"outlined\">\n <Box bgcolor={bgColor}>\n <StyledTabs value={selectedTab} onChange={handleChangeTab}>\n {tabs.map(({ text, icon }) => (\n <StyledTab iconPosition=\"start\" disableRipple key={text} label={text} icon={icon} />\n ))}\n </StyledTabs>\n </Box>\n {children}\n </Paper>\n </TabCardContextProvider>\n );\n};\n","import { Color, useTheme } from \"@mui/material\";\n\ntype KeyColor = keyof Color;\n\nexport const useGetDefaultThemeColor = ({\n lightWeight = 100,\n darkWeight = 900,\n}: { lightWeight?: KeyColor; darkWeight?: KeyColor } = {}) => {\n const { palette } = useTheme();\n return palette.mode === \"light\" ? palette.grey[lightWeight] : palette.grey[darkWeight];\n};\n","import { PropsWithChildren, useContext } from \"react\";\nimport { TabCardContext } from \"./tab-card.context\";\nimport { SxProps, Theme } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\n\nexport type TabCardPanelProps = PropsWithChildren<{\n index: number | number[];\n sx?: SxProps<Theme>;\n}>;\n\nexport const TabCardPanel = ({ index, children, sx }: TabCardPanelProps) => {\n const [value] = useContext(TabCardContext);\n let isTab = value === index;\n if (Array.isArray(index)) {\n isTab = index.includes(value);\n }\n\n return isTab ? <Box sx={sx}>{children}</Box> : null;\n};\n"],"names":["TabCardContext","createContext","TabCardContextProvider","Provider","StyledTabs","styled","props","_jsx","Tabs","TabIndicatorProps","children","className","theme","minHeight","spacing","display","justifyContent","backgroundColor","maxWidth","width","palette","primary","main","StyledTab","Tab","textTransform","fontWeight","typography","fontWeightRegular","marginRight","color","text","secondary","paddingTop","paddingBottom","fontWeightBold","TabCard","tabs","initialTab","onChangeTab","bgColor","lightWeight","darkWeight","useTheme","mode","grey","useGetDefaultThemeColor","selectedTab","setSelectedTab","useState","value","_jsxs","Paper","variant","Box","bgcolor","onChange","_","index","map","icon","iconPosition","disableRipple","label","TabCardPanel","sx","useContext","isTab","Array","isArray","includes"],"mappings":"oVAEO,MAAMA,EAAiBC,EAA0D,CACtF,EACA,IAAM,OAEKC,EAAyBF,EAAeG,SCc/CC,EAAaC,GAAQC,GACzBC,EAACC,EAAI,IAAKF,EAAOG,kBAAmB,CAAEC,SAAUH,UAAMI,UAAU,8BAD/CN,EAEhB,EAAGO,YAAa,CACjBC,UAAWD,EAAME,QAAQ,GACzB,uBAAwB,CACtBC,QAAS,OACTC,eAAgB,SAChBC,gBAAiB,eAEnB,2BAA4B,CAC1BC,SAAU,GACVC,MAAO,OACPF,gBAAiBL,EAAMQ,QAAQC,QAAQC,UAIrCC,EAAYlB,EAAOmB,EAAPnB,EAAY,EAAGO,YAAa,CAC5Ca,cAAe,OACfC,WAAYd,EAAMe,WAAWC,kBAC7BC,YAAajB,EAAME,QAAQ,GAC3BgB,MAAOlB,EAAMQ,QAAQW,KAAKC,UAC1BC,WAAY,EACZC,cAAe,EACfrB,UAAWD,EAAME,QAAQ,GACzB,iBAAkB,CAChBgB,MAAOlB,EAAMQ,QAAQW,KAAKC,UAC1BN,WAAYd,EAAMe,WAAWQ,oBAUpBC,EAAU,EACrB1B,WACA2B,OACAC,aAAa,EACbC,cAAc,KAAM,UAEpB,MAAMC,EC1D+B,GACrCC,cAAc,IACdC,aAAa,KACwC,MACrD,MAAMtB,QAAEA,GAAYuB,IACpB,MAAwB,UAAjBvB,EAAQwB,KAAmBxB,EAAQyB,KAAKJ,GAAerB,EAAQyB,KAAKH,EAAW,EDqDtEI,IACTC,EAAaC,GAAkBC,EAASX,GAO/C,OACE/B,EAACL,EAAuB,CAAAgD,MAAO,CAACH,EAAaC,GAC3CtC,SAAAyC,EAACC,EAAK,CAACC,QAAQ,WACb3C,SAAA,CAAAH,EAAC+C,EAAI,CAAAC,QAASf,WACZjC,EAACH,EAAW,CAAA8C,MAAOH,EAAaS,SAThB,CAACC,EAAmCC,KAC1DV,EAAeU,GACfnB,EAAYF,EAAKqB,GAAQA,EAAM,WAQtBrB,EAAKsB,KAAI,EAAG5B,OAAM6B,UACjBrD,EAACgB,EAAS,CAACsC,aAAa,QAAQC,eAAa,EAAYC,MAAOhC,EAAM6B,KAAMA,GAAzB7B,SAIxDrB,MAGL,EEzESsD,EAAe,EAAGN,QAAOhD,WAAUuD,SAC9C,MAAOf,GAASgB,EAAWlE,GAC3B,IAAImE,EAAQjB,IAAUQ,EAKtB,OAJIU,MAAMC,QAAQX,KAChBS,EAAQT,EAAMY,SAASpB,IAGlBiB,EAAQ5D,EAAC+C,EAAI,CAAAW,GAAIA,WAAKvD,IAAkB,IAAI"}
|
package/tab-panel/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("@mui/material/Box"),t=require("react");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(r);const n=t.createContext([0,()=>null]);n.Provider;exports.TabPanel=function({children:r,index:i}){const[l]=t.useContext(n);let u=l===i;return Array.isArray(i)&&(u=i.includes(l)),e.jsx("div",{role:"tabpanel",hidden:!u,id:`simple-tabpanel-${i}`,"aria-labelledby":`simple-tab-${i}`,children:u&&e.jsx(a.default,{sx:{p:3},children:r})})};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/tab-provider/tab-provider.context.ts","../../../src/tab-panel/tab-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/tab-provider/tab-provider.context.ts","../../../src/tab-panel/tab-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import Box from \"@mui/material/Box\";\nimport { useTab } from \"../tab-provider\";\n\ninterface TabPanelProps {\n children?: React.ReactNode;\n index: number | number[];\n}\n\nexport function TabPanel({ children, index }: TabPanelProps) {\n const [value] = useTab();\n let isTab = value === index;\n if (Array.isArray(index)) {\n isTab = index.includes(value);\n }\n\n return (\n <div\n role=\"tabpanel\"\n hidden={!isTab}\n id={`simple-tabpanel-${index}`}\n aria-labelledby={`simple-tab-${index}`}\n >\n {isTab && <Box sx={{ p: 3 }}>{children}</Box>}\n </div>\n );\n}\n"],"names":["TabContext","createContext","Provider","children","index","value","useContext","isTab","Array","isArray","includes","_jsx","jsx","role","hidden","id","Box","sx","p"],"mappings":"4OAEO,MAAMA,EAAaC,EAAAA,cAA0D,CAClF,EACA,IAAM,OAE0BD,EAAWE,oCCEpBC,SAAEA,EAAQC,MAAEA,IACnC,MAAOC,GDFmBC,EAAUA,WAACN,GCGrC,IAAIO,EAAQF,IAAUD,EAKtB,OAJII,MAAMC,QAAQL,KAChBG,EAAQH,EAAMM,SAASL,IAIvBM,EACEC,IAAA,MAAA,CAAAC,KAAK,WACLC,QAASP,EACTQ,GAAI,mBAAmBX,sBACN,cAAcA,IAAOD,SAErCI,GAASI,EAAAC,IAACI,EAAG,QAAA,CAACC,GAAI,CAAEC,EAAG,GAAGf,SAAGA,KAGpC"}
|
package/tab-panel/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import e from"@mui/material/Box";import{createContext as i,useContext as l}from"react";const t=i([0,()=>null]);t.Provider;function n({children:i,index:n}){const[a]=l(t);let o=a===n;return Array.isArray(n)&&(o=n.includes(a)),r("div",{role:"tabpanel",hidden:!o,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`,children:o&&r(e,{sx:{p:3},children:i})})}export{n as TabPanel};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/tab-panel/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/tab-provider/tab-provider.context.ts","../../src/tab-panel/tab-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/tab-provider/tab-provider.context.ts","../../src/tab-panel/tab-panel.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import Box from \"@mui/material/Box\";\nimport { useTab } from \"../tab-provider\";\n\ninterface TabPanelProps {\n children?: React.ReactNode;\n index: number | number[];\n}\n\nexport function TabPanel({ children, index }: TabPanelProps) {\n const [value] = useTab();\n let isTab = value === index;\n if (Array.isArray(index)) {\n isTab = index.includes(value);\n }\n\n return (\n <div\n role=\"tabpanel\"\n hidden={!isTab}\n id={`simple-tabpanel-${index}`}\n aria-labelledby={`simple-tab-${index}`}\n >\n {isTab && <Box sx={{ p: 3 }}>{children}</Box>}\n </div>\n );\n}\n"],"names":["TabContext","createContext","Provider","TabPanel","children","index","value","useContext","isTab","Array","isArray","includes","_jsx","role","hidden","id","Box","sx","p"],"mappings":"+HAEO,MAAMA,EAAaC,EAA0D,CAClF,EACA,IAAM,OAE0BD,EAAWE,kBCE7BC,GAASC,SAAEA,EAAQC,MAAEA,IACnC,MAAOC,GDFmBC,EAAWP,GCGrC,IAAIQ,EAAQF,IAAUD,EAKtB,OAJII,MAAMC,QAAQL,KAChBG,EAAQH,EAAMM,SAASL,IAIvBM,EACE,MAAA,CAAAC,KAAK,WACLC,QAASN,EACTO,GAAI,mBAAmBV,sBACN,cAAcA,IAAOD,SAErCI,GAASI,EAACI,EAAG,CAACC,GAAI,CAAEC,EAAG,GAAGd,SAAGA,KAGpC"}
|
package/tab-panel/tab-panel.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("react/jsx-runtime");const t=e.createContext([0,()=>null]),o=t.Provider;exports.TabContext=t,exports.TabContextProvider=o,exports.TabProvider=({children:t,initialValue:s=0})=>{const a=e.useState(s);return r.jsx(o,{value:a,children:t})},exports.useTab=()=>e.useContext(t);
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/tab-provider/tab-provider.context.ts","../../../src/tab-provider/tab-provider.provider.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/tab-provider/tab-provider.context.ts","../../../src/tab-provider/tab-provider.provider.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import { PropsWithChildren, useState } from \"react\";\nimport { TabContextProvider } from \"./tab-provider.context\";\n\ntype TabProviderProps = PropsWithChildren<{\n initialValue?: number;\n}>;\n\nexport const TabProvider = ({ children, initialValue = 0 }: TabProviderProps) => {\n const tabState = useState(initialValue);\n\n return <TabContextProvider value={tabState}>{children}</TabContextProvider>;\n};\n"],"names":["TabContext","createContext","TabContextProvider","Provider","children","initialValue","tabState","useState","_jsx","value","useContext"],"mappings":"0HAEO,MAAMA,EAAaC,EAAAA,cAA0D,CAClF,EACA,IAAM,OAEKC,EAAqBF,EAAWG,+ECClB,EAAGC,WAAUC,eAAe,MACrD,MAAMC,EAAWC,WAASF,GAE1B,OAAOG,EAAAA,IAACN,EAAmB,CAAAO,MAAOH,EAAQF,SAAGA,GAA8B,iBDHvD,IAAMM,EAAAA,WAAWV"}
|
package/tab-provider/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{createContext as r,useContext as e,useState as t}from"react";import{jsx as i}from"react/jsx-runtime";const n=r([0,()=>null]),o=n.Provider,l=()=>e(n),c=({children:r,initialValue:e=0})=>{const n=t(e);return i(o,{value:n,children:r})};export{n as TabContext,o as TabContextProvider,c as TabProvider,l as useTab};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/tab-provider/tab-provider.context.ts","../../src/tab-provider/tab-provider.provider.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/tab-provider/tab-provider.context.ts","../../src/tab-provider/tab-provider.provider.tsx"],"sourcesContent":["import { createContext, Dispatch, SetStateAction, useContext } from \"react\";\n\nexport const TabContext = createContext<[number, Dispatch<SetStateAction<number>>]>([\n 0,\n () => null,\n]);\nexport const TabContextProvider = TabContext.Provider;\nexport const useTab = () => useContext(TabContext);\n","import { PropsWithChildren, useState } from \"react\";\nimport { TabContextProvider } from \"./tab-provider.context\";\n\ntype TabProviderProps = PropsWithChildren<{\n initialValue?: number;\n}>;\n\nexport const TabProvider = ({ children, initialValue = 0 }: TabProviderProps) => {\n const tabState = useState(initialValue);\n\n return <TabContextProvider value={tabState}>{children}</TabContextProvider>;\n};\n"],"names":["TabContext","createContext","TabContextProvider","Provider","useTab","useContext","TabProvider","children","initialValue","tabState","useState","_jsx","value"],"mappings":"4GAEO,MAAMA,EAAaC,EAA0D,CAClF,EACA,IAAM,OAEKC,EAAqBF,EAAWG,SAChCC,EAAS,IAAMC,EAAWL,GCA1BM,EAAc,EAAGC,WAAUC,eAAe,MACrD,MAAMC,EAAWC,EAASF,GAE1B,OAAOG,EAACT,EAAmB,CAAAU,MAAOH,EAAQF,SAAGA,GAA8B"}
|