@ctlyst.id/icons 2.8.9 → 2.8.11

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.
@@ -25,4 +25,4 @@ var use_icon_props_default = useIconProps;
25
25
  export {
26
26
  use_icon_props_default
27
27
  };
28
- //# sourceMappingURL=chunk-DXCN5L2H.mjs.map
28
+ //# sourceMappingURL=chunk-I6TGOPV6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/use-icon-props.ts"],"sourcesContent":["import { theme } from '@ctlyst.id/voila-ui-core';\nimport type { SVGProps } from 'react';\n\nimport type { BaseIconProps, ThemeColors } from '.';\n\nconst useIconProps = (props: BaseIconProps): SVGProps<SVGSVGElement> => {\n const defaultSize = 24;\n const defaultSVGFill = 'currentColor';\n\n const resolveColor = () => {\n if (!props.color) {\n return 'inherit';\n }\n\n if (theme.colors[props.color as ThemeColors]) {\n return theme.colors[props.color as ThemeColors];\n }\n\n return props.color;\n };\n return {\n ...props,\n color: resolveColor(),\n fill: props?.fill || defaultSVGFill,\n width: props?.size || defaultSize,\n height: props?.size || defaultSize,\n };\n};\n\nexport default useIconProps;\n"],"mappings":";AAAA,SAAS,aAAa;AAKtB,IAAM,eAAe,CAAC,UAAkD;AACtE,QAAM,cAAc;AACpB,QAAM,iBAAiB;AAEvB,QAAM,eAAe,MAAM;AACzB,QAAI,CAAC,MAAM,OAAO;AAChB,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,OAAO,MAAM,KAAoB,GAAG;AAC5C,aAAO,MAAM,OAAO,MAAM,KAAoB;AAAA,IAChD;AAEA,WAAO,MAAM;AAAA,EACf;AACA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,OAAO,aAAa;AAAA,IACpB,OAAM,+BAAO,SAAQ;AAAA,IACrB,QAAO,+BAAO,SAAQ;AAAA,IACtB,SAAQ,+BAAO,SAAQ;AAAA,EACzB;AACF;AAEA,IAAO,yBAAQ;","names":[]}