@flipdish/portal-library 5.4.2 → 5.5.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.
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),s=require("@mui/material/LinearProgress"),a=require("@mui/material/Box"),l=require("@mui/material/Typography");const o=require("@mui/material/styles").styled(s)((({theme:e})=>({height:8,[`&.${s.linearProgressClasses.root}`]:{borderRadius:5,backgroundColor:e.palette.grey[200],...e.applyStyles("dark",{backgroundColor:e.palette.grey[800]}),boxShadow:e.customShadows?.sunken},[`&.${s.linearProgressClasses.colorPrimary} .${s.linearProgressClasses.bar}`]:{backgroundColor:e.palette.semantic.fill["fill-selected"],...e.applyStyles("dark",{backgroundColor:e.palette.semantic.fill["fill-selected"]})},[`& .${s.linearProgressClasses.bar1}`]:{borderRadius:5,boxShadow:e.customShadows?.sunken},[`& .${s.linearProgressClasses.bar2}`]:{borderRadius:5,boxShadow:e.customShadows?.sunken},[`& .${s.linearProgressClasses.dashed}`]:{marginTop:2}}))),i=({value:s,label:i,showLabel:t,...n})=>{const d=r.useId(),u=r.useMemo((()=>i||(void 0!==s?`${s}%`:void 0)),[i,s]);return e.jsxs(a,{alignItems:"center",display:"flex",gap:1,children:[e.jsx(a,{flex:1,children:e.jsx(o,{"aria-label":!t&&u?u:void 0,"aria-labelledby":t&&u?d:void 0,...n,value:s})}),t&&e.jsx(a,{alignItems:"center",display:"flex",height:20,justifyContent:"flex-end",width:40,children:e.jsx(l,{color:"textSecondary",id:d,variant:"captionWeak",children:u})})]})};Object.defineProperty(exports,"linearProgressClasses",{enumerable:!0,get:function(){return s.linearProgressClasses}}),exports.LinearProgress=i,exports.default=i;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/LinearProgress/index.tsx"],"sourcesContent":["import { useId, useMemo } from 'react';\n\nimport MuiLinearProgress, {\n linearProgressClasses,\n type LinearProgressProps as MuiLinearProgressProps,\n} from '@mui/material/LinearProgress';\n\nimport Box from '@fd/components/atoms/Box';\nimport Typography from '@fd/components/atoms/Typography';\nimport styled from '@fd/utilities/styledUtilities';\n\nconst StyledLinearProgress = styled(MuiLinearProgress)(({ theme }) => {\n return {\n height: 8,\n [`&.${linearProgressClasses.root}`]: {\n borderRadius: 5,\n backgroundColor: theme.palette.grey[200],\n ...theme.applyStyles('dark', {\n backgroundColor: theme.palette.grey[800],\n }),\n boxShadow: theme.customShadows?.sunken,\n },\n [`&.${linearProgressClasses.colorPrimary} .${linearProgressClasses.bar}`]: {\n backgroundColor: theme.palette.semantic.fill['fill-selected'],\n ...theme.applyStyles('dark', {\n backgroundColor: theme.palette.semantic.fill['fill-selected'],\n }),\n },\n [`& .${linearProgressClasses.bar1}`]: {\n borderRadius: 5,\n boxShadow: theme.customShadows?.sunken,\n },\n [`& .${linearProgressClasses.bar2}`]: {\n borderRadius: 5,\n boxShadow: theme.customShadows?.sunken,\n },\n [`& .${linearProgressClasses.dashed}`]: {\n marginTop: 2,\n },\n };\n});\n\ninterface LinearProgressProps extends MuiLinearProgressProps {\n label?: string;\n showLabel?: boolean;\n}\n\n/**\n * Props for the themed LinearProgress component.\n * Extends MUI's LinearProgressProps.\n * - label: Optional label text (falls back to percentage when `value` is provided).\n * - showLabel: When true, renders the label to the right of the bar.\n */\nexport const LinearProgress: React.FC<LinearProgressProps> = ({ value, label, showLabel, ...rest }) => {\n const labelId = useId();\n const parsedLabel = useMemo(() => label || (value !== undefined ? `${value}%` : undefined), [label, value]);\n return (\n <Box alignItems=\"center\" display=\"flex\" gap={1}>\n <Box flex={1}>\n <StyledLinearProgress\n aria-label={!showLabel && parsedLabel ? parsedLabel : undefined}\n aria-labelledby={showLabel && parsedLabel ? labelId : undefined}\n {...rest}\n value={value}\n />\n </Box>\n {showLabel && (\n <Box alignItems=\"center\" display=\"flex\" height={20} justifyContent=\"flex-end\" width={40}>\n <Typography color=\"textSecondary\" id={labelId} variant=\"captionWeak\">\n {parsedLabel}\n </Typography>\n </Box>\n )}\n </Box>\n );\n};\n\nexport default LinearProgress;\n\nexport { linearProgressClasses };\n"],"names":["StyledLinearProgress","styled","MuiLinearProgress","theme","height","linearProgressClasses","root","borderRadius","backgroundColor","palette","grey","applyStyles","boxShadow","customShadows","sunken","colorPrimary","bar","semantic","fill","bar1","bar2","dashed","marginTop","LinearProgress","value","label","showLabel","rest","labelId","useId","parsedLabel","useMemo","undefined","_jsxs","Box","alignItems","display","gap","children","_jsx","flex","justifyContent","width","Typography","color","id","variant"],"mappings":"yOAWA,MAAMA,kCAAuBC,OAAOC,EAAPD,EAA0B,EAAGE,YACjD,CACLC,OAAQ,EACR,CAAC,KAAKC,wBAAsBC,QAAS,CACnCC,aAAc,EACdC,gBAAiBL,EAAMM,QAAQC,KAAK,QACjCP,EAAMQ,YAAY,OAAQ,CAC3BH,gBAAiBL,EAAMM,QAAQC,KAAK,OAEtCE,UAAWT,EAAMU,eAAeC,QAElC,CAAC,KAAKT,wBAAsBU,iBAAiBV,EAAAA,sBAAsBW,OAAQ,CACzER,gBAAiBL,EAAMM,QAAQQ,SAASC,KAAK,oBAC1Cf,EAAMQ,YAAY,OAAQ,CAC3BH,gBAAiBL,EAAMM,QAAQQ,SAASC,KAAK,oBAGjD,CAAC,MAAMb,wBAAsBc,QAAS,CACpCZ,aAAc,EACdK,UAAWT,EAAMU,eAAeC,QAElC,CAAC,MAAMT,wBAAsBe,QAAS,CACpCb,aAAc,EACdK,UAAWT,EAAMU,eAAeC,QAElC,CAAC,MAAMT,wBAAsBgB,UAAW,CACtCC,UAAW,OAgBJC,EAAgD,EAAGC,QAAOC,QAAOC,eAAcC,MAC1F,MAAMC,EAAUC,EAAAA,QACVC,EAAcC,EAAAA,SAAQ,IAAMN,SAAoBO,IAAVR,EAAsB,GAAGA,UAAWQ,IAAY,CAACP,EAAOD,IACpG,OACES,EAAAA,KAACC,EAAG,CAACC,WAAW,SAASC,QAAQ,OAAOC,IAAK,EAACC,SAAA,CAC5CC,EAAAA,IAACL,GAAIM,KAAM,EAACF,SACVC,EAAAA,IAACvC,iBACc0B,GAAaI,EAAcA,OAAcE,EAAS,kBAC9CN,GAAaI,EAAcF,OAAUI,KAClDL,EACJH,MAAOA,MAGVE,GACCa,EAAAA,IAACL,EAAG,CAACC,WAAW,SAASC,QAAQ,OAAOhC,OAAQ,GAAIqC,eAAe,WAAWC,MAAO,GAAEJ,SACrFC,EAAAA,IAACI,GAAWC,MAAM,gBAAgBC,GAAIjB,EAASkB,QAAQ,cAAaR,SACjER"}
@@ -0,0 +1,16 @@
1
+ import { LinearProgressProps as LinearProgressProps$1 } from '@mui/material/LinearProgress';
2
+ export { linearProgressClasses } from '@mui/material/LinearProgress';
3
+
4
+ interface LinearProgressProps extends LinearProgressProps$1 {
5
+ label?: string;
6
+ showLabel?: boolean;
7
+ }
8
+ /**
9
+ * Props for the themed LinearProgress component.
10
+ * Extends MUI's LinearProgressProps.
11
+ * - label: Optional label text (falls back to percentage when `value` is provided).
12
+ * - showLabel: When true, renders the label to the right of the bar.
13
+ */
14
+ declare const LinearProgress: React.FC<LinearProgressProps>;
15
+
16
+ export { LinearProgress, LinearProgress as default };
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useId as a,useMemo as o}from"react";import l,{linearProgressClasses as t}from"@mui/material/LinearProgress";export{linearProgressClasses}from"@mui/material/LinearProgress";import i from"@mui/material/Box";import s from"@mui/material/Typography";import{styled as d}from"@mui/material/styles";const m=d(l)((({theme:e})=>({height:8,[`&.${t.root}`]:{borderRadius:5,backgroundColor:e.palette.grey[200],...e.applyStyles("dark",{backgroundColor:e.palette.grey[800]}),boxShadow:e.customShadows?.sunken},[`&.${t.colorPrimary} .${t.bar}`]:{backgroundColor:e.palette.semantic.fill["fill-selected"],...e.applyStyles("dark",{backgroundColor:e.palette.semantic.fill["fill-selected"]})},[`& .${t.bar1}`]:{borderRadius:5,boxShadow:e.customShadows?.sunken},[`& .${t.bar2}`]:{borderRadius:5,boxShadow:e.customShadows?.sunken},[`& .${t.dashed}`]:{marginTop:2}}))),n=({value:l,label:t,showLabel:d,...n})=>{const c=a(),u=o((()=>t||(void 0!==l?`${l}%`:void 0)),[t,l]);return e(i,{alignItems:"center",display:"flex",gap:1,children:[r(i,{flex:1,children:r(m,{"aria-label":!d&&u?u:void 0,"aria-labelledby":d&&u?c:void 0,...n,value:l})}),d&&r(i,{alignItems:"center",display:"flex",height:20,justifyContent:"flex-end",width:40,children:r(s,{color:"textSecondary",id:c,variant:"captionWeak",children:u})})]})};export{n as LinearProgress,n as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/LinearProgress/index.tsx"],"sourcesContent":["import { useId, useMemo } from 'react';\n\nimport MuiLinearProgress, {\n linearProgressClasses,\n type LinearProgressProps as MuiLinearProgressProps,\n} from '@mui/material/LinearProgress';\n\nimport Box from '@fd/components/atoms/Box';\nimport Typography from '@fd/components/atoms/Typography';\nimport styled from '@fd/utilities/styledUtilities';\n\nconst StyledLinearProgress = styled(MuiLinearProgress)(({ theme }) => {\n return {\n height: 8,\n [`&.${linearProgressClasses.root}`]: {\n borderRadius: 5,\n backgroundColor: theme.palette.grey[200],\n ...theme.applyStyles('dark', {\n backgroundColor: theme.palette.grey[800],\n }),\n boxShadow: theme.customShadows?.sunken,\n },\n [`&.${linearProgressClasses.colorPrimary} .${linearProgressClasses.bar}`]: {\n backgroundColor: theme.palette.semantic.fill['fill-selected'],\n ...theme.applyStyles('dark', {\n backgroundColor: theme.palette.semantic.fill['fill-selected'],\n }),\n },\n [`& .${linearProgressClasses.bar1}`]: {\n borderRadius: 5,\n boxShadow: theme.customShadows?.sunken,\n },\n [`& .${linearProgressClasses.bar2}`]: {\n borderRadius: 5,\n boxShadow: theme.customShadows?.sunken,\n },\n [`& .${linearProgressClasses.dashed}`]: {\n marginTop: 2,\n },\n };\n});\n\ninterface LinearProgressProps extends MuiLinearProgressProps {\n label?: string;\n showLabel?: boolean;\n}\n\n/**\n * Props for the themed LinearProgress component.\n * Extends MUI's LinearProgressProps.\n * - label: Optional label text (falls back to percentage when `value` is provided).\n * - showLabel: When true, renders the label to the right of the bar.\n */\nexport const LinearProgress: React.FC<LinearProgressProps> = ({ value, label, showLabel, ...rest }) => {\n const labelId = useId();\n const parsedLabel = useMemo(() => label || (value !== undefined ? `${value}%` : undefined), [label, value]);\n return (\n <Box alignItems=\"center\" display=\"flex\" gap={1}>\n <Box flex={1}>\n <StyledLinearProgress\n aria-label={!showLabel && parsedLabel ? parsedLabel : undefined}\n aria-labelledby={showLabel && parsedLabel ? labelId : undefined}\n {...rest}\n value={value}\n />\n </Box>\n {showLabel && (\n <Box alignItems=\"center\" display=\"flex\" height={20} justifyContent=\"flex-end\" width={40}>\n <Typography color=\"textSecondary\" id={labelId} variant=\"captionWeak\">\n {parsedLabel}\n </Typography>\n </Box>\n )}\n </Box>\n );\n};\n\nexport default LinearProgress;\n\nexport { linearProgressClasses };\n"],"names":["StyledLinearProgress","styled","MuiLinearProgress","theme","height","linearProgressClasses","root","borderRadius","backgroundColor","palette","grey","applyStyles","boxShadow","customShadows","sunken","colorPrimary","bar","semantic","fill","bar1","bar2","dashed","marginTop","LinearProgress","value","label","showLabel","rest","labelId","useId","parsedLabel","useMemo","undefined","_jsxs","Box","alignItems","display","gap","children","_jsx","flex","justifyContent","width","Typography","color","id","variant"],"mappings":"4VAWA,MAAMA,EAAuBC,EAAOC,EAAPD,EAA0B,EAAGE,YACjD,CACLC,OAAQ,EACR,CAAC,KAAKC,EAAsBC,QAAS,CACnCC,aAAc,EACdC,gBAAiBL,EAAMM,QAAQC,KAAK,QACjCP,EAAMQ,YAAY,OAAQ,CAC3BH,gBAAiBL,EAAMM,QAAQC,KAAK,OAEtCE,UAAWT,EAAMU,eAAeC,QAElC,CAAC,KAAKT,EAAsBU,iBAAiBV,EAAsBW,OAAQ,CACzER,gBAAiBL,EAAMM,QAAQQ,SAASC,KAAK,oBAC1Cf,EAAMQ,YAAY,OAAQ,CAC3BH,gBAAiBL,EAAMM,QAAQQ,SAASC,KAAK,oBAGjD,CAAC,MAAMb,EAAsBc,QAAS,CACpCZ,aAAc,EACdK,UAAWT,EAAMU,eAAeC,QAElC,CAAC,MAAMT,EAAsBe,QAAS,CACpCb,aAAc,EACdK,UAAWT,EAAMU,eAAeC,QAElC,CAAC,MAAMT,EAAsBgB,UAAW,CACtCC,UAAW,OAgBJC,EAAgD,EAAGC,QAAOC,QAAOC,eAAcC,MAC1F,MAAMC,EAAUC,IACVC,EAAcC,GAAQ,IAAMN,SAAoBO,IAAVR,EAAsB,GAAGA,UAAWQ,IAAY,CAACP,EAAOD,IACpG,OACES,EAACC,EAAG,CAACC,WAAW,SAASC,QAAQ,OAAOC,IAAK,EAACC,SAAA,CAC5CC,EAACL,GAAIM,KAAM,EAACF,SACVC,EAACvC,iBACc0B,GAAaI,EAAcA,OAAcE,EAAS,kBAC9CN,GAAaI,EAAcF,OAAUI,KAClDL,EACJH,MAAOA,MAGVE,GACCa,EAACL,EAAG,CAACC,WAAW,SAASC,QAAQ,OAAOhC,OAAQ,GAAIqC,eAAe,WAAWC,MAAO,GAAEJ,SACrFC,EAACI,GAAWC,MAAM,gBAAgBC,GAAIjB,EAASkB,QAAQ,cAAaR,SACjER"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipdish/portal-library",
3
- "version": "5.4.2",
3
+ "version": "5.5.0",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -101,7 +101,7 @@
101
101
  "eslint-plugin-prettier": "^5.1.3",
102
102
  "eslint-plugin-react": "^7.37.4",
103
103
  "eslint-plugin-react-hooks": "4.6.2",
104
- "eslint-plugin-react-refresh": "0.4.20",
104
+ "eslint-plugin-react-refresh": "0.4.21",
105
105
  "eslint-plugin-simple-import-sort": "^12.0.0",
106
106
  "eslint-plugin-storybook": "^0.12.0",
107
107
  "eslint-plugin-testing-library": "^7.1.1",