@augmenting-integrations/brand 0.1.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/LICENSE +21 -0
- package/dist/BrandProvider.d.ts +8 -0
- package/dist/BrandProvider.d.ts.map +1 -0
- package/dist/BrandProvider.jsx +14 -0
- package/dist/BrandProvider.jsx.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +23 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Augmenting Integrations LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Brand } from "./index.js";
|
|
3
|
+
export declare function BrandProvider({ brand, children, }: {
|
|
4
|
+
brand: Brand;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
export declare function useBrand(): Brand;
|
|
8
|
+
//# sourceMappingURL=BrandProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandProvider.d.ts","sourceRoot":"","sources":["../src/BrandProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAIxC,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAEA;AAED,wBAAgB,QAAQ,IAAI,KAAK,CAQhC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const BrandContext = React.createContext(null);
|
|
4
|
+
export function BrandProvider({ brand, children, }) {
|
|
5
|
+
return <BrandContext.Provider value={brand}>{children}</BrandContext.Provider>;
|
|
6
|
+
}
|
|
7
|
+
export function useBrand() {
|
|
8
|
+
const brand = React.useContext(BrandContext);
|
|
9
|
+
if (!brand) {
|
|
10
|
+
throw new Error("useBrand() must be used inside <BrandProvider>. Pass your app's brand.json as the `brand` prop.");
|
|
11
|
+
}
|
|
12
|
+
return brand;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=BrandProvider.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandProvider.jsx","sourceRoot":"","sources":["../src/BrandProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,YAAY,GAAG,KAAK,CAAC,aAAa,CAAe,IAAI,CAAC,CAAC;AAE7D,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,GAIT;IACC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme identifier. Apps can use any string — `@augmenting-integrations/themes` ships a base
|
|
3
|
+
* registry (`BASE_THEMES`) but apps register their own additional themes via
|
|
4
|
+
* the merged-registry pattern. There is no enum constraint here on purpose —
|
|
5
|
+
* each tenant invents its own brand themes.
|
|
6
|
+
*/
|
|
7
|
+
export type ThemeName = string;
|
|
8
|
+
export type Variant = "light" | "dark";
|
|
9
|
+
export type BrandContact = {
|
|
10
|
+
email: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
address?: {
|
|
13
|
+
line1: string;
|
|
14
|
+
line2?: string;
|
|
15
|
+
city: string;
|
|
16
|
+
state: string;
|
|
17
|
+
zip: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type BrandSocial = {
|
|
21
|
+
twitter?: string;
|
|
22
|
+
linkedin?: string;
|
|
23
|
+
github?: string;
|
|
24
|
+
};
|
|
25
|
+
export type BrandLogo = {
|
|
26
|
+
src: string;
|
|
27
|
+
alt: string;
|
|
28
|
+
darkSrc?: string;
|
|
29
|
+
};
|
|
30
|
+
export type BrandDefaults = {
|
|
31
|
+
theme: ThemeName;
|
|
32
|
+
publicVariant: Variant;
|
|
33
|
+
authedVariant: Variant;
|
|
34
|
+
};
|
|
35
|
+
export type Brand = {
|
|
36
|
+
name: string;
|
|
37
|
+
shortName: string;
|
|
38
|
+
tagline: string;
|
|
39
|
+
description: string;
|
|
40
|
+
logo: BrandLogo;
|
|
41
|
+
contact: BrandContact;
|
|
42
|
+
social?: BrandSocial;
|
|
43
|
+
defaults: BrandDefaults;
|
|
44
|
+
};
|
|
45
|
+
export { BrandProvider, useBrand } from "./BrandProvider.js";
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmDA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// src/BrandProvider.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
var BrandContext = React.createContext(null);
|
|
4
|
+
function BrandProvider({
|
|
5
|
+
brand,
|
|
6
|
+
children
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ React.createElement(BrandContext.Provider, { value: brand }, children);
|
|
9
|
+
}
|
|
10
|
+
function useBrand() {
|
|
11
|
+
const brand = React.useContext(BrandContext);
|
|
12
|
+
if (!brand) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"useBrand() must be used inside <BrandProvider>. Pass your app's brand.json as the `brand` prop."
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
return brand;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
BrandProvider,
|
|
21
|
+
useBrand
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/BrandProvider.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type { Brand } from \"./index.js\";\n\nconst BrandContext = React.createContext<Brand | null>(null);\n\nexport function BrandProvider({\n brand,\n children,\n}: {\n brand: Brand;\n children: React.ReactNode;\n}) {\n return <BrandContext.Provider value={brand}>{children}</BrandContext.Provider>;\n}\n\nexport function useBrand(): Brand {\n const brand = React.useContext(BrandContext);\n if (!brand) {\n throw new Error(\n \"useBrand() must be used inside <BrandProvider>. Pass your app's brand.json as the `brand` prop.\",\n );\n }\n return brand;\n}\n"],"mappings":";AAEA,YAAY,WAAW;AAGvB,IAAM,eAAqB,oBAA4B,IAAI;AAEpD,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,SAAO,oCAAC,aAAa,UAAb,EAAsB,OAAO,SAAQ,QAAS;AACxD;AAEO,SAAS,WAAkB;AAChC,QAAM,QAAc,iBAAW,YAAY;AAC3C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@augmenting-integrations/brand",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Tenant-agnostic brand reader and BrandProvider. Reads brand.json from the consuming app via a config injection pattern.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^19.0.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"react": "^19.0.0",
|
|
29
|
+
"tsup": "^8.3.5",
|
|
30
|
+
"typescript": "^5.7.2",
|
|
31
|
+
"vitest": "^4.1.5"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsup",
|
|
35
|
+
"clean": "rm -rf dist",
|
|
36
|
+
"test": "vitest run --passWithNoTests"
|
|
37
|
+
}
|
|
38
|
+
}
|