@up42/up-components 0.1.4 → 0.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/README.md +3 -4
- package/dist/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -15
- package/package.json +5 -4
- package/dist/cjs/types/global/tokens/colors/colors.components.d.ts +0 -5
- package/dist/cjs/types/global/tokens/components/CodeSnippet.d.ts +0 -6
- package/dist/cjs/types/global/tokens/components/CopyToClipboard.d.ts +0 -4
- package/dist/cjs/types/global/tokens/components/Header.d.ts +0 -5
- package/dist/cjs/types/global/tokens/components/Table.d.ts +0 -9
- package/dist/cjs/types/global/tokens/spacing/spacing.components.d.ts +0 -5
- package/dist/cjs/types/global/tokens/typogrpahy/typography.components.d.ts +0 -4
- package/dist/cjs/types/stories/playground.stories.d.ts +0 -6
- package/dist/esm/types/global/tokens/colors/colors.components.d.ts +0 -5
- package/dist/esm/types/global/tokens/components/CodeSnippet.d.ts +0 -6
- package/dist/esm/types/global/tokens/components/CopyToClipboard.d.ts +0 -4
- package/dist/esm/types/global/tokens/components/Header.d.ts +0 -5
- package/dist/esm/types/global/tokens/components/Table.d.ts +0 -9
- package/dist/esm/types/global/tokens/spacing/spacing.components.d.ts +0 -5
- package/dist/esm/types/global/tokens/typogrpahy/typography.components.d.ts +0 -4
- package/dist/esm/types/stories/playground.stories.d.ts +0 -6
package/README.md
CHANGED
|
@@ -5,15 +5,14 @@ UP42's Shared Component Library. This is a cross-team collaborative package that
|
|
|
5
5
|
Up Components library provides react components based on [UP42's design system](https://www.figma.com/file/Qd9QmAdQfcsWe3xSKtJWX9FZ/Design-System)
|
|
6
6
|
|
|
7
7
|
## Getting Started
|
|
8
|
-
|
|
9
8
|
```bash
|
|
10
9
|
$ npm install @up42/up-components
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
If you are using `yarn` you need to install the peer dependencies manually.
|
|
14
13
|
|
|
15
14
|
```bash
|
|
16
|
-
$ yarn add @up42/up-components
|
|
15
|
+
$ yarn add @up42/up-components @mui/material @mui/icons-material @emotion/react @emotion/styled
|
|
17
16
|
```
|
|
18
17
|
|
|
19
18
|
## Using the up-components in your application
|
|
@@ -49,7 +48,7 @@ You can also import components from the `@mui/material` directly from the packag
|
|
|
49
48
|
## Developing in the up-components package
|
|
50
49
|
|
|
51
50
|
This package uses [Rollup](https://github.com/rollup/rollup) for building `esm` and `cjs` modules.
|
|
52
|
-
[npm](https://www.npmjs.com/) version 7 or higher is required install and build the components locally.
|
|
51
|
+
[npm](https://www.npmjs.com/) version 7 or higher is required install and build the components locally.
|
|
53
52
|
|
|
54
53
|
## Developing locally
|
|
55
54
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@up42/design-system-tokens/dist/json/tokens.json"),t=require("@mui/material"),o=require("react"),r=require("@mui/material/styles"),a=require("@mui/material/Button"),l=require("@mui/material/Typography"),n=require("@mui/material/InputAdornment"),i=require("@mui/material/IconButton"),d=require("@mui/icons-material/VisibilityOutlined"),u=require("@mui/icons-material/VisibilityOffOutlined");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=c(e),s=c(o),m=c(a),p=c(l),g=c(n),h=c(i),b=c(d),y=c(u),x=function(){return x=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var a in t=arguments[o])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},x.apply(this,arguments)};function v(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(o[r[a]]=e[r[a]])}return o}var z={styleOverrides:{root:{fontSize:"12px",fontWeight:600,fontFamily:f.default.font.family.text,"& .MuiChip-icon":{width:"12px",height:"12px",marginLeft:f.default.size.spacing.scale8}},colorDefault:{backgroundColor:f.default.color.gray10,color:f.default.color.gray60},colorPrimary:{backgroundColor:f.default.color.indigo10,color:f.default.color.indigo80},colorSecondary:{backgroundColor:f.default.color.pink10,color:f.default.color.pink80},colorError:{backgroundColor:f.default.color.red10,color:f.default.color.red50},colorInfo:{backgroundColor:f.default.color.indigo10,color:f.default.color.indigo80},colorSuccess:{backgroundColor:f.default.color.green10,color:f.default.color.green80}}},k={h1:{fontFamily:f.default.font.family.heading,fontSize:f.default.size.font.heading.default,fontWeight:f.default.font.weight.bold,lineHeight:f.default.font.lineHeight.xlarge},h2:{fontFamily:f.default.font.family.heading,fontSize:f.default.size.font.heading.small,fontWeight:f.default.font.weight.bold,lineHeight:f.default.font.lineHeight.xlarge},h3:{fontFamily:f.default.font.family.heading,fontSize:f.default.size.font.heading.xsmall,fontWeight:f.default.font.weight.bold,lineHeight:f.default.font.lineHeight.large},body1:{fontFamily:f.default.font.family.text,fontSize:f.default.size.font.body.default,fontWeight:f.default.font.weight.normal,lineHeight:f.default.font.lineHeight.large},body2:{fontFamily:f.default.font.family.text,fontSize:f.default.size.font.body.default,fontWeight:f.default.font.weight.bold,lineHeight:f.default.font.lineHeight.large},caption:{fontFamily:f.default.font.family.text,fontSize:f.default.size.font.caption.default,fontWeight:f.default.font.weight.normal,lineHeight:f.default.font.lineHeight.medium},overline:{fontFamily:f.default.font.family.heading,fontSize:f.default.size.font.overline.default,letterSpacing:"initial",fontWeight:f.default.font.weight.bold,color:f.default.color.gray60}},E={small:"".concat(f.default.size.spacing.scale4," ").concat(f.default.size.spacing.scale8),medium:"".concat(f.default.size.spacing.scale8," ").concat(f.default.size.spacing.scale16),large:"".concat(f.default.size.spacing.scale16," ").concat(f.default.size.spacing.scale32)},C={styleOverrides:{root:{textTransform:"none",lineHeight:f.default.size.spacing.scale16,fontWeight:f.default.font.weight.bold,fontFamily:f.default.font.family.text},contained:{padding:E.medium},containedSizeSmall:{padding:E.small},containedSizeLarge:{padding:E.large},text:{padding:E.medium},textSizeSmall:{padding:E.small},textSizeLarge:{padding:E.large},outlined:{padding:"7px ".concat(f.default.size.spacing.scale16)},outlinedSizeSmall:{padding:E.small},outlinedSizeLarge:{padding:E.large},sizeSmall:{fontSize:f.default.size.font.label.default},sizeLarge:{fontSize:f.default.size.font.label.large},startIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}},endIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}}},defaultProps:{disableFocusRipple:!0},MuiIconButton:{root:{"&&:hover":{backgroundColor:"transparent"}}}},S={styleOverrides:{root:{color:f.default.color.gray60,backgroundColor:f.default.color.background.dark},sizeSmall:{padding:"3px"}}},w={styleOverrides:{root:{fontFamily:f.default.font.family.text,fontSize:f.default.size.font.label.default,fontWeight:f.default.font.weight.bold,width:f.default.size.spacing.scale24,height:f.default.size.spacing.scale24,"& .MuiSvgIcon-root":{width:f.default.size.spacing.scale16}},colorDefault:{backgroundColor:f.default.color.background.dark,"& .MuiSvgIcon-root":{color:f.default.color.gray60}}}},F={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:f.default.color.border.default,"& svg":{width:"16px",height:"16px"},"&&:hover":{backgroundColor:"transparent"}},colorPrimary:{"&$checked":{"&&:hover":{backgroundColor:"transparent"}}},colorSecondary:{"&$checked":{color:f.default.color.brand.darkMatter},"&$disabled":{opacity:.5}}}},O={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:f.default.color.border.default,"& svg":{width:"16px",height:"16px"},"&:hover":{background:"none"}}}},M={styleOverrides:{root:{marginRight:16},colorSecondary:{color:f.default.color.gray0,"&$checked":{color:f.default.color.gray0,left:2,"&:hover":{backgroundColor:"transparent"}},"&$disabled":{color:f.default.color.gray0}},track:{position:"absolute",width:48,height:24,borderRadius:12,opacity:1,left:"calc(50% - 48px/2)",top:"calc(50% - 24px/2)",backgroundColor:f.default.color.background.light,border:"2px solid ".concat(f.default.color.border.default),boxSizing:"border-box","$checked$checked + &":{opacity:1,backgroundColor:f.default.color.brand.darkMatter,border:"2px solid ".concat(f.default.color.brand.darkMatter)},"$disabled$disabled + &":{opacity:.5,cursor:"not-allowed"}},thumb:{boxShadow:"none"}}},P={styleOverrides:{outlined:{position:"relative",padding:f.default.size.spacing.scale8,fontSize:f.default.size.font.label.default,borderRadius:f.default.size.spacing.scale6,width:"100%","&.Mui-disabled":{backgroundColor:f.default.color.background.dark,color:f.default.color.text.light}}}},L={styleOverrides:{root:{input:{padding:f.default.size.spacing.scale8,fontSize:f.default.size.font.label.default,height:f.default.size.spacing.scale16},"& .MuiInputAdornment-root":{button:{padding:"0 ".concat(f.default.size.spacing.scale8," 0 0"),backgroundColor:"transparent"},svg:{width:f.default.size.spacing.scale16,height:f.default.size.spacing.scale16}}}}},B={styleOverrides:{outlined:{notchedOutline:{borderColor:f.default.color.border.default}},root:{underline:{"&:before":{borderBottom:"none"},"&:after":{borderBottom:"none"},"&:hover":{borderBottom:"none"},"&&:hover::before":{border:"none"}}}}};f.default.size.font.body.default,f.default.font.family.text,f.default.color.gray100;var T={styleOverrides:{textColorPrimary:{textTransform:"none",minWidth:"auto",fontWeight:700,marginRight:"".concat(f.default.size.spacing.scale16),fontFamily:f.default.font.family.text,color:f.default.color.gray60,padding:"0 0 ".concat(f.default.size.spacing.scale16," 0"),"&:hover":{color:f.default.color.brand.darkMatter,opacity:1},"&$selected":{color:f.default.color.brand.darkMatter},"&:focus":{color:f.default.color.brand.darkMatter}}},defaultProps:{disableRipple:!0}};f.default.size.font.caption.default;var W,j,H,I={styleOverrides:{root:{borderBottom:"1px solid ".concat(f.default.color.gray20)},indicator:{backgroundColor:f.default.color.brand.darkMatter}}},R={styleOverrides:{root:{fontWeight:f.default.font.weight.bold,lineHeight:f.default.font.lineHeight.medium,fontFamily:f.default.font.family.text,fontSize:f.default.size.font.caption.default,color:f.default.color.text.base,marginBottom:f.default.size.spacing.scale8}}},q=t.createTheme({typography:x({},k),palette:{background:{default:"#ffffff"},primary:{main:f.default.color.brand.darkMatter},secondary:{main:f.default.color.brand.titanPink},error:{main:f.default.color.utility.danger},info:{main:f.default.color.utility.info},success:{main:f.default.color.green60}},components:{MuiButton:C,MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0}},MuiContainer:{styleOverrides:{maxWidthLg:{"@media (min-width: 1280px)":{maxWidth:"1185px"}}}},MuiIconButton:S,MuiChip:z,MuiInput:B,MuiTextField:L,MuiFormLabel:R,MuiTabs:I,MuiTab:T,MuiAvatar:w,MuiCheckbox:F,MuiRadio:O,MuiSwitch:M,MuiSelect:P,MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiDivider:{styleOverrides:{root:{margin:"16px 0"}}},MuiFormControl:{styleOverrides:{root:{width:"100%"}}}}}),$=r.styled(t.CircularProgress)(H||(W=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],j=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],Object.defineProperty?Object.defineProperty(W,"raw",{value:j}):W.raw=j,H=W)),A={small:6,medium:8,large:12,fluid:12},G=function(e){var o=v(e,[]);return s.default.createElement(t.Checkbox,x({},o))},N=function(e){return s.default.createElement(t.Radio,x({},e))},D=function(e){return s.default.createElement(t.Switch,x({},e))},U=function(e){return s.default.createElement(t.Select,x({variant:"outlined"},e))},V=function(e){var r=e.type,a=v(e,["type"]),l=o.useState(!1),n=l[0],i=l[1],d=x(x({},a.InputProps),"password"===r&&{endAdornment:s.default.createElement(g.default,{position:"end"},s.default.createElement(h.default,{"aria-label":"toggle password visibility",onClick:function(){return i(!n)},edge:"end"},n?s.default.createElement(b.default,null):s.default.createElement(y.default,null)))});return s.default.createElement(t.TextField,x({},a,{type:n?"text":r,InputProps:d}))};Object.defineProperty(exports,"tokens",{enumerable:!0,get:function(){return f.default}}),exports.Avatar=function(e){var o=e.icon,r=e.firstName,a=void 0===r?"":r,l=e.lastName,n=void 0===l?"":l,i=v(e,["icon","firstName","lastName"]),d="".concat(a.substring(0,1)).concat(n.substring(0,1)).toLocaleUpperCase(),u=d?f.default.color.brand.titanPink:f.default.color.background.dark;return s.default.createElement(t.Avatar,x({sx:x({backgroundColor:u},i.sx)},i),d||o)},exports.Box=function(e){var o=e.children,r=v(e,["children"]);return s.default.createElement(t.Box,x({},r),o)},exports.Button=function(e){var t=e.color,o=void 0===t?"primary":t,r=e.variant,a=void 0===r?"contained":r,l=e.size,n=void 0===l?"medium":l,i=e.loading,d=e.children,u=v(e,["color","variant","size","loading","children"]);return s.default.createElement(m.default,x({size:n,variant:a,color:o,disabled:i},u),s.default.createElement("span",{style:{opacity:i?0:1}},d),i&&s.default.createElement($,{size:20,color:"inherit"}))},exports.Checkbox=G,exports.Chip=function(e){var o=e.label,r=v(e,["label"]);return s.default.createElement(t.Chip,x({size:"small",label:o},r))},exports.Container=function(e){var o=e.component,r=void 0===o?"div":o,a=e.size,l=void 0===a?"large":a,n=e.children,i=v(e,["component","size","children"]),d="fluid"===l;return s.default.createElement(t.Container,x({component:r,disableGutters:d,maxWidth:!d&&"lg",sx:x({display:"flex",justifyContent:"center"},i.sx)},i),s.default.createElement(t.Grid,{container:!0,justifyContent:"center"},s.default.createElement(t.Grid,{item:!0,md:A[l]},n)))},exports.FormCheckbox=function(e){var o=e.id,r=e.required,a=void 0===r||r,l=e.data,n=e.label,i=e.error,d=e.helperText;return s.default.createElement(t.FormControl,null,s.default.createElement(t.FormLabel,{component:"label",error:i},n," ",a?"":s.default.createElement(t.Box,{component:"span",sx:{fontWeight:f.default.font.weight.normal,color:f.default.color.text.light}},"(optional)")),s.default.createElement(t.FormGroup,null,l.map((function(e,r){var a=e.value,l=e.label;return s.default.createElement(t.FormControlLabel,{key:r,value:a,label:l||"",sx:{fontSize:f.default.size.font.base,color:f.default.color.text.base},control:s.default.createElement(G,{color:"primary",inputProps:{"data-testid":"".concat(o,"-").concat(r)}})})}))),i&&s.default.createElement(t.FormHelperText,{sx:{marginLeft:0,marginRight:0},error:i},d))},exports.FormInput=function(e){var o=e.id,r=e.required,a=void 0===r||r,l=e.label,n=e.error,i=e.helperText,d=v(e,["id","required","label","error","helperText"]);return s.default.createElement(t.FormControl,null,s.default.createElement(t.FormLabel,{component:"label",error:n},l," ",!a&&s.default.createElement(t.Box,{component:"span",sx:{fontWeight:f.default.font.weight.normal,color:f.default.color.text.light}},"(optional)")),s.default.createElement(V,x({},d,{id:o,error:n,inputProps:{"data-testid":o}})),n&&s.default.createElement(t.FormHelperText,{sx:{marginLeft:0,marginRight:0},error:n},i))},exports.FormRadio=function(e){var o=e.id,r=e.helperText,a=e.label,l=e.error,n=e.required,i=void 0===n||n,d=e.name,u=e.data;return s.default.createElement(t.FormControl,{component:"fieldset",error:l},s.default.createElement(t.FormLabel,{component:"legend"},a," ",i?"":s.default.createElement(t.Box,{component:"span",sx:{fontWeight:f.default.font.weight.normal,color:f.default.color.text.light}},"(optional)")),s.default.createElement(t.RadioGroup,{"aria-label":d,name:d},u.map((function(e,r){var a=e.value,l=e.label;return s.default.createElement(t.FormControlLabel,{value:a,key:a,label:l||"",sx:{fontSize:f.default.size.font.base,color:f.default.color.text.base},control:s.default.createElement(N,{color:"primary",inputProps:{"data-testid":"".concat(o,"-").concat(r)}})})}))),l&&s.default.createElement(t.FormHelperText,{sx:{marginLeft:0,marginRight:0}},r))},exports.FormSelect=function(e){var o=e.id,r=e.required,a=void 0===r||r,l=e.options,n=e.label,i=e.error,d=e.placeholder,u=e.helperText;return s.default.createElement(t.FormControl,null,s.default.createElement(t.FormLabel,{component:"label",error:i},n," ",a?"":s.default.createElement(t.Box,{component:"span",sx:{fontWeight:f.default.font.weight.normal,color:f.default.color.text.light}},"(optional)")),s.default.createElement(U,{id:o,placeholder:d,error:i},l.map((function(e){return s.default.createElement(t.MenuItem,{key:e.value,value:e.value},e.text)}))),i&&s.default.createElement(t.FormHelperText,{sx:{marginLeft:0,marginRight:0},error:i},u))},exports.FormSwitch=function(e){var o=e.id,r=e.label,a=e.checked;return s.default.createElement(t.FormControl,null,s.default.createElement(t.FormLabel,{component:"label"},r),s.default.createElement(t.FormControlLabel,{control:s.default.createElement(D,{id:o}),label:"".concat(a?"Active":"Inactive")}))},exports.Input=V,exports.Link=function(e){var o=e.children,r=v(e,["children"]);return s.default.createElement(t.Link,x({underline:"hover",variant:"caption",component:"span"},r),o)},exports.Radio=N,exports.Select=U,exports.Switch=D,exports.Typography=function(e){var t=e.children,o=v(e,["children"]);return s.default.createElement(p.default,x({},o),t)},exports.UpComponentsProvider=function(e){return s.default.createElement(s.default.Fragment,null,s.default.createElement(t.CssBaseline,null),s.default.createElement(r.ThemeProvider,{theme:q},e.children))},exports.theme=q,Object.keys(t).forEach((function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}));
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mui/material"),r=require("react"),t=require("@mui/material/styles"),o=require("@mui/material/Button"),n=require("@mui/material/Typography"),a=require("@mui/material/InputAdornment"),i=require("@mui/material/IconButton"),l=require("@mui/icons-material/VisibilityOutlined"),c=require("@mui/icons-material/VisibilityOffOutlined");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var f=d(r),s=d(o),u=d(n),g=d(a),p=d(i),m=d(l),b=d(c),h={animation:{speed:{normal:"0.5s",fast:"0.08s",slow:"1s"}},color:{background:{light:"#f4f5f7",dark:"#dfe1e6",indigo:"#262a59"},indigo0:"#f4f4f6",indigo10:"#e9e9ee",indigo20:"#bdbfcd",indigo30:"#a8aabd",indigo40:"#9294ac",indigo50:"#7d7f9b",indigo60:"#67698a",indigo70:"#51557a",indigo80:"#3b3f69",indigo90:"#262a59",indigo100:"#161833",pink0:"#fff3ff",pink10:"#fedafd",pink20:"#fdc0fb",pink30:"#f98ef3",pink40:"#f362e8",pink50:"#ec3ed7",pink60:"#d40fa9",pink70:"#b0027c",pink80:"#990165",pink90:"#820050",pink100:"#390325",cyan0:"#f4ffff",cyan10:"#c6ffff",cyan20:"#96ffff",cyan30:"#59effc",cyan40:"#1dd7f0",cyan50:"#20b0c7",cyan60:"#1d8fa4",cyan70:"#167286",cyan80:"#0e5a6d",cyan90:"#064658",cyan100:"#103645",green0:"#f8fff4",green10:"#e2fccc",green20:"#e2fccc",green30:"#aed581",green40:"#8eaf65",green50:"#728f4b",green60:"#5a7533",green70:"#476020",green80:"#374e10",green90:"#2b3f05",green100:"#223300",red0:"#fff7f4",red10:"#ffe4db",red20:"#fcc4bb",red30:"#efa299",red40:"#e67e78",red50:"#e35656",red60:"#b83d3c",red70:"#922524",red80:"#6f1110",red90:"#500404",red100:"#330000",gray0:"#ffffff",gray10:"#f4f5f7",gray20:"#dfe1e6",gray30:"#c1c7d0",gray40:"#a8afba",gray50:"#9399a3",gray60:"#777c85",gray70:"#575b61",gray80:"#3c3e42",gray90:"#222426",gray100:"#121315",base:{indigo0:"#f4f4f6",indigo10:"#e9e9ee",indigo20:"#bdbfcd",indigo30:"#a8aabd",indigo40:"#9294ac",indigo50:"#7d7f9b",indigo60:"#67698a",indigo70:"#51557a",indigo80:"#3b3f69",indigo90:"#262a59",indigo100:"#161833",pink0:"#fff3ff",pink10:"#fedafd",pink20:"#fdc0fb",pink30:"#f98ef3",pink40:"#f362e8",pink50:"#ec3ed7",pink60:"#d40fa9",pink70:"#b0027c",pink80:"#990165",pink90:"#820050",pink100:"#390325",cyan0:"#f4ffff",cyan10:"#c6ffff",cyan20:"#96ffff",cyan30:"#59effc",cyan40:"#1dd7f0",cyan50:"#20b0c7",cyan60:"#1d8fa4",cyan70:"#167286",cyan80:"#0e5a6d",cyan90:"#064658",cyan100:"#103645",green0:"#f8fff4",green10:"#e2fccc",green20:"#e2fccc",green30:"#aed581",green40:"#8eaf65",green50:"#728f4b",green60:"#5a7533",green70:"#476020",green80:"#374e10",green90:"#2b3f05",green100:"#223300",red0:"#fff7f4",red10:"#ffe4db",red20:"#fcc4bb",red30:"#efa299",red40:"#e67e78",red50:"#e35656",red60:"#b83d3c",red70:"#922524",red80:"#6f1110",red90:"#500404",red100:"#330000",gray0:"#ffffff",gray10:"#f4f5f7",gray20:"#dfe1e6",gray30:"#c1c7d0",gray40:"#a8afba",gray50:"#9399a3",gray60:"#777c85",gray70:"#575b61",gray80:"#3c3e42",gray90:"#222426",gray100:"#121315"},border:{default:"#dfe1e6"},brand:{darkMatter:"#262a59",titanPink:"#d40fa9",planetBlue:"#1dd7f0",greenEarth:"#aed581"},shadow:{default:"#121315"},text:{base:"#121315",light:"#9399a3",inverted:"#ffffff",link:{default:"#20b0c7",visited:"#1d8fa4"}},utility:{active:"#20b0c7",danger:"#e35656",info:"#262a59",success:"#aed581"}},font:{family:{heading:"'Roboto Condensed', sans-serif",text:"'Source Sans Pro', sans-serif",code:"'Source Code Pro', monospace"},lineHeight:{medium:"1rem",large:"1.5rem",xlarge:"2rem",xxlarge:"3rem"},weight:{normal:400,bold:700}},size:{border:{radius:{default:"6px",small:"4px"},width:"1px"},font:{base:"16px",heading:{default:"1.728rem",small:"1.44rem",xsmall:"1rem"},overline:{large:"1.44rem",default:"0.833rem"},body:{default:"1rem"},caption:{default:"0.833rem",large:"1.44rem"},label:{default:"0.833rem",large:"1.44rem"},minorThird10:"6.192rem",minorThird9:"5.16rem",minorThird8:"4.3rem",minorThird7:"3.583rem",minorThird6:"2.986rem",minorThird5:"2.488rem",minorThird4:"2.074rem",minorThird3:"1.728rem",minorThird2:"1.44rem",minorThird1:"1.2rem",minorThird0:"1rem",minorThirdSub1:"0.833rem",minorThirdSub2:"0.694rem",minorThirdSub3:"0.579rem",minorThirdSub4:"0.482rem",minorThirdSub5:"0.402rem",minorThirdSub6:"0.335rem"},spacingXS:"8px",spacingS:"16px",spacingM:"24px",spacingL:"32px",spacingXL:"40px",spacingXXL:"48px",spacing:{main:"24px",section:"32px",header:"24px",article:"24px",paragraph:"16px",line:"8px",scale1:"1px",scale2:"2px",scale4:"4px",scale6:"6px",scale8:"8px",scale16:"16px",scale24:"24px",scale32:"32px",scale40:"40px",scale48:"48px",scale56:"56px",scale64:"64px",scale72:"72px",scale80:"80px",scale88:"88px",scale96:"96px",scale104:"104px",scale112:"112px",scale120:"120px",scale128:"128px",scale160:"160px",scale208:"208px"}}},y=function(){return y=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},y.apply(this,arguments)};function x(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t}var v={styleOverrides:{root:{fontSize:"12px",fontWeight:600,fontFamily:h.font.family.text,"& .MuiChip-icon":{width:"12px",height:"12px",marginLeft:h.size.spacing.scale8}},colorDefault:{backgroundColor:h.color.gray10,color:h.color.gray60},colorPrimary:{backgroundColor:h.color.indigo10,color:h.color.indigo80},colorSecondary:{backgroundColor:h.color.pink10,color:h.color.pink80},colorError:{backgroundColor:h.color.red10,color:h.color.red50},colorInfo:{backgroundColor:h.color.indigo10,color:h.color.indigo80},colorSuccess:{backgroundColor:h.color.green10,color:h.color.green80}}},k={h1:{fontFamily:h.font.family.heading,fontSize:h.size.font.heading.default,fontWeight:h.font.weight.bold,lineHeight:h.font.lineHeight.xlarge},h2:{fontFamily:h.font.family.heading,fontSize:h.size.font.heading.small,fontWeight:h.font.weight.bold,lineHeight:h.font.lineHeight.xlarge},h3:{fontFamily:h.font.family.heading,fontSize:h.size.font.heading.xsmall,fontWeight:h.font.weight.bold,lineHeight:h.font.lineHeight.large},body1:{fontFamily:h.font.family.text,fontSize:h.size.font.body.default,fontWeight:h.font.weight.normal,lineHeight:h.font.lineHeight.large},body2:{fontFamily:h.font.family.text,fontSize:h.size.font.body.default,fontWeight:h.font.weight.bold,lineHeight:h.font.lineHeight.large},caption:{fontFamily:h.font.family.text,fontSize:h.size.font.caption.default,fontWeight:h.font.weight.normal,lineHeight:h.font.lineHeight.medium},overline:{fontFamily:h.font.family.heading,fontSize:h.size.font.overline.default,letterSpacing:"initial",fontWeight:h.font.weight.bold,color:h.color.gray60}},z={small:"".concat(h.size.spacing.scale4," ").concat(h.size.spacing.scale8),medium:"".concat(h.size.spacing.scale8," ").concat(h.size.spacing.scale16),large:"".concat(h.size.spacing.scale16," ").concat(h.size.spacing.scale32)},S={styleOverrides:{root:{textTransform:"none",lineHeight:h.size.spacing.scale16,fontWeight:h.font.weight.bold,fontFamily:h.font.family.text},contained:{padding:z.medium},containedSizeSmall:{padding:z.small},containedSizeLarge:{padding:z.large},text:{padding:z.medium},textSizeSmall:{padding:z.small},textSizeLarge:{padding:z.large},outlined:{padding:"7px ".concat(h.size.spacing.scale16)},outlinedSizeSmall:{padding:z.small},outlinedSizeLarge:{padding:z.large},sizeSmall:{fontSize:h.size.font.label.default},sizeLarge:{fontSize:h.size.font.label.large},startIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}},endIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}}},defaultProps:{disableFocusRipple:!0},MuiIconButton:{root:{"&&:hover":{backgroundColor:"transparent"}}}},E={styleOverrides:{root:{color:h.color.gray60,backgroundColor:h.color.background.dark},sizeSmall:{padding:"3px"}}},C={styleOverrides:{root:{fontFamily:h.font.family.text,fontSize:h.size.font.label.default,fontWeight:h.font.weight.bold,width:h.size.spacing.scale24,height:h.size.spacing.scale24,"& .MuiSvgIcon-root":{width:h.size.spacing.scale16}},colorDefault:{backgroundColor:h.color.background.dark,"& .MuiSvgIcon-root":{color:h.color.gray60}}}},w={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:h.color.border.default,"& svg":{width:"16px",height:"16px"},"&&:hover":{backgroundColor:"transparent"}},colorPrimary:{"&$checked":{"&&:hover":{backgroundColor:"transparent"}}},colorSecondary:{"&$checked":{color:h.color.brand.darkMatter},"&$disabled":{opacity:.5}}}},F={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:h.color.border.default,"& svg":{width:"16px",height:"16px"},"&:hover":{background:"none"}}}},O={styleOverrides:{root:{marginRight:16},colorSecondary:{color:h.color.gray0,"&$checked":{color:h.color.gray0,left:2,"&:hover":{backgroundColor:"transparent"}},"&$disabled":{color:h.color.gray0}},track:{position:"absolute",width:48,height:24,borderRadius:12,opacity:1,left:"calc(50% - 48px/2)",top:"calc(50% - 24px/2)",backgroundColor:h.color.background.light,border:"2px solid ".concat(h.color.border.default),boxSizing:"border-box","$checked$checked + &":{opacity:1,backgroundColor:h.color.brand.darkMatter,border:"2px solid ".concat(h.color.brand.darkMatter)},"$disabled$disabled + &":{opacity:.5,cursor:"not-allowed"}},thumb:{boxShadow:"none"}}},T={styleOverrides:{outlined:{position:"relative",padding:h.size.spacing.scale8,fontSize:h.size.font.label.default,borderRadius:h.size.spacing.scale6,width:"100%","&.Mui-disabled":{backgroundColor:h.color.background.dark,color:h.color.text.light}}}},M={styleOverrides:{root:{input:{padding:h.size.spacing.scale8,fontSize:h.size.font.label.default,height:h.size.spacing.scale16},"& .MuiInputAdornment-root":{button:{padding:"0 ".concat(h.size.spacing.scale8," 0 0"),backgroundColor:"transparent"},svg:{width:h.size.spacing.scale16,height:h.size.spacing.scale16}}}}},P={styleOverrides:{outlined:{notchedOutline:{borderColor:h.color.border.default}},root:{underline:{"&:before":{borderBottom:"none"},"&:after":{borderBottom:"none"},"&:hover":{borderBottom:"none"},"&&:hover::before":{border:"none"}}}}};h.size.font.body.default,h.font.family.text,h.color.gray100;var L={styleOverrides:{textColorPrimary:{textTransform:"none",minWidth:"auto",fontWeight:700,marginRight:"".concat(h.size.spacing.scale16),fontFamily:h.font.family.text,color:h.color.gray60,padding:"0 0 ".concat(h.size.spacing.scale16," 0"),"&:hover":{color:h.color.brand.darkMatter,opacity:1},"&$selected":{color:h.color.brand.darkMatter},"&:focus":{color:h.color.brand.darkMatter}}},defaultProps:{disableRipple:!0}};h.size.font.caption.default;var B,H,W,I={styleOverrides:{root:{borderBottom:"1px solid ".concat(h.color.gray20)},indicator:{backgroundColor:h.color.brand.darkMatter}}},R={styleOverrides:{root:{fontWeight:h.font.weight.bold,lineHeight:h.font.lineHeight.medium,fontFamily:h.font.family.text,fontSize:h.size.font.caption.default,color:h.color.text.base,marginBottom:h.size.spacing.scale8}}},j=e.createTheme({typography:y({},k),palette:{background:{default:"#ffffff"},primary:{main:h.color.brand.darkMatter},secondary:{main:h.color.brand.titanPink},error:{main:h.color.utility.danger},info:{main:h.color.utility.info},success:{main:h.color.green60}},components:{MuiButton:S,MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0}},MuiContainer:{styleOverrides:{maxWidthLg:{"@media (min-width: 1280px)":{maxWidth:"1185px"}}}},MuiIconButton:E,MuiChip:v,MuiInput:P,MuiTextField:M,MuiFormLabel:R,MuiTabs:I,MuiTab:L,MuiAvatar:C,MuiCheckbox:w,MuiRadio:F,MuiSwitch:O,MuiSelect:T,MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiDivider:{styleOverrides:{root:{margin:"16px 0"}}},MuiFormControl:{styleOverrides:{root:{width:"100%"}}}}}),q=t.styled(e.CircularProgress)(W||(B=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],H=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],Object.defineProperty?Object.defineProperty(B,"raw",{value:H}):B.raw=H,W=B)),$={small:6,medium:8,large:12,fluid:12},A=function(r){var t=x(r,[]);return f.default.createElement(e.Checkbox,y({},t))},G=function(r){return f.default.createElement(e.Radio,y({},r))},N=function(r){return f.default.createElement(e.Switch,y({},r))},X=function(r){return f.default.createElement(e.Select,y({variant:"outlined"},r))},D=function(t){var o=t.type,n=x(t,["type"]),a=r.useState(!1),i=a[0],l=a[1],c=y(y({},n.InputProps),"password"===o&&{endAdornment:f.default.createElement(g.default,{position:"end"},f.default.createElement(p.default,{"aria-label":"toggle password visibility",onClick:function(){return l(!i)},edge:"end"},i?f.default.createElement(m.default,null):f.default.createElement(b.default,null)))});return f.default.createElement(e.TextField,y({},n,{type:i?"text":o,InputProps:c}))};exports.Avatar=function(r){var t=r.icon,o=r.firstName,n=void 0===o?"":o,a=r.lastName,i=void 0===a?"":a,l=x(r,["icon","firstName","lastName"]),c="".concat(n.substring(0,1)).concat(i.substring(0,1)).toLocaleUpperCase(),d=c?h.color.brand.titanPink:h.color.background.dark;return f.default.createElement(e.Avatar,y({sx:y({backgroundColor:d},l.sx)},l),c||t)},exports.Box=function(r){var t=r.children,o=x(r,["children"]);return f.default.createElement(e.Box,y({},o),t)},exports.Button=function(e){var r=e.color,t=void 0===r?"primary":r,o=e.variant,n=void 0===o?"contained":o,a=e.size,i=void 0===a?"medium":a,l=e.loading,c=e.children,d=x(e,["color","variant","size","loading","children"]);return f.default.createElement(s.default,y({size:i,variant:n,color:t,disabled:l},d),f.default.createElement("span",{style:{opacity:l?0:1}},c),l&&f.default.createElement(q,{size:20,color:"inherit"}))},exports.Checkbox=A,exports.Chip=function(r){var t=r.label,o=x(r,["label"]);return f.default.createElement(e.Chip,y({size:"small",label:t},o))},exports.Container=function(r){var t=r.component,o=void 0===t?"div":t,n=r.size,a=void 0===n?"large":n,i=r.children,l=x(r,["component","size","children"]),c="fluid"===a;return f.default.createElement(e.Container,y({component:o,disableGutters:c,maxWidth:!c&&"lg",sx:y({display:"flex",justifyContent:"center"},l.sx)},l),f.default.createElement(e.Grid,{container:!0,justifyContent:"center"},f.default.createElement(e.Grid,{item:!0,md:$[a]},i)))},exports.FormCheckbox=function(r){var t=r.id,o=r.required,n=void 0===o||o,a=r.data,i=r.label,l=r.error,c=r.helperText;return f.default.createElement(e.FormControl,null,f.default.createElement(e.FormLabel,{component:"label",error:l},i," ",n?"":f.default.createElement(e.Box,{component:"span",sx:{fontWeight:h.font.weight.normal,color:h.color.text.light}},"(optional)")),f.default.createElement(e.FormGroup,null,a.map((function(r,o){var n=r.value,a=r.label;return f.default.createElement(e.FormControlLabel,{key:o,value:n,label:a||"",sx:{fontSize:h.size.font.base,color:h.color.text.base},control:f.default.createElement(A,{color:"primary",inputProps:{"data-testid":"".concat(t,"-").concat(o)}})})}))),l&&f.default.createElement(e.FormHelperText,{sx:{marginLeft:0,marginRight:0},error:l},c))},exports.FormInput=function(r){var t=r.id,o=r.required,n=void 0===o||o,a=r.label,i=r.error,l=r.helperText,c=x(r,["id","required","label","error","helperText"]);return f.default.createElement(e.FormControl,null,f.default.createElement(e.FormLabel,{component:"label",error:i},a," ",!n&&f.default.createElement(e.Box,{component:"span",sx:{fontWeight:h.font.weight.normal,color:h.color.text.light}},"(optional)")),f.default.createElement(D,y({},c,{id:t,error:i,inputProps:{"data-testid":t}})),i&&f.default.createElement(e.FormHelperText,{sx:{marginLeft:0,marginRight:0},error:i},l))},exports.FormRadio=function(r){var t=r.id,o=r.helperText,n=r.label,a=r.error,i=r.required,l=void 0===i||i,c=r.name,d=r.data;return f.default.createElement(e.FormControl,{component:"fieldset",error:a},f.default.createElement(e.FormLabel,{component:"legend"},n," ",l?"":f.default.createElement(e.Box,{component:"span",sx:{fontWeight:h.font.weight.normal,color:h.color.text.light}},"(optional)")),f.default.createElement(e.RadioGroup,{"aria-label":c,name:c},d.map((function(r,o){var n=r.value,a=r.label;return f.default.createElement(e.FormControlLabel,{value:n,key:n,label:a||"",sx:{fontSize:h.size.font.base,color:h.color.text.base},control:f.default.createElement(G,{color:"primary",inputProps:{"data-testid":"".concat(t,"-").concat(o)}})})}))),a&&f.default.createElement(e.FormHelperText,{sx:{marginLeft:0,marginRight:0}},o))},exports.FormSelect=function(r){var t=r.id,o=r.required,n=void 0===o||o,a=r.options,i=r.label,l=r.error,c=r.placeholder,d=r.helperText;return f.default.createElement(e.FormControl,null,f.default.createElement(e.FormLabel,{component:"label",error:l},i," ",n?"":f.default.createElement(e.Box,{component:"span",sx:{fontWeight:h.font.weight.normal,color:h.color.text.light}},"(optional)")),f.default.createElement(X,{id:t,placeholder:c,error:l},a.map((function(r){return f.default.createElement(e.MenuItem,{key:r.value,value:r.value},r.text)}))),l&&f.default.createElement(e.FormHelperText,{sx:{marginLeft:0,marginRight:0},error:l},d))},exports.FormSwitch=function(r){var t=r.id,o=r.label,n=r.checked;return f.default.createElement(e.FormControl,null,f.default.createElement(e.FormLabel,{component:"label"},o),f.default.createElement(e.FormControlLabel,{control:f.default.createElement(N,{id:t}),label:"".concat(n?"Active":"Inactive")}))},exports.Input=D,exports.Link=function(r){var t=r.children,o=x(r,["children"]);return f.default.createElement(e.Link,y({underline:"hover",variant:"caption",component:"span"},o),t)},exports.Radio=G,exports.Select=X,exports.Switch=N,exports.Typography=function(e){var r=e.children,t=x(e,["children"]);return f.default.createElement(u.default,y({},t),r)},exports.UpComponentsProvider=function(r){return f.default.createElement(f.default.Fragment,null,f.default.createElement(e.CssBaseline,null),f.default.createElement(t.ThemeProvider,{theme:j},r.children))},exports.theme=j,exports.tokens=h,Object.keys(e).forEach((function(r){"default"===r||exports.hasOwnProperty(r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})}));
|
package/dist/esm/index.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
|
-
import e from"@up42/design-system-tokens/dist/json/tokens.json";export{default as tokens}from"@up42/design-system-tokens/dist/json/tokens.json";import{createTheme as t,CssBaseline as o,CircularProgress as r,Chip as n,Avatar as i,Container as a,Grid as l,Box as c,Checkbox as d,FormControl as s,FormLabel as m,FormGroup as g,FormControlLabel as u,FormHelperText as f,Radio as p,RadioGroup as h,Switch as b,Select as y,MenuItem as v,TextField as x,Link as z}from"@mui/material";export*from"@mui/material";import k,{useState as E}from"react";import{ThemeProvider as S,styled as w}from"@mui/material/styles";import O from"@mui/material/Button";import C from"@mui/material/Typography";import M from"@mui/material/InputAdornment";import W from"@mui/material/IconButton";import P from"@mui/icons-material/VisibilityOutlined";import F from"@mui/icons-material/VisibilityOffOutlined";
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var j=function(){return j=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},j.apply(this,arguments)};function B(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(o[r[n]]=e[r[n]])}return o}var H={styleOverrides:{root:{fontSize:"12px",fontWeight:600,fontFamily:e.font.family.text,"& .MuiChip-icon":{width:"12px",height:"12px",marginLeft:e.size.spacing.scale8}},colorDefault:{backgroundColor:e.color.gray10,color:e.color.gray60},colorPrimary:{backgroundColor:e.color.indigo10,color:e.color.indigo80},colorSecondary:{backgroundColor:e.color.pink10,color:e.color.pink80},colorError:{backgroundColor:e.color.red10,color:e.color.red50},colorInfo:{backgroundColor:e.color.indigo10,color:e.color.indigo80},colorSuccess:{backgroundColor:e.color.green10,color:e.color.green80}}},I={h1:{fontFamily:e.font.family.heading,fontSize:e.size.font.heading.default,fontWeight:e.font.weight.bold,lineHeight:e.font.lineHeight.xlarge},h2:{fontFamily:e.font.family.heading,fontSize:e.size.font.heading.small,fontWeight:e.font.weight.bold,lineHeight:e.font.lineHeight.xlarge},h3:{fontFamily:e.font.family.heading,fontSize:e.size.font.heading.xsmall,fontWeight:e.font.weight.bold,lineHeight:e.font.lineHeight.large},body1:{fontFamily:e.font.family.text,fontSize:e.size.font.body.default,fontWeight:e.font.weight.normal,lineHeight:e.font.lineHeight.large},body2:{fontFamily:e.font.family.text,fontSize:e.size.font.body.default,fontWeight:e.font.weight.bold,lineHeight:e.font.lineHeight.large},caption:{fontFamily:e.font.family.text,fontSize:e.size.font.caption.default,fontWeight:e.font.weight.normal,lineHeight:e.font.lineHeight.medium},overline:{fontFamily:e.font.family.heading,fontSize:e.size.font.overline.default,letterSpacing:"initial",fontWeight:e.font.weight.bold,color:e.color.gray60}},L={small:"".concat(e.size.spacing.scale4," ").concat(e.size.spacing.scale8),medium:"".concat(e.size.spacing.scale8," ").concat(e.size.spacing.scale16),large:"".concat(e.size.spacing.scale16," ").concat(e.size.spacing.scale32)},R={styleOverrides:{root:{textTransform:"none",lineHeight:e.size.spacing.scale16,fontWeight:e.font.weight.bold,fontFamily:e.font.family.text},contained:{padding:L.medium},containedSizeSmall:{padding:L.small},containedSizeLarge:{padding:L.large},text:{padding:L.medium},textSizeSmall:{padding:L.small},textSizeLarge:{padding:L.large},outlined:{padding:"7px ".concat(e.size.spacing.scale16)},outlinedSizeSmall:{padding:L.small},outlinedSizeLarge:{padding:L.large},sizeSmall:{fontSize:e.size.font.label.default},sizeLarge:{fontSize:e.size.font.label.large},startIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}},endIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}}},defaultProps:{disableFocusRipple:!0},MuiIconButton:{root:{"&&:hover":{backgroundColor:"transparent"}}}},T={styleOverrides:{root:{color:e.color.gray60,backgroundColor:e.color.background.dark},sizeSmall:{padding:"3px"}}},$={styleOverrides:{root:{fontFamily:e.font.family.text,fontSize:e.size.font.label.default,fontWeight:e.font.weight.bold,width:e.size.spacing.scale24,height:e.size.spacing.scale24,"& .MuiSvgIcon-root":{width:e.size.spacing.scale16}},colorDefault:{backgroundColor:e.color.background.dark,"& .MuiSvgIcon-root":{color:e.color.gray60}}}},A={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:e.color.border.default,"& svg":{width:"16px",height:"16px"},"&&:hover":{backgroundColor:"transparent"}},colorPrimary:{"&$checked":{"&&:hover":{backgroundColor:"transparent"}}},colorSecondary:{"&$checked":{color:e.color.brand.darkMatter},"&$disabled":{opacity:.5}}}},q={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:e.color.border.default,"& svg":{width:"16px",height:"16px"},"&:hover":{background:"none"}}}},N={styleOverrides:{root:{marginRight:16},colorSecondary:{color:e.color.gray0,"&$checked":{color:e.color.gray0,left:2,"&:hover":{backgroundColor:"transparent"}},"&$disabled":{color:e.color.gray0}},track:{position:"absolute",width:48,height:24,borderRadius:12,opacity:1,left:"calc(50% - 48px/2)",top:"calc(50% - 24px/2)",backgroundColor:e.color.background.light,border:"2px solid ".concat(e.color.border.default),boxSizing:"border-box","$checked$checked + &":{opacity:1,backgroundColor:e.color.brand.darkMatter,border:"2px solid ".concat(e.color.brand.darkMatter)},"$disabled$disabled + &":{opacity:.5,cursor:"not-allowed"}},thumb:{boxShadow:"none"}}},D={styleOverrides:{outlined:{position:"relative",padding:e.size.spacing.scale8,fontSize:e.size.font.label.default,borderRadius:e.size.spacing.scale6,width:"100%","&.Mui-disabled":{backgroundColor:e.color.background.dark,color:e.color.text.light}}}},V={styleOverrides:{root:{input:{padding:e.size.spacing.scale8,fontSize:e.size.font.label.default,height:e.size.spacing.scale16},"& .MuiInputAdornment-root":{button:{padding:"0 ".concat(e.size.spacing.scale8," 0 0"),backgroundColor:"transparent"},svg:{width:e.size.spacing.scale16,height:e.size.spacing.scale16}}}}},G={styleOverrides:{outlined:{notchedOutline:{borderColor:e.color.border.default}},root:{underline:{"&:before":{borderBottom:"none"},"&:after":{borderBottom:"none"},"&:hover":{borderBottom:"none"},"&&:hover::before":{border:"none"}}}}};e.size.font.body.default,e.font.family.text,e.color.gray100;var U={styleOverrides:{textColorPrimary:{textTransform:"none",minWidth:"auto",fontWeight:700,marginRight:"".concat(e.size.spacing.scale16),fontFamily:e.font.family.text,color:e.color.gray60,padding:"0 0 ".concat(e.size.spacing.scale16," 0"),"&:hover":{color:e.color.brand.darkMatter,opacity:1},"&$selected":{color:e.color.brand.darkMatter},"&:focus":{color:e.color.brand.darkMatter}}},defaultProps:{disableRipple:!0}};e.size.font.caption.default;var J,K,Q,X={styleOverrides:{root:{borderBottom:"1px solid ".concat(e.color.gray20)},indicator:{backgroundColor:e.color.brand.darkMatter}}},Y={styleOverrides:{root:{fontWeight:e.font.weight.bold,lineHeight:e.font.lineHeight.medium,fontFamily:e.font.family.text,fontSize:e.size.font.caption.default,color:e.color.text.base,marginBottom:e.size.spacing.scale8}}},Z=t({typography:j({},I),palette:{background:{default:"#ffffff"},primary:{main:e.color.brand.darkMatter},secondary:{main:e.color.brand.titanPink},error:{main:e.color.utility.danger},info:{main:e.color.utility.info},success:{main:e.color.green60}},components:{MuiButton:R,MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0}},MuiContainer:{styleOverrides:{maxWidthLg:{"@media (min-width: 1280px)":{maxWidth:"1185px"}}}},MuiIconButton:T,MuiChip:H,MuiInput:G,MuiTextField:V,MuiFormLabel:Y,MuiTabs:X,MuiTab:U,MuiAvatar:$,MuiCheckbox:A,MuiRadio:q,MuiSwitch:N,MuiSelect:D,MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiDivider:{styleOverrides:{root:{margin:"16px 0"}}},MuiFormControl:{styleOverrides:{root:{width:"100%"}}}}}),_=function(e){return k.createElement(k.Fragment,null,k.createElement(o,null),k.createElement(S,{theme:Z},e.children))},ee=w(r)(Q||(J=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],K=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],Object.defineProperty?Object.defineProperty(J,"raw",{value:K}):J.raw=K,Q=J)),te=function(e){var t=e.color,o=void 0===t?"primary":t,r=e.variant,n=void 0===r?"contained":r,i=e.size,a=void 0===i?"medium":i,l=e.loading,c=e.children,d=B(e,["color","variant","size","loading","children"]);return k.createElement(O,j({size:a,variant:n,color:o,disabled:l},d),k.createElement("span",{style:{opacity:l?0:1}},c),l&&k.createElement(ee,{size:20,color:"inherit"}))},oe=function(e){var t=e.children,o=B(e,["children"]);return k.createElement(C,j({},o),t)},re=function(e){var t=e.label,o=B(e,["label"]);return k.createElement(n,j({size:"small",label:t},o))},ne=function(t){var o=t.icon,r=t.firstName,n=void 0===r?"":r,a=t.lastName,l=void 0===a?"":a,c=B(t,["icon","firstName","lastName"]),d="".concat(n.substring(0,1)).concat(l.substring(0,1)).toLocaleUpperCase(),s=d?e.color.brand.titanPink:e.color.background.dark;return k.createElement(i,j({sx:j({backgroundColor:s},c.sx)},c),d||o)},ie={small:6,medium:8,large:12,fluid:12},ae=function(e){var t=e.component,o=void 0===t?"div":t,r=e.size,n=void 0===r?"large":r,i=e.children,c=B(e,["component","size","children"]),d="fluid"===n;return k.createElement(a,j({component:o,disableGutters:d,maxWidth:!d&&"lg",sx:j({display:"flex",justifyContent:"center"},c.sx)},c),k.createElement(l,{container:!0,justifyContent:"center"},k.createElement(l,{item:!0,md:ie[n]},i)))},le=function(e){var t=e.children,o=B(e,["children"]);return k.createElement(c,j({},o),t)},ce=function(e){var t=B(e,[]);return k.createElement(d,j({},t))},de=function(t){var o=t.id,r=t.required,n=void 0===r||r,i=t.data,a=t.label,l=t.error,d=t.helperText;return k.createElement(s,null,k.createElement(m,{component:"label",error:l},a," ",n?"":k.createElement(c,{component:"span",sx:{fontWeight:e.font.weight.normal,color:e.color.text.light}},"(optional)")),k.createElement(g,null,i.map((function(t,r){var n=t.value,i=t.label;return k.createElement(u,{key:r,value:n,label:i||"",sx:{fontSize:e.size.font.base,color:e.color.text.base},control:k.createElement(ce,{color:"primary",inputProps:{"data-testid":"".concat(o,"-").concat(r)}})})}))),l&&k.createElement(f,{sx:{marginLeft:0,marginRight:0},error:l},d))},se=function(e){return k.createElement(p,j({},e))},me=function(t){var o=t.id,r=t.helperText,n=t.label,i=t.error,a=t.required,l=void 0===a||a,d=t.name,g=t.data;return k.createElement(s,{component:"fieldset",error:i},k.createElement(m,{component:"legend"},n," ",l?"":k.createElement(c,{component:"span",sx:{fontWeight:e.font.weight.normal,color:e.color.text.light}},"(optional)")),k.createElement(h,{"aria-label":d,name:d},g.map((function(t,r){var n=t.value,i=t.label;return k.createElement(u,{value:n,key:n,label:i||"",sx:{fontSize:e.size.font.base,color:e.color.text.base},control:k.createElement(se,{color:"primary",inputProps:{"data-testid":"".concat(o,"-").concat(r)}})})}))),i&&k.createElement(f,{sx:{marginLeft:0,marginRight:0}},r))},ge=function(e){return k.createElement(b,j({},e))},ue=function(e){var t=e.id,o=e.label,r=e.checked;return k.createElement(s,null,k.createElement(m,{component:"label"},o),k.createElement(u,{control:k.createElement(ge,{id:t}),label:"".concat(r?"Active":"Inactive")}))},fe=function(e){return k.createElement(y,j({variant:"outlined"},e))},pe=function(t){var o=t.id,r=t.required,n=void 0===r||r,i=t.options,a=t.label,l=t.error,d=t.placeholder,g=t.helperText;return k.createElement(s,null,k.createElement(m,{component:"label",error:l},a," ",n?"":k.createElement(c,{component:"span",sx:{fontWeight:e.font.weight.normal,color:e.color.text.light}},"(optional)")),k.createElement(fe,{id:o,placeholder:d,error:l},i.map((function(e){return k.createElement(v,{key:e.value,value:e.value},e.text)}))),l&&k.createElement(f,{sx:{marginLeft:0,marginRight:0},error:l},g))},he=function(e){var t=e.type,o=B(e,["type"]),r=E(!1),n=r[0],i=r[1],a=j(j({},o.InputProps),"password"===t&&{endAdornment:k.createElement(M,{position:"end"},k.createElement(W,{"aria-label":"toggle password visibility",onClick:function(){return i(!n)},edge:"end"},n?k.createElement(P,null):k.createElement(F,null)))});return k.createElement(x,j({},o,{type:n?"text":t,InputProps:a}))},be=function(t){var o=t.id,r=t.required,n=void 0===r||r,i=t.label,a=t.error,l=t.helperText,d=B(t,["id","required","label","error","helperText"]);return k.createElement(s,null,k.createElement(m,{component:"label",error:a},i," ",!n&&k.createElement(c,{component:"span",sx:{fontWeight:e.font.weight.normal,color:e.color.text.light}},"(optional)")),k.createElement(he,j({},d,{id:o,error:a,inputProps:{"data-testid":o}})),a&&k.createElement(f,{sx:{marginLeft:0,marginRight:0},error:a},l))},ye=function(e){var t=e.children,o=B(e,["children"]);return k.createElement(z,j({underline:"hover",variant:"caption",component:"span"},o),t)};export{ne as Avatar,le as Box,te as Button,ce as Checkbox,re as Chip,ae as Container,de as FormCheckbox,be as FormInput,me as FormRadio,pe as FormSelect,ue as FormSwitch,he as Input,ye as Link,se as Radio,fe as Select,ge as Switch,oe as Typography,_ as UpComponentsProvider,Z as theme};
|
|
1
|
+
import{createTheme as e,CssBaseline as r,CircularProgress as o,Chip as t,Avatar as n,Container as a,Grid as i,Box as l,Checkbox as c,FormControl as d,FormLabel as f,FormGroup as s,FormControlLabel as g,FormHelperText as m,Radio as p,RadioGroup as u,Switch as h,Select as b,MenuItem as y,TextField as x,Link as v}from"@mui/material";export*from"@mui/material";import k,{useState as z}from"react";import{ThemeProvider as E,styled as S}from"@mui/material/styles";import w from"@mui/material/Button";import C from"@mui/material/Typography";import O from"@mui/material/InputAdornment";import M from"@mui/material/IconButton";import T from"@mui/icons-material/VisibilityOutlined";import P from"@mui/icons-material/VisibilityOffOutlined";var W={animation:{speed:{normal:"0.5s",fast:"0.08s",slow:"1s"}},color:{background:{light:"#f4f5f7",dark:"#dfe1e6",indigo:"#262a59"},indigo0:"#f4f4f6",indigo10:"#e9e9ee",indigo20:"#bdbfcd",indigo30:"#a8aabd",indigo40:"#9294ac",indigo50:"#7d7f9b",indigo60:"#67698a",indigo70:"#51557a",indigo80:"#3b3f69",indigo90:"#262a59",indigo100:"#161833",pink0:"#fff3ff",pink10:"#fedafd",pink20:"#fdc0fb",pink30:"#f98ef3",pink40:"#f362e8",pink50:"#ec3ed7",pink60:"#d40fa9",pink70:"#b0027c",pink80:"#990165",pink90:"#820050",pink100:"#390325",cyan0:"#f4ffff",cyan10:"#c6ffff",cyan20:"#96ffff",cyan30:"#59effc",cyan40:"#1dd7f0",cyan50:"#20b0c7",cyan60:"#1d8fa4",cyan70:"#167286",cyan80:"#0e5a6d",cyan90:"#064658",cyan100:"#103645",green0:"#f8fff4",green10:"#e2fccc",green20:"#e2fccc",green30:"#aed581",green40:"#8eaf65",green50:"#728f4b",green60:"#5a7533",green70:"#476020",green80:"#374e10",green90:"#2b3f05",green100:"#223300",red0:"#fff7f4",red10:"#ffe4db",red20:"#fcc4bb",red30:"#efa299",red40:"#e67e78",red50:"#e35656",red60:"#b83d3c",red70:"#922524",red80:"#6f1110",red90:"#500404",red100:"#330000",gray0:"#ffffff",gray10:"#f4f5f7",gray20:"#dfe1e6",gray30:"#c1c7d0",gray40:"#a8afba",gray50:"#9399a3",gray60:"#777c85",gray70:"#575b61",gray80:"#3c3e42",gray90:"#222426",gray100:"#121315",base:{indigo0:"#f4f4f6",indigo10:"#e9e9ee",indigo20:"#bdbfcd",indigo30:"#a8aabd",indigo40:"#9294ac",indigo50:"#7d7f9b",indigo60:"#67698a",indigo70:"#51557a",indigo80:"#3b3f69",indigo90:"#262a59",indigo100:"#161833",pink0:"#fff3ff",pink10:"#fedafd",pink20:"#fdc0fb",pink30:"#f98ef3",pink40:"#f362e8",pink50:"#ec3ed7",pink60:"#d40fa9",pink70:"#b0027c",pink80:"#990165",pink90:"#820050",pink100:"#390325",cyan0:"#f4ffff",cyan10:"#c6ffff",cyan20:"#96ffff",cyan30:"#59effc",cyan40:"#1dd7f0",cyan50:"#20b0c7",cyan60:"#1d8fa4",cyan70:"#167286",cyan80:"#0e5a6d",cyan90:"#064658",cyan100:"#103645",green0:"#f8fff4",green10:"#e2fccc",green20:"#e2fccc",green30:"#aed581",green40:"#8eaf65",green50:"#728f4b",green60:"#5a7533",green70:"#476020",green80:"#374e10",green90:"#2b3f05",green100:"#223300",red0:"#fff7f4",red10:"#ffe4db",red20:"#fcc4bb",red30:"#efa299",red40:"#e67e78",red50:"#e35656",red60:"#b83d3c",red70:"#922524",red80:"#6f1110",red90:"#500404",red100:"#330000",gray0:"#ffffff",gray10:"#f4f5f7",gray20:"#dfe1e6",gray30:"#c1c7d0",gray40:"#a8afba",gray50:"#9399a3",gray60:"#777c85",gray70:"#575b61",gray80:"#3c3e42",gray90:"#222426",gray100:"#121315"},border:{default:"#dfe1e6"},brand:{darkMatter:"#262a59",titanPink:"#d40fa9",planetBlue:"#1dd7f0",greenEarth:"#aed581"},shadow:{default:"#121315"},text:{base:"#121315",light:"#9399a3",inverted:"#ffffff",link:{default:"#20b0c7",visited:"#1d8fa4"}},utility:{active:"#20b0c7",danger:"#e35656",info:"#262a59",success:"#aed581"}},font:{family:{heading:"'Roboto Condensed', sans-serif",text:"'Source Sans Pro', sans-serif",code:"'Source Code Pro', monospace"},lineHeight:{medium:"1rem",large:"1.5rem",xlarge:"2rem",xxlarge:"3rem"},weight:{normal:400,bold:700}},size:{border:{radius:{default:"6px",small:"4px"},width:"1px"},font:{base:"16px",heading:{default:"1.728rem",small:"1.44rem",xsmall:"1rem"},overline:{large:"1.44rem",default:"0.833rem"},body:{default:"1rem"},caption:{default:"0.833rem",large:"1.44rem"},label:{default:"0.833rem",large:"1.44rem"},minorThird10:"6.192rem",minorThird9:"5.16rem",minorThird8:"4.3rem",minorThird7:"3.583rem",minorThird6:"2.986rem",minorThird5:"2.488rem",minorThird4:"2.074rem",minorThird3:"1.728rem",minorThird2:"1.44rem",minorThird1:"1.2rem",minorThird0:"1rem",minorThirdSub1:"0.833rem",minorThirdSub2:"0.694rem",minorThirdSub3:"0.579rem",minorThirdSub4:"0.482rem",minorThirdSub5:"0.402rem",minorThirdSub6:"0.335rem"},spacingXS:"8px",spacingS:"16px",spacingM:"24px",spacingL:"32px",spacingXL:"40px",spacingXXL:"48px",spacing:{main:"24px",section:"32px",header:"24px",article:"24px",paragraph:"16px",line:"8px",scale1:"1px",scale2:"2px",scale4:"4px",scale6:"6px",scale8:"8px",scale16:"16px",scale24:"24px",scale32:"32px",scale40:"40px",scale48:"48px",scale56:"56px",scale64:"64px",scale72:"72px",scale80:"80px",scale88:"88px",scale96:"96px",scale104:"104px",scale112:"112px",scale120:"120px",scale128:"128px",scale160:"160px",scale208:"208px"}}},F=function(){return F=Object.assign||function(e){for(var r,o=1,t=arguments.length;o<t;o++)for(var n in r=arguments[o])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},F.apply(this,arguments)};function L(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o}var B={styleOverrides:{root:{fontSize:"12px",fontWeight:600,fontFamily:W.font.family.text,"& .MuiChip-icon":{width:"12px",height:"12px",marginLeft:W.size.spacing.scale8}},colorDefault:{backgroundColor:W.color.gray10,color:W.color.gray60},colorPrimary:{backgroundColor:W.color.indigo10,color:W.color.indigo80},colorSecondary:{backgroundColor:W.color.pink10,color:W.color.pink80},colorError:{backgroundColor:W.color.red10,color:W.color.red50},colorInfo:{backgroundColor:W.color.indigo10,color:W.color.indigo80},colorSuccess:{backgroundColor:W.color.green10,color:W.color.green80}}},H={h1:{fontFamily:W.font.family.heading,fontSize:W.size.font.heading.default,fontWeight:W.font.weight.bold,lineHeight:W.font.lineHeight.xlarge},h2:{fontFamily:W.font.family.heading,fontSize:W.size.font.heading.small,fontWeight:W.font.weight.bold,lineHeight:W.font.lineHeight.xlarge},h3:{fontFamily:W.font.family.heading,fontSize:W.size.font.heading.xsmall,fontWeight:W.font.weight.bold,lineHeight:W.font.lineHeight.large},body1:{fontFamily:W.font.family.text,fontSize:W.size.font.body.default,fontWeight:W.font.weight.normal,lineHeight:W.font.lineHeight.large},body2:{fontFamily:W.font.family.text,fontSize:W.size.font.body.default,fontWeight:W.font.weight.bold,lineHeight:W.font.lineHeight.large},caption:{fontFamily:W.font.family.text,fontSize:W.size.font.caption.default,fontWeight:W.font.weight.normal,lineHeight:W.font.lineHeight.medium},overline:{fontFamily:W.font.family.heading,fontSize:W.size.font.overline.default,letterSpacing:"initial",fontWeight:W.font.weight.bold,color:W.color.gray60}},I={small:"".concat(W.size.spacing.scale4," ").concat(W.size.spacing.scale8),medium:"".concat(W.size.spacing.scale8," ").concat(W.size.spacing.scale16),large:"".concat(W.size.spacing.scale16," ").concat(W.size.spacing.scale32)},R={styleOverrides:{root:{textTransform:"none",lineHeight:W.size.spacing.scale16,fontWeight:W.font.weight.bold,fontFamily:W.font.family.text},contained:{padding:I.medium},containedSizeSmall:{padding:I.small},containedSizeLarge:{padding:I.large},text:{padding:I.medium},textSizeSmall:{padding:I.small},textSizeLarge:{padding:I.large},outlined:{padding:"7px ".concat(W.size.spacing.scale16)},outlinedSizeSmall:{padding:I.small},outlinedSizeLarge:{padding:I.large},sizeSmall:{fontSize:W.size.font.label.default},sizeLarge:{fontSize:W.size.font.label.large},startIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}},endIcon:{"& svg":{fill:"currentColor",width:"12px",height:"12px"}}},defaultProps:{disableFocusRipple:!0},MuiIconButton:{root:{"&&:hover":{backgroundColor:"transparent"}}}},j={styleOverrides:{root:{color:W.color.gray60,backgroundColor:W.color.background.dark},sizeSmall:{padding:"3px"}}},$={styleOverrides:{root:{fontFamily:W.font.family.text,fontSize:W.size.font.label.default,fontWeight:W.font.weight.bold,width:W.size.spacing.scale24,height:W.size.spacing.scale24,"& .MuiSvgIcon-root":{width:W.size.spacing.scale16}},colorDefault:{backgroundColor:W.color.background.dark,"& .MuiSvgIcon-root":{color:W.color.gray60}}}},A={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:W.color.border.default,"& svg":{width:"16px",height:"16px"},"&&:hover":{backgroundColor:"transparent"}},colorPrimary:{"&$checked":{"&&:hover":{backgroundColor:"transparent"}}},colorSecondary:{"&$checked":{color:W.color.brand.darkMatter},"&$disabled":{opacity:.5}}}},q={styleOverrides:{root:{paddingTop:4,paddingBottom:4,color:W.color.border.default,"& svg":{width:"16px",height:"16px"},"&:hover":{background:"none"}}}},N={styleOverrides:{root:{marginRight:16},colorSecondary:{color:W.color.gray0,"&$checked":{color:W.color.gray0,left:2,"&:hover":{backgroundColor:"transparent"}},"&$disabled":{color:W.color.gray0}},track:{position:"absolute",width:48,height:24,borderRadius:12,opacity:1,left:"calc(50% - 48px/2)",top:"calc(50% - 24px/2)",backgroundColor:W.color.background.light,border:"2px solid ".concat(W.color.border.default),boxSizing:"border-box","$checked$checked + &":{opacity:1,backgroundColor:W.color.brand.darkMatter,border:"2px solid ".concat(W.color.brand.darkMatter)},"$disabled$disabled + &":{opacity:.5,cursor:"not-allowed"}},thumb:{boxShadow:"none"}}},X={styleOverrides:{outlined:{position:"relative",padding:W.size.spacing.scale8,fontSize:W.size.font.label.default,borderRadius:W.size.spacing.scale6,width:"100%","&.Mui-disabled":{backgroundColor:W.color.background.dark,color:W.color.text.light}}}},D={styleOverrides:{root:{input:{padding:W.size.spacing.scale8,fontSize:W.size.font.label.default,height:W.size.spacing.scale16},"& .MuiInputAdornment-root":{button:{padding:"0 ".concat(W.size.spacing.scale8," 0 0"),backgroundColor:"transparent"},svg:{width:W.size.spacing.scale16,height:W.size.spacing.scale16}}}}},V={styleOverrides:{outlined:{notchedOutline:{borderColor:W.color.border.default}},root:{underline:{"&:before":{borderBottom:"none"},"&:after":{borderBottom:"none"},"&:hover":{borderBottom:"none"},"&&:hover::before":{border:"none"}}}}};W.size.font.body.default,W.font.family.text,W.color.gray100;var G={styleOverrides:{textColorPrimary:{textTransform:"none",minWidth:"auto",fontWeight:700,marginRight:"".concat(W.size.spacing.scale16),fontFamily:W.font.family.text,color:W.color.gray60,padding:"0 0 ".concat(W.size.spacing.scale16," 0"),"&:hover":{color:W.color.brand.darkMatter,opacity:1},"&$selected":{color:W.color.brand.darkMatter},"&:focus":{color:W.color.brand.darkMatter}}},defaultProps:{disableRipple:!0}};W.size.font.caption.default;var U,J,K,Q={styleOverrides:{root:{borderBottom:"1px solid ".concat(W.color.gray20)},indicator:{backgroundColor:W.color.brand.darkMatter}}},Y={styleOverrides:{root:{fontWeight:W.font.weight.bold,lineHeight:W.font.lineHeight.medium,fontFamily:W.font.family.text,fontSize:W.size.font.caption.default,color:W.color.text.base,marginBottom:W.size.spacing.scale8}}},Z=e({typography:F({},H),palette:{background:{default:"#ffffff"},primary:{main:W.color.brand.darkMatter},secondary:{main:W.color.brand.titanPink},error:{main:W.color.utility.danger},info:{main:W.color.utility.info},success:{main:W.color.green60}},components:{MuiButton:R,MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0}},MuiContainer:{styleOverrides:{maxWidthLg:{"@media (min-width: 1280px)":{maxWidth:"1185px"}}}},MuiIconButton:j,MuiChip:B,MuiInput:V,MuiTextField:D,MuiFormLabel:Y,MuiTabs:Q,MuiTab:G,MuiAvatar:$,MuiCheckbox:A,MuiRadio:q,MuiSwitch:N,MuiSelect:X,MuiLink:{styleOverrides:{root:{cursor:"pointer"}}},MuiDivider:{styleOverrides:{root:{margin:"16px 0"}}},MuiFormControl:{styleOverrides:{root:{width:"100%"}}}}}),_=function(e){return k.createElement(k.Fragment,null,k.createElement(r,null),k.createElement(E,{theme:Z},e.children))},ee=S(o)(K||(U=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],J=["\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n"],Object.defineProperty?Object.defineProperty(U,"raw",{value:J}):U.raw=J,K=U)),re=function(e){var r=e.color,o=void 0===r?"primary":r,t=e.variant,n=void 0===t?"contained":t,a=e.size,i=void 0===a?"medium":a,l=e.loading,c=e.children,d=L(e,["color","variant","size","loading","children"]);return k.createElement(w,F({size:i,variant:n,color:o,disabled:l},d),k.createElement("span",{style:{opacity:l?0:1}},c),l&&k.createElement(ee,{size:20,color:"inherit"}))},oe=function(e){var r=e.children,o=L(e,["children"]);return k.createElement(C,F({},o),r)},te=function(e){var r=e.label,o=L(e,["label"]);return k.createElement(t,F({size:"small",label:r},o))},ne=function(e){var r=e.icon,o=e.firstName,t=void 0===o?"":o,a=e.lastName,i=void 0===a?"":a,l=L(e,["icon","firstName","lastName"]),c="".concat(t.substring(0,1)).concat(i.substring(0,1)).toLocaleUpperCase(),d=c?W.color.brand.titanPink:W.color.background.dark;return k.createElement(n,F({sx:F({backgroundColor:d},l.sx)},l),c||r)},ae={small:6,medium:8,large:12,fluid:12},ie=function(e){var r=e.component,o=void 0===r?"div":r,t=e.size,n=void 0===t?"large":t,l=e.children,c=L(e,["component","size","children"]),d="fluid"===n;return k.createElement(a,F({component:o,disableGutters:d,maxWidth:!d&&"lg",sx:F({display:"flex",justifyContent:"center"},c.sx)},c),k.createElement(i,{container:!0,justifyContent:"center"},k.createElement(i,{item:!0,md:ae[n]},l)))},le=function(e){var r=e.children,o=L(e,["children"]);return k.createElement(l,F({},o),r)},ce=function(e){var r=L(e,[]);return k.createElement(c,F({},r))},de=function(e){var r=e.id,o=e.required,t=void 0===o||o,n=e.data,a=e.label,i=e.error,c=e.helperText;return k.createElement(d,null,k.createElement(f,{component:"label",error:i},a," ",t?"":k.createElement(l,{component:"span",sx:{fontWeight:W.font.weight.normal,color:W.color.text.light}},"(optional)")),k.createElement(s,null,n.map((function(e,o){var t=e.value,n=e.label;return k.createElement(g,{key:o,value:t,label:n||"",sx:{fontSize:W.size.font.base,color:W.color.text.base},control:k.createElement(ce,{color:"primary",inputProps:{"data-testid":"".concat(r,"-").concat(o)}})})}))),i&&k.createElement(m,{sx:{marginLeft:0,marginRight:0},error:i},c))},fe=function(e){return k.createElement(p,F({},e))},se=function(e){var r=e.id,o=e.helperText,t=e.label,n=e.error,a=e.required,i=void 0===a||a,c=e.name,s=e.data;return k.createElement(d,{component:"fieldset",error:n},k.createElement(f,{component:"legend"},t," ",i?"":k.createElement(l,{component:"span",sx:{fontWeight:W.font.weight.normal,color:W.color.text.light}},"(optional)")),k.createElement(u,{"aria-label":c,name:c},s.map((function(e,o){var t=e.value,n=e.label;return k.createElement(g,{value:t,key:t,label:n||"",sx:{fontSize:W.size.font.base,color:W.color.text.base},control:k.createElement(fe,{color:"primary",inputProps:{"data-testid":"".concat(r,"-").concat(o)}})})}))),n&&k.createElement(m,{sx:{marginLeft:0,marginRight:0}},o))},ge=function(e){return k.createElement(h,F({},e))},me=function(e){var r=e.id,o=e.label,t=e.checked;return k.createElement(d,null,k.createElement(f,{component:"label"},o),k.createElement(g,{control:k.createElement(ge,{id:r}),label:"".concat(t?"Active":"Inactive")}))},pe=function(e){return k.createElement(b,F({variant:"outlined"},e))},ue=function(e){var r=e.id,o=e.required,t=void 0===o||o,n=e.options,a=e.label,i=e.error,c=e.placeholder,s=e.helperText;return k.createElement(d,null,k.createElement(f,{component:"label",error:i},a," ",t?"":k.createElement(l,{component:"span",sx:{fontWeight:W.font.weight.normal,color:W.color.text.light}},"(optional)")),k.createElement(pe,{id:r,placeholder:c,error:i},n.map((function(e){return k.createElement(y,{key:e.value,value:e.value},e.text)}))),i&&k.createElement(m,{sx:{marginLeft:0,marginRight:0},error:i},s))},he=function(e){var r=e.type,o=L(e,["type"]),t=z(!1),n=t[0],a=t[1],i=F(F({},o.InputProps),"password"===r&&{endAdornment:k.createElement(O,{position:"end"},k.createElement(M,{"aria-label":"toggle password visibility",onClick:function(){return a(!n)},edge:"end"},n?k.createElement(T,null):k.createElement(P,null)))});return k.createElement(x,F({},o,{type:n?"text":r,InputProps:i}))},be=function(e){var r=e.id,o=e.required,t=void 0===o||o,n=e.label,a=e.error,i=e.helperText,c=L(e,["id","required","label","error","helperText"]);return k.createElement(d,null,k.createElement(f,{component:"label",error:a},n," ",!t&&k.createElement(l,{component:"span",sx:{fontWeight:W.font.weight.normal,color:W.color.text.light}},"(optional)")),k.createElement(he,F({},c,{id:r,error:a,inputProps:{"data-testid":r}})),a&&k.createElement(m,{sx:{marginLeft:0,marginRight:0},error:a},i))},ye=function(e){var r=e.children,o=L(e,["children"]);return k.createElement(v,F({underline:"hover",variant:"caption",component:"span"},o),r)};export{ne as Avatar,le as Box,re as Button,ce as Checkbox,te as Chip,ie as Container,de as FormCheckbox,be as FormInput,se as FormRadio,ue as FormSelect,me as FormSwitch,he as Input,ye as Link,fe as Radio,pe as Select,ge as Switch,oe as Typography,_ as UpComponentsProvider,Z as theme,W as tokens};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@up42/up-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "UP42 Component Library",
|
|
5
5
|
"author": "Axel Fuhrmann axel.fuhrmann@up42.com",
|
|
6
6
|
"license": "ISC",
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"release": "standard-version",
|
|
24
24
|
"prepare": "husky install"
|
|
25
25
|
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@up42/design-system-tokens": "^1.2.0"
|
|
28
|
+
},
|
|
26
29
|
"devDependencies": {
|
|
27
30
|
"@babel/core": "^7.16.10",
|
|
28
31
|
"@babel/preset-env": "^7.16.10",
|
|
@@ -52,7 +55,6 @@
|
|
|
52
55
|
"@types/react": "^17.0.38",
|
|
53
56
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
54
57
|
"@typescript-eslint/parser": "^5.10.0",
|
|
55
|
-
"@up42/design-system-tokens": "^1.2.0",
|
|
56
58
|
"babel-jest": "^27.4.6",
|
|
57
59
|
"babel-loader": "^8.2.3",
|
|
58
60
|
"eslint": "^8.7.0",
|
|
@@ -81,7 +83,6 @@
|
|
|
81
83
|
"@emotion/styled": "^11.6.0",
|
|
82
84
|
"@mui/icons-material": "^5.3.0",
|
|
83
85
|
"@mui/material": "^5.3.0",
|
|
84
|
-
"@up42/design-system-tokens": "^1.2.0",
|
|
85
86
|
"react": "^17.0.2"
|
|
86
87
|
},
|
|
87
88
|
"lint-staged": {
|
|
@@ -90,7 +91,7 @@
|
|
|
90
91
|
"homepage": "https://github.com/up42/up-components#readme",
|
|
91
92
|
"access": "private",
|
|
92
93
|
"engines": {
|
|
93
|
-
"node": ">=
|
|
94
|
+
"node": ">= 15"
|
|
94
95
|
},
|
|
95
96
|
"standard-version": {
|
|
96
97
|
"skip": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const Table: {
|
|
3
|
-
Wrapper: ({ rows, columns }: {
|
|
4
|
-
rows: React.ReactNode;
|
|
5
|
-
columns: string[];
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
Cell: import("@emotion/styled").StyledComponent<import("@mui/material/TableCell/TableCell").TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
-
Row: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/TableRow/TableRow").TableRowTypeMap<{}, "tr">>;
|
|
9
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Meta } from '@storybook/react';
|
|
3
|
-
import '@codesandbox/sandpack-react/dist/index.css';
|
|
4
|
-
declare const _default: Meta<import("@storybook/react").Args>;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Playground: () => JSX.Element;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const Table: {
|
|
3
|
-
Wrapper: ({ rows, columns }: {
|
|
4
|
-
rows: React.ReactNode;
|
|
5
|
-
columns: string[];
|
|
6
|
-
}) => JSX.Element;
|
|
7
|
-
Cell: import("@emotion/styled").StyledComponent<import("@mui/material/TableCell/TableCell").TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
8
|
-
Row: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material/TableRow/TableRow").TableRowTypeMap<{}, "tr">>;
|
|
9
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Meta } from '@storybook/react';
|
|
3
|
-
import '@codesandbox/sandpack-react/dist/index.css';
|
|
4
|
-
declare const _default: Meta<import("@storybook/react").Args>;
|
|
5
|
-
export default _default;
|
|
6
|
-
export declare const Playground: () => JSX.Element;
|