@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/README.md +40 -8
- package/dist/Icon.cjs +16 -7
- package/dist/Icon.js +121 -120
- package/dist/NavaIconProvider.cjs +42 -0
- package/dist/NavaIconProvider.d.cts +12 -0
- package/dist/NavaIconProvider.d.ts +12 -0
- package/dist/NavaIconProvider.js +11 -0
- package/dist/chunk-DHINNPOD.js +16 -0
- package/dist/{chunk-3KRACJKY.js → chunk-O3YGDEMS.js} +247 -243
- package/dist/index.cjs +25 -9
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +247 -241
- package/package.json +9 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/NavaIconProvider.tsx
|
|
21
|
+
var NavaIconProvider_exports = {};
|
|
22
|
+
__export(NavaIconProvider_exports, {
|
|
23
|
+
NavaIconContext: () => NavaIconContext,
|
|
24
|
+
NavaIconProvider: () => NavaIconProvider,
|
|
25
|
+
useNavaIconConfig: () => useNavaIconConfig
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(NavaIconProvider_exports);
|
|
28
|
+
var import_react = require("react");
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
30
|
+
var NavaIconContext = (0, import_react.createContext)(null);
|
|
31
|
+
function NavaIconProvider({ children, ...config }) {
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavaIconContext.Provider, { value: config, children });
|
|
33
|
+
}
|
|
34
|
+
function useNavaIconConfig() {
|
|
35
|
+
return (0, import_react.useContext)(NavaIconContext) ?? {};
|
|
36
|
+
}
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
NavaIconContext,
|
|
40
|
+
NavaIconProvider,
|
|
41
|
+
useNavaIconConfig
|
|
42
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { NavaIconConfig } from '@whydrf/nava-icon-core';
|
|
4
|
+
|
|
5
|
+
declare const NavaIconContext: react.Context<NavaIconConfig | null>;
|
|
6
|
+
interface NavaIconProviderProps extends NavaIconConfig {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function NavaIconProvider({ children, ...config }: NavaIconProviderProps): react.JSX.Element;
|
|
10
|
+
declare function useNavaIconConfig(): NavaIconConfig;
|
|
11
|
+
|
|
12
|
+
export { NavaIconContext, NavaIconProvider, type NavaIconProviderProps, useNavaIconConfig };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { NavaIconConfig } from '@whydrf/nava-icon-core';
|
|
4
|
+
|
|
5
|
+
declare const NavaIconContext: react.Context<NavaIconConfig | null>;
|
|
6
|
+
interface NavaIconProviderProps extends NavaIconConfig {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function NavaIconProvider({ children, ...config }: NavaIconProviderProps): react.JSX.Element;
|
|
10
|
+
declare function useNavaIconConfig(): NavaIconConfig;
|
|
11
|
+
|
|
12
|
+
export { NavaIconContext, NavaIconProvider, type NavaIconProviderProps, useNavaIconConfig };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/NavaIconProvider.tsx
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var NavaIconContext = createContext(null);
|
|
5
|
+
function NavaIconProvider({ children, ...config }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(NavaIconContext.Provider, { value: config, children });
|
|
7
|
+
}
|
|
8
|
+
function useNavaIconConfig() {
|
|
9
|
+
return useContext(NavaIconContext) ?? {};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
NavaIconContext,
|
|
14
|
+
NavaIconProvider,
|
|
15
|
+
useNavaIconConfig
|
|
16
|
+
};
|