@ed.yakovich/example-component-library--molecules--info-banner 1.0.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/component/context/index.js +7 -0
- package/dist/component/index.js +32 -0
- package/dist/component/types/index.js +1 -0
- package/dist/lib/component/context/index.d.ts +10 -0
- package/dist/lib/component/index.d.ts +2 -0
- package/dist/lib/component/types/index.d.ts +7 -0
- package/dist/lib/main.d.ts +3 -0
- package/dist/main.js +6 -0
- package/package.json +49 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as r, useContext as x } from "react";
|
|
3
|
+
const n = r({}), a = () => x(n), f = ({ model: t, children: o }) => /* @__PURE__ */ e(n.Provider, { value: { ...t }, children: o });
|
|
4
|
+
export {
|
|
5
|
+
f as InfoBannerContextProvider,
|
|
6
|
+
a as useInfoBannerContext
|
|
7
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as e, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useInfoBannerContext as f } from "./context/index.js";
|
|
3
|
+
import { createContext as H, useContext as C } from "react";
|
|
4
|
+
const N = H({}), v = () => C(N), I = (s) => {
|
|
5
|
+
const { isHidden: d, componentId: o = "", icon: t = "" } = s, i = v(), c = i == null ? void 0 : i.isHidden, n = (i == null ? void 0 : i.icon) || "", a = () => ({
|
|
6
|
+
isHiddenVal: c || d,
|
|
7
|
+
iconVal: n || t
|
|
8
|
+
}), { isHiddenVal: l, iconVal: r } = a();
|
|
9
|
+
return l ? null : /* @__PURE__ */ e("span", { "data-component-id": `Icon--${o}`, children: /* @__PURE__ */ e("i", { className: `fas ${r}` }) });
|
|
10
|
+
}, j = (s) => {
|
|
11
|
+
const { isHidden: d, componentId: o = "", heading: t = "", description: i = "", icon: c = "" } = s, n = f(), a = n == null ? void 0 : n.isHidden, l = (n == null ? void 0 : n.icon) || "", r = (n == null ? void 0 : n.heading) || "", u = (n == null ? void 0 : n.description) || "", V = () => ({
|
|
12
|
+
isHiddenVal: a || d,
|
|
13
|
+
iconVal: l || c,
|
|
14
|
+
headingVal: r || t,
|
|
15
|
+
descriptionVal: u || i
|
|
16
|
+
}), { isHiddenVal: x, iconVal: m, headingVal: p, descriptionVal: h } = V();
|
|
17
|
+
return x ? null : /* @__PURE__ */ e(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
"data-component-id": `InfoBanner--${o}`,
|
|
21
|
+
className: "bg-blue-500 p-4 text-white @container/infobanner",
|
|
22
|
+
children: /* @__PURE__ */ e("div", { className: "text-center", children: /* @__PURE__ */ g("div", { className: "space-y-1", children: [
|
|
23
|
+
m && /* @__PURE__ */ e(I, { icon: m, componentId: o }),
|
|
24
|
+
p && /* @__PURE__ */ e("div", { className: "text-center @lg/infobanner:px-14", children: /* @__PURE__ */ e("h2", { className: "text-3xl", children: /* @__PURE__ */ e("strong", { children: p }) }) }),
|
|
25
|
+
h && /* @__PURE__ */ e("p", { className: "text-xs mb-2", children: /* @__PURE__ */ e("strong", { children: h }) })
|
|
26
|
+
] }) })
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
j as InfoBanner
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { InfoBannerType } from '../types';
|
|
3
|
+
type InfoBannerContextData = InfoBannerType;
|
|
4
|
+
type InfoBannerContextProviderProps = {
|
|
5
|
+
model: InfoBannerContextData;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export declare const useInfoBannerContext: () => InfoBannerType;
|
|
9
|
+
export declare const InfoBannerContextProvider: ({ model, children }: InfoBannerContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
package/dist/main.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ed.yakovich/example-component-library--molecules--info-banner",
|
|
3
|
+
"author": "Ed Yakovich",
|
|
4
|
+
"private": false,
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/lib/main.d.ts",
|
|
10
|
+
"default": "./dist/main.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build": "tsc -b ./tsconfig.lib.json && vite build",
|
|
22
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
23
|
+
"preview": "vite preview"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
27
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^22.5.4",
|
|
31
|
+
"@types/react": "^18.3.5",
|
|
32
|
+
"@types/react-dom": "^18.3.0",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
34
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
35
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
36
|
+
"ajv": "^8.17.1",
|
|
37
|
+
"eslint": "^8.57.0",
|
|
38
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
39
|
+
"eslint-plugin-react-refresh": "^0.4.11",
|
|
40
|
+
"glob": "^11.0.0",
|
|
41
|
+
"react": "^18.3.1",
|
|
42
|
+
"react-dom": "^18.3.1",
|
|
43
|
+
"typescript": "^5.6.2",
|
|
44
|
+
"vite": "^5.4.4",
|
|
45
|
+
"vite-plugin-dts": "^4.2.1",
|
|
46
|
+
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
47
|
+
"@ed.yakovich/example-component-library--atoms--icon": "^1.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|