@zydon/common 2.8.1 → 2.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-E4HIWMGS.js → chunk-BJ5IDN65.js} +2 -2
- package/dist/chunk-KYV74QIT.js +8 -0
- package/dist/chunk-KYV74QIT.js.map +1 -0
- package/dist/chunk-QSHKTHGM.js +16 -0
- package/dist/chunk-QSHKTHGM.js.map +1 -0
- package/dist/{chunk-GEEFHX4U.js → chunk-WRGRGZEM.js} +2 -2
- package/dist/components/AvatarButton/index.js +3 -3
- package/dist/components/ColorPickerInput/index.js +1 -1
- package/dist/components/Common/index.js +3 -3
- package/dist/components/ToggleTheme/index.js +3 -3
- package/dist/components/form/ColorPicker/index.js +1 -1
- package/dist/hooks/useThemeToggle.js +3 -3
- package/dist/index.js +3 -3
- package/dist/theme/theme-provider.js +3 -3
- package/dist/theme/with-settings/index.js +2 -2
- package/dist/utils/color.d.ts +2 -1
- package/dist/utils/color.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-E3TW4QI3.js +0 -16
- package/dist/chunk-E3TW4QI3.js.map +0 -1
- package/dist/chunk-TWOLB4FN.js +0 -8
- package/dist/chunk-TWOLB4FN.js.map +0 -1
- /package/dist/{chunk-E4HIWMGS.js.map → chunk-BJ5IDN65.js.map} +0 -0
- /package/dist/{chunk-GEEFHX4U.js.map → chunk-WRGRGZEM.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a } from './chunk-373WGZZL.js';
|
|
2
2
|
import { a as a$1, e } from './chunk-FTYHXGXC.js';
|
|
3
|
-
import { a as a$3, b } from './chunk-
|
|
3
|
+
import { a as a$3, b } from './chunk-WRGRGZEM.js';
|
|
4
4
|
import { p, r, a as a$2 } from './chunk-LRSF3YE6.js';
|
|
5
5
|
import { a as a$5 } from './chunk-WUFEPE2G.js';
|
|
6
6
|
import { c, b as b$1 } from './chunk-BX2DSNRV.js';
|
|
@@ -15,4 +15,4 @@ var W=t=>({lighter:lighten(t,.815),light:lighten(t,.225),main:t,dark:darken(t,.1
|
|
|
15
15
|
|
|
16
16
|
export { x as a, te as b };
|
|
17
17
|
//# sourceMappingURL=out.js.map
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-BJ5IDN65.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { a } from './chunk-HBOBTNB5.js';
|
|
2
|
+
import n from 'color';
|
|
3
|
+
|
|
4
|
+
var e=t=>n(t).luminosity(),l=t=>e(t)>.5?a.grey[800]:"#FFFFFF",m=t=>t?`#${t.replace(/^#+/,"")}`:"#000000";
|
|
5
|
+
|
|
6
|
+
export { e as a, l as b, m as c };
|
|
7
|
+
//# sourceMappingURL=out.js.map
|
|
8
|
+
//# sourceMappingURL=chunk-KYV74QIT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/color.ts"],"names":["Color","getLuminosity","color","getContrastTextColor","colors_default","normalizeHexColor"],"mappings":"wCAAA,OAAOA,MAAW,QAIX,IAAMC,EAAiBC,GAAkBF,EAAME,CAAK,EAAE,WAAW,EAE3DC,EAAwBD,GAChBD,EAAcC,CAAK,EAElB,GAAME,EAAO,KAAK,GAAG,EAAI,UAGlCC,EAAqBH,GAC3BA,EAEE,IADSA,EAAM,QAAQ,MAAO,EAAE,IADpB","sourcesContent":["import Color from 'color';\n\nimport COLORS from 'theme/core/colors.json';\n\nexport const getLuminosity = (color: string) => Color(color).luminosity();\n\nexport const getContrastTextColor = (color: string) => {\n const luminosity = getLuminosity(color);\n\n return luminosity > 0.5 ? COLORS.grey[800] : '#FFFFFF';\n};\n\nexport const normalizeHexColor = (color: string): string => {\n if (!color) return '#000000';\n const cleaned = color.replace(/^#+/, '');\n return `#${cleaned}`;\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { a } from './chunk-LQRRMVFN.js';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import C from '@mui/material/Box';
|
|
4
|
+
import g from '@mui/material/IconButton';
|
|
5
|
+
import k from '@mui/material/InputAdornment';
|
|
6
|
+
import x from '@mui/material/Popover';
|
|
7
|
+
import b from '@mui/material/TextField';
|
|
8
|
+
import { ChromePicker } from 'react-color';
|
|
9
|
+
import { styled } from '@mui/material/styles';
|
|
10
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
var p=styled(ChromePicker)({fontFamily:"inherit",boxShadow:"none"});var I=({value:l,tabIndex:s,onChangeColor:a$1,...t})=>{let[m,c]=useState(),n=m||l,r=n?"#"+n.replaceAll("#",""):"",e=a(),u=()=>{e.onClose(),a$1(r);};return jsxs(Fragment,{children:[jsx(b,{...t,value:r,InputProps:{...t.InputProps,startAdornment:jsx(k,{position:"start",sx:{ml:2},children:jsx(g,{edge:"start","aria-label":"Escolher cor",onClick:e.onOpen,children:jsx(C,{sx:{minWidth:23,minHeight:23,backgroundColor:r,borderRadius:.5,boxShadow:"0 0 0 2px rgba(0, 0, 0, 0.0375)"}})})})},inputProps:{readOnly:!0,...t.inputProps,maxLength:7,tabIndex:s}}),jsx(x,{className:"popover-color-picker",open:!!e.open,anchorEl:e.open,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},slotProps:{paper:{style:{borderRadius:8}}},children:jsx(p,{color:r,onChange:({hex:d})=>c(d),styles:{default:{picker:{fontFamily:"inherit",boxShadow:"none"}}},disableAlpha:!0})})]})},L=I;
|
|
13
|
+
|
|
14
|
+
export { L as a };
|
|
15
|
+
//# sourceMappingURL=out.js.map
|
|
16
|
+
//# sourceMappingURL=chunk-QSHKTHGM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ColorPickerInput/index.tsx","../src/components/ColorPickerInput/styles.ts"],"names":["useState","Box","IconButton","InputAdornment","Popover","TextField","ChromePickerOrigin","styled","ChromePicker","Fragment","jsx","jsxs","ColorPickerInput","value","tabIndex","onChangeColor","other","color","setColor","currentColor","hexValue","popover","usePopover_default","handleCloseColorPicker","hex","ColorPickerInput_default"],"mappings":"wCAAA,OAAS,YAAAA,MAAgB,QACzB,OAAOC,MAAS,oBAChB,OAAOC,MAAgB,2BACvB,OAAOC,MAAoB,+BAC3B,OAAOC,MAAa,wBACpB,OAAOC,MAAe,0BCLtB,OAAS,gBAAgBC,MAA0B,cACnD,OAAS,UAAAC,MAAc,uBAEhB,IAAMC,EAAeD,EAAOD,CAAkB,EAAE,CACrD,WAAY,UACZ,UAAW,MACb,CAAC,EDwBG,mBAAAG,EAaY,OAAAC,EAbZ,QAAAC,MAAA,oBAlBJ,IAAMC,EAAmB,CAAC,CACxB,MAAAC,EACA,SAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IAA6B,CAC3B,GAAM,CAACC,EAAOC,CAAQ,EAAIlB,EAAuB,EAC3CmB,EAAeF,GAASJ,EACxBO,EAAWD,EAAe,IAAMA,EAAa,WAAW,IAAK,EAAE,EAAI,GAEnEE,EAAUC,EAAW,EAErBC,EAAyB,IAAM,CACnCF,EAAQ,QAAQ,EAChBN,EAAcK,CAAQ,CACxB,EAEA,OACET,EAAAF,EAAA,CACE,UAAAC,EAACL,EAAA,CACE,GAAGW,EACJ,MAAOI,EACP,WAAY,CACV,GAAGJ,EAAM,WACT,eACEN,EAACP,EAAA,CAAe,SAAS,QAAQ,GAAI,CAAE,GAAI,CAAE,EAC3C,SAAAO,EAACR,EAAA,CACC,KAAK,QACL,aAAW,eACX,QAASmB,EAAQ,OAEjB,SAAAX,EAACT,EAAA,CACC,GAAI,CACF,SAAU,GACV,UAAW,GACX,gBAAiBmB,EACjB,aAAc,GACd,UAAW,iCACb,EACF,EACF,EACF,CAEJ,EACA,WAAY,CACV,SAAU,GACV,GAAGJ,EAAM,WACT,UAAW,EACX,SAAAF,CACF,EACF,EACAJ,EAACN,EAAA,CACC,UAAU,uBACV,KAAM,EAAQiB,EAAQ,KACtB,SAAUA,EAAQ,KAClB,QAASE,EACT,aAAc,CACZ,SAAU,SACV,WAAY,QACd,EACA,gBAAiB,CACf,SAAU,SACV,WAAY,QACd,EACA,UAAW,CACT,MAAO,CACL,MAAO,CAAE,aAAc,CAAE,CAC3B,CACF,EAEA,SAAAb,EAACF,EAAA,CACC,MAAOY,EACP,SAAU,CAAC,CAAE,IAAAI,CAAI,IAAuBN,EAASM,CAAmB,EACpE,OAAQ,CACN,QAAS,CACP,OAAQ,CACN,WAAY,UACZ,UAAW,MACb,CACF,CACF,EACA,aAAY,GACd,EACF,GACF,CAEJ,EAEOC,EAAQb","sourcesContent":["import { useState } from 'react';\nimport Box from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Popover from '@mui/material/Popover';\nimport TextField from '@mui/material/TextField';\n\nimport usePopover from 'hooks/usePopover';\n\nimport { ColorPickerInputProps } from './props';\nimport { ChromePicker } from './styles';\n\nconst ColorPickerInput = ({\n value,\n tabIndex,\n onChangeColor,\n ...other\n}: ColorPickerInputProps) => {\n const [color, setColor] = useState<`#${string}`>();\n const currentColor = color || value;\n const hexValue = currentColor ? '#' + currentColor.replaceAll('#', '') : '';\n\n const popover = usePopover();\n\n const handleCloseColorPicker = () => {\n popover.onClose();\n onChangeColor(hexValue);\n };\n\n return (\n <>\n <TextField\n {...other}\n value={hexValue}\n InputProps={{\n ...other.InputProps,\n startAdornment: (\n <InputAdornment position=\"start\" sx={{ ml: 2 }}>\n <IconButton\n edge=\"start\"\n aria-label=\"Escolher cor\"\n onClick={popover.onOpen}\n >\n <Box\n sx={{\n minWidth: 23,\n minHeight: 23,\n backgroundColor: hexValue,\n borderRadius: 0.5,\n boxShadow: '0 0 0 2px rgba(0, 0, 0, 0.0375)',\n }}\n />\n </IconButton>\n </InputAdornment>\n ),\n }}\n inputProps={{\n readOnly: true,\n ...other.inputProps,\n maxLength: 7,\n tabIndex,\n }}\n />\n <Popover\n className=\"popover-color-picker\"\n open={Boolean(popover.open)}\n anchorEl={popover.open}\n onClose={handleCloseColorPicker}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'center',\n horizontal: 'center',\n }}\n slotProps={{\n paper: {\n style: { borderRadius: 8 },\n },\n }}\n >\n <ChromePicker\n color={hexValue}\n onChange={({ hex }: { hex: string }) => setColor(hex as `#${string}`)}\n styles={{\n default: {\n picker: {\n fontFamily: 'inherit',\n boxShadow: 'none',\n },\n },\n }}\n disableAlpha\n />\n </Popover>\n </>\n );\n};\n\nexport default ColorPickerInput;\n","import { ChromePicker as ChromePickerOrigin } from 'react-color';\nimport { styled } from '@mui/material/styles';\n\nexport const ChromePicker = styled(ChromePickerOrigin)({\n fontFamily: 'inherit',\n boxShadow: 'none',\n});\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a } from './chunk-
|
|
1
|
+
import { a } from './chunk-KYV74QIT.js';
|
|
2
2
|
import { r, b, a as a$2 } from './chunk-LRSF3YE6.js';
|
|
3
3
|
import { h as h$1, j } from './chunk-GLRLKFPS.js';
|
|
4
4
|
import a$1 from 'color';
|
|
@@ -7,4 +7,4 @@ function P(t,e){let{colorSchemes:r$1,customShadows:o}=t;return {...t,colorScheme
|
|
|
7
7
|
|
|
8
8
|
export { P as a, T as b, f as c };
|
|
9
9
|
//# sourceMappingURL=out.js.map
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-WRGRGZEM.js.map
|
|
@@ -6,11 +6,11 @@ import { a as a$3 } from '../../chunk-QVOKZISA.js';
|
|
|
6
6
|
import '../../chunk-S7KQI2WJ.js';
|
|
7
7
|
import { a as a$1 } from '../../chunk-LQRRMVFN.js';
|
|
8
8
|
import '../../chunk-EDWQYAWG.js';
|
|
9
|
-
import '../../chunk-
|
|
9
|
+
import '../../chunk-BJ5IDN65.js';
|
|
10
10
|
import '../../chunk-373WGZZL.js';
|
|
11
11
|
import '../../chunk-FTYHXGXC.js';
|
|
12
|
-
import '../../chunk-
|
|
13
|
-
import '../../chunk-
|
|
12
|
+
import '../../chunk-WRGRGZEM.js';
|
|
13
|
+
import '../../chunk-KYV74QIT.js';
|
|
14
14
|
import '../../chunk-LRSF3YE6.js';
|
|
15
15
|
import '../../chunk-HBOBTNB5.js';
|
|
16
16
|
import '../../chunk-WUFEPE2G.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a } from '../../chunk-QVOKZISA.js';
|
|
2
2
|
import '../../chunk-S7KQI2WJ.js';
|
|
3
|
-
import { b } from '../../chunk-
|
|
3
|
+
import { b } from '../../chunk-BJ5IDN65.js';
|
|
4
4
|
import '../../chunk-373WGZZL.js';
|
|
5
5
|
import '../../chunk-FTYHXGXC.js';
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-WRGRGZEM.js';
|
|
7
|
+
import '../../chunk-KYV74QIT.js';
|
|
8
8
|
import '../../chunk-LRSF3YE6.js';
|
|
9
9
|
import '../../chunk-HBOBTNB5.js';
|
|
10
10
|
import '../../chunk-WUFEPE2G.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { a as default } from '../../chunk-NB6Z5G2Q.js';
|
|
2
2
|
import '../../chunk-EDWQYAWG.js';
|
|
3
|
-
import '../../chunk-
|
|
3
|
+
import '../../chunk-BJ5IDN65.js';
|
|
4
4
|
import '../../chunk-373WGZZL.js';
|
|
5
5
|
import '../../chunk-FTYHXGXC.js';
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-WRGRGZEM.js';
|
|
7
|
+
import '../../chunk-KYV74QIT.js';
|
|
8
8
|
import '../../chunk-LRSF3YE6.js';
|
|
9
9
|
import '../../chunk-HBOBTNB5.js';
|
|
10
10
|
import '../../chunk-WUFEPE2G.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { a as useThemeToggle } from '../chunk-EDWQYAWG.js';
|
|
2
|
-
import '../chunk-
|
|
2
|
+
import '../chunk-BJ5IDN65.js';
|
|
3
3
|
import '../chunk-373WGZZL.js';
|
|
4
4
|
import '../chunk-FTYHXGXC.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-WRGRGZEM.js';
|
|
6
|
+
import '../chunk-KYV74QIT.js';
|
|
7
7
|
import '../chunk-LRSF3YE6.js';
|
|
8
8
|
import '../chunk-HBOBTNB5.js';
|
|
9
9
|
import '../chunk-WUFEPE2G.js';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { a as useThemeToggle } from './chunk-EDWQYAWG.js';
|
|
2
|
-
export { b as ThemeProvider, a as createTheme } from './chunk-
|
|
2
|
+
export { b as ThemeProvider, a as createTheme } from './chunk-BJ5IDN65.js';
|
|
3
3
|
import './chunk-373WGZZL.js';
|
|
4
4
|
export { b as defaultFont, c as primaryFont, d as secondaryFont, a as shadows, e as typography } from './chunk-FTYHXGXC.js';
|
|
5
|
-
import './chunk-
|
|
6
|
-
import './chunk-
|
|
5
|
+
import './chunk-WRGRGZEM.js';
|
|
6
|
+
import './chunk-KYV74QIT.js';
|
|
7
7
|
export { l as action, k as background, m as basePalette, p as colorSchemes, i as common, a as components, q as createShadowColor, r as customShadows, o as darkPalette, h as error, b as grey, e as info, n as lightPalette, c as primary, d as secondary, f as success, j as text, g as warning } from './chunk-LRSF3YE6.js';
|
|
8
8
|
import './chunk-HBOBTNB5.js';
|
|
9
9
|
import './chunk-WUFEPE2G.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { b as default } from '../chunk-
|
|
1
|
+
export { b as default } from '../chunk-BJ5IDN65.js';
|
|
2
2
|
import '../chunk-373WGZZL.js';
|
|
3
3
|
import '../chunk-FTYHXGXC.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-WRGRGZEM.js';
|
|
5
|
+
import '../chunk-KYV74QIT.js';
|
|
6
6
|
import '../chunk-LRSF3YE6.js';
|
|
7
7
|
import '../chunk-HBOBTNB5.js';
|
|
8
8
|
import '../chunk-WUFEPE2G.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as buildPrimaryColors, b as updateComponentsWithSettings, a as updateCoreWithSettings } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { c as buildPrimaryColors, b as updateComponentsWithSettings, a as updateCoreWithSettings } from '../../chunk-WRGRGZEM.js';
|
|
2
|
+
import '../../chunk-KYV74QIT.js';
|
|
3
3
|
import '../../chunk-LRSF3YE6.js';
|
|
4
4
|
import '../../chunk-HBOBTNB5.js';
|
|
5
5
|
import '../../chunk-GLRLKFPS.js';
|
package/dist/utils/color.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const getLuminosity: (color: string) => number;
|
|
2
2
|
declare const getContrastTextColor: (color: string) => string;
|
|
3
|
+
declare const normalizeHexColor: (color: string) => string;
|
|
3
4
|
|
|
4
|
-
export { getContrastTextColor, getLuminosity };
|
|
5
|
+
export { getContrastTextColor, getLuminosity, normalizeHexColor };
|
package/dist/utils/color.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as getContrastTextColor, a as getLuminosity } from '../chunk-
|
|
1
|
+
export { b as getContrastTextColor, a as getLuminosity, c as normalizeHexColor } from '../chunk-KYV74QIT.js';
|
|
2
2
|
import '../chunk-HBOBTNB5.js';
|
|
3
3
|
//# sourceMappingURL=out.js.map
|
|
4
4
|
//# sourceMappingURL=color.js.map
|
package/package.json
CHANGED
package/dist/chunk-E3TW4QI3.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-LQRRMVFN.js';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import C from '@mui/material/Box';
|
|
4
|
-
import k from '@mui/material/IconButton';
|
|
5
|
-
import g from '@mui/material/InputAdornment';
|
|
6
|
-
import x from '@mui/material/Popover';
|
|
7
|
-
import I from '@mui/material/TextField';
|
|
8
|
-
import { ChromePicker } from 'react-color';
|
|
9
|
-
import { styled } from '@mui/material/styles';
|
|
10
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
11
|
-
|
|
12
|
-
var p=styled(ChromePicker)({fontFamily:"inherit",boxShadow:"none"});var b=({value:l,tabIndex:s,onChangeColor:a$1,...t})=>{let[m,c]=useState(),n=m||l,r=n?"#"+n.replaceAll("#",""):"",e=a(),u=()=>{e.onClose(),a$1(r);};return jsxs(Fragment,{children:[jsx(I,{...t,value:r,InputProps:{...t.InputProps,startAdornment:jsx(g,{position:"start",sx:{ml:2},children:jsx(k,{edge:"start","aria-label":"Escolher cor",onClick:e.onOpen,children:jsx(C,{sx:{minWidth:24,minHeight:24,backgroundColor:r,borderRadius:.5}})})})},inputProps:{readOnly:!0,...t.inputProps,maxLength:7,tabIndex:s}}),jsx(x,{className:"popover-color-picker",open:!!e.open,anchorEl:e.open,onClose:u,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"center",horizontal:"center"},slotProps:{paper:{style:{borderRadius:8}}},children:jsx(p,{color:r,onChange:({hex:d})=>c(d),styles:{default:{picker:{fontFamily:"inherit",boxShadow:"none"}}},disableAlpha:!0})})]})},L=b;
|
|
13
|
-
|
|
14
|
-
export { L as a };
|
|
15
|
-
//# sourceMappingURL=out.js.map
|
|
16
|
-
//# sourceMappingURL=chunk-E3TW4QI3.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ColorPickerInput/index.tsx","../src/components/ColorPickerInput/styles.ts"],"names":["useState","Box","IconButton","InputAdornment","Popover","TextField","ChromePickerOrigin","styled","ChromePicker","Fragment","jsx","jsxs","ColorPickerInput","value","tabIndex","onChangeColor","other","color","setColor","currentColor","hexValue","popover","usePopover_default","handleCloseColorPicker","hex","ColorPickerInput_default"],"mappings":"wCAAA,OAAS,YAAAA,MAAgB,QACzB,OAAOC,MAAS,oBAChB,OAAOC,MAAgB,2BACvB,OAAOC,MAAoB,+BAC3B,OAAOC,MAAa,wBACpB,OAAOC,MAAe,0BCLtB,OAAS,gBAAgBC,MAA0B,cACnD,OAAS,UAAAC,MAAc,uBAEhB,IAAMC,EAAeD,EAAOD,CAAkB,EAAE,CACrD,WAAY,UACZ,UAAW,MACb,CAAC,EDwBG,mBAAAG,EAaY,OAAAC,EAbZ,QAAAC,MAAA,oBAlBJ,IAAMC,EAAmB,CAAC,CACxB,MAAAC,EACA,SAAAC,EACA,cAAAC,EACA,GAAGC,CACL,IAA6B,CAC3B,GAAM,CAACC,EAAOC,CAAQ,EAAIlB,EAAuB,EAC3CmB,EAAeF,GAASJ,EACxBO,EAAWD,EAAe,IAAMA,EAAa,WAAW,IAAK,EAAE,EAAI,GAEnEE,EAAUC,EAAW,EAErBC,EAAyB,IAAM,CACnCF,EAAQ,QAAQ,EAChBN,EAAcK,CAAQ,CACxB,EAEA,OACET,EAAAF,EAAA,CACE,UAAAC,EAACL,EAAA,CACE,GAAGW,EACJ,MAAOI,EACP,WAAY,CACV,GAAGJ,EAAM,WACT,eACEN,EAACP,EAAA,CAAe,SAAS,QAAQ,GAAI,CAAE,GAAI,CAAE,EAC3C,SAAAO,EAACR,EAAA,CACC,KAAK,QACL,aAAW,eACX,QAASmB,EAAQ,OAEjB,SAAAX,EAACT,EAAA,CACC,GAAI,CACF,SAAU,GACV,UAAW,GACX,gBAAiBmB,EACjB,aAAc,EAChB,EACF,EACF,EACF,CAEJ,EACA,WAAY,CACV,SAAU,GACV,GAAGJ,EAAM,WACT,UAAW,EACX,SAAAF,CACF,EACF,EACAJ,EAACN,EAAA,CACC,UAAU,uBACV,KAAM,EAAQiB,EAAQ,KACtB,SAAUA,EAAQ,KAClB,QAASE,EACT,aAAc,CACZ,SAAU,SACV,WAAY,QACd,EACA,gBAAiB,CACf,SAAU,SACV,WAAY,QACd,EACA,UAAW,CACT,MAAO,CACL,MAAO,CAAE,aAAc,CAAE,CAC3B,CACF,EAEA,SAAAb,EAACF,EAAA,CACC,MAAOY,EACP,SAAU,CAAC,CAAE,IAAAI,CAAI,IAAuBN,EAASM,CAAmB,EACpE,OAAQ,CACN,QAAS,CACP,OAAQ,CACN,WAAY,UACZ,UAAW,MACb,CACF,CACF,EACA,aAAY,GACd,EACF,GACF,CAEJ,EAEOC,EAAQb","sourcesContent":["import { useState } from 'react';\nimport Box from '@mui/material/Box';\nimport IconButton from '@mui/material/IconButton';\nimport InputAdornment from '@mui/material/InputAdornment';\nimport Popover from '@mui/material/Popover';\nimport TextField from '@mui/material/TextField';\n\nimport usePopover from 'hooks/usePopover';\n\nimport { ColorPickerInputProps } from './props';\nimport { ChromePicker } from './styles';\n\nconst ColorPickerInput = ({\n value,\n tabIndex,\n onChangeColor,\n ...other\n}: ColorPickerInputProps) => {\n const [color, setColor] = useState<`#${string}`>();\n const currentColor = color || value;\n const hexValue = currentColor ? '#' + currentColor.replaceAll('#', '') : '';\n\n const popover = usePopover();\n\n const handleCloseColorPicker = () => {\n popover.onClose();\n onChangeColor(hexValue);\n };\n\n return (\n <>\n <TextField\n {...other}\n value={hexValue}\n InputProps={{\n ...other.InputProps,\n startAdornment: (\n <InputAdornment position=\"start\" sx={{ ml: 2 }}>\n <IconButton\n edge=\"start\"\n aria-label=\"Escolher cor\"\n onClick={popover.onOpen}\n >\n <Box\n sx={{\n minWidth: 24,\n minHeight: 24,\n backgroundColor: hexValue,\n borderRadius: 0.5,\n }}\n />\n </IconButton>\n </InputAdornment>\n ),\n }}\n inputProps={{\n readOnly: true,\n ...other.inputProps,\n maxLength: 7,\n tabIndex,\n }}\n />\n <Popover\n className=\"popover-color-picker\"\n open={Boolean(popover.open)}\n anchorEl={popover.open}\n onClose={handleCloseColorPicker}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'center',\n horizontal: 'center',\n }}\n slotProps={{\n paper: {\n style: { borderRadius: 8 },\n },\n }}\n >\n <ChromePicker\n color={hexValue}\n onChange={({ hex }: { hex: string }) => setColor(hex as `#${string}`)}\n styles={{\n default: {\n picker: {\n fontFamily: 'inherit',\n boxShadow: 'none',\n },\n },\n }}\n disableAlpha\n />\n </Popover>\n </>\n );\n};\n\nexport default ColorPickerInput;\n","import { ChromePicker as ChromePickerOrigin } from 'react-color';\nimport { styled } from '@mui/material/styles';\n\nexport const ChromePicker = styled(ChromePickerOrigin)({\n fontFamily: 'inherit',\n boxShadow: 'none',\n});\n"]}
|
package/dist/chunk-TWOLB4FN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/color.ts"],"names":["Color","getLuminosity","color","getContrastTextColor","colors_default"],"mappings":"wCAAA,OAAOA,MAAW,QAIX,IAAMC,EAAiBC,GAAkBF,EAAME,CAAK,EAAE,WAAW,EAE3DC,EAAwBD,GAChBD,EAAcC,CAAK,EAElB,GAAME,EAAO,KAAK,GAAG,EAAI","sourcesContent":["import Color from 'color';\n\nimport COLORS from 'theme/core/colors.json';\n\nexport const getLuminosity = (color: string) => Color(color).luminosity();\n\nexport const getContrastTextColor = (color: string) => {\n const luminosity = getLuminosity(color);\n\n return luminosity > 0.5 ? COLORS.grey[800] : '#FFFFFF';\n};\n"]}
|
|
File without changes
|
|
File without changes
|