@whydrf/nava-icon-react 1.1.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -650,6 +650,7 @@ __export(index_exports, {
650
650
  MovieIcon: () => MovieIcon,
651
651
  MoviePlayIcon: () => MoviePlayIcon,
652
652
  MusicIcon: () => MusicIcon,
653
+ NavaIconProvider: () => NavaIconProvider,
653
654
  NavigationIcon: () => NavigationIcon,
654
655
  NetworkChartIcon: () => NetworkChartIcon,
655
656
  NewsIcon: () => NewsIcon,
@@ -972,12 +973,13 @@ __export(index_exports, {
972
973
  YinYangIcon: () => YinYangIcon,
973
974
  ZapIcon: () => ZapIcon,
974
975
  ZoomInIcon: () => ZoomInIcon,
975
- ZoomOutIcon: () => ZoomOutIcon
976
+ ZoomOutIcon: () => ZoomOutIcon,
977
+ useNavaIconConfig: () => useNavaIconConfig
976
978
  });
977
979
  module.exports = __toCommonJS(index_exports);
978
980
 
979
981
  // src/Icon.tsx
980
- var import_react = require("react");
982
+ var import_react2 = require("react");
981
983
 
982
984
  // src/icons/index.ts
983
985
  var icons_exports = {};
@@ -40808,14 +40810,26 @@ function ZoomOutIcon(props) {
40808
40810
  );
40809
40811
  }
40810
40812
 
40813
+ // src/NavaIconProvider.tsx
40814
+ var import_react = require("react");
40815
+ var import_jsx_runtime953 = require("react/jsx-runtime");
40816
+ var NavaIconContext = (0, import_react.createContext)(null);
40817
+ function NavaIconProvider({ children, ...config }) {
40818
+ return /* @__PURE__ */ (0, import_jsx_runtime953.jsx)(NavaIconContext.Provider, { value: config, children });
40819
+ }
40820
+ function useNavaIconConfig() {
40821
+ return (0, import_react.useContext)(NavaIconContext) ?? {};
40822
+ }
40823
+
40811
40824
  // src/Icon.tsx
40812
40825
  var iconRecord = icons_exports;
40813
40826
  function normalizeIconName(name) {
40814
40827
  if (name.endsWith("Icon")) return name;
40815
40828
  return name.split(/[-_\s]+/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("") + "Icon";
40816
40829
  }
40817
- var Icon = (0, import_react.forwardRef)(
40830
+ var Icon = (0, import_react2.forwardRef)(
40818
40831
  ({ name, size, color, strokeWidth, className, title, style, mode, ...props }, ref) => {
40832
+ const config = useNavaIconConfig();
40819
40833
  const iconName = normalizeIconName(name);
40820
40834
  const Component = iconRecord[iconName];
40821
40835
  if (!Component) {
@@ -40824,12 +40838,12 @@ var Icon = (0, import_react.forwardRef)(
40824
40838
  }
40825
40839
  return null;
40826
40840
  }
40827
- return (0, import_react.createElement)(Component, {
40841
+ return (0, import_react2.createElement)(Component, {
40828
40842
  ref,
40829
- size,
40830
- color,
40831
- strokeWidth,
40832
- className,
40843
+ size: size ?? config.size,
40844
+ color: color ?? config.color,
40845
+ strokeWidth: strokeWidth ?? config.strokeWidth,
40846
+ className: className ?? config.className,
40833
40847
  title,
40834
40848
  style,
40835
40849
  mode,
@@ -41470,6 +41484,7 @@ Icon.displayName = "Icon";
41470
41484
  MovieIcon,
41471
41485
  MoviePlayIcon,
41472
41486
  MusicIcon,
41487
+ NavaIconProvider,
41473
41488
  NavigationIcon,
41474
41489
  NetworkChartIcon,
41475
41490
  NewsIcon,
@@ -41792,5 +41807,6 @@ Icon.displayName = "Icon";
41792
41807
  YinYangIcon,
41793
41808
  ZapIcon,
41794
41809
  ZoomInIcon,
41795
- ZoomOutIcon
41810
+ ZoomOutIcon,
41811
+ useNavaIconConfig
41796
41812
  });
package/dist/index.d.cts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { Icon, IconProps } from './Icon.cjs';
2
+ export { NavaIconProvider, NavaIconProviderProps, useNavaIconConfig } from './NavaIconProvider.cjs';
3
+ export { NavaIconConfig } from '@whydrf/nava-icon-core';
2
4
  export { AbacusIcon } from './icons/abacus.cjs';
3
5
  export { AccessibilityIcon } from './icons/accessibility.cjs';
4
6
  export { AddToQueueIcon } from './icons/add-to-queue.cjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { Icon, IconProps } from './Icon.js';
2
+ export { NavaIconProvider, NavaIconProviderProps, useNavaIconConfig } from './NavaIconProvider.js';
3
+ export { NavaIconConfig } from '@whydrf/nava-icon-core';
2
4
  export { AbacusIcon } from './icons/abacus.js';
3
5
  export { AccessibilityIcon } from './icons/accessibility.js';
4
6
  export { AddToQueueIcon } from './icons/add-to-queue.js';