@augmenting-integrations/brand 0.2.1 → 0.2.2

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 ADDED
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ BrandProvider: () => BrandProvider,
34
+ useBrand: () => useBrand
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // src/BrandProvider.tsx
39
+ var React = __toESM(require("react"));
40
+ var BrandContext = React.createContext(null);
41
+ function BrandProvider({
42
+ brand,
43
+ children
44
+ }) {
45
+ return /* @__PURE__ */ React.createElement(BrandContext.Provider, { value: brand }, children);
46
+ }
47
+ function useBrand() {
48
+ const brand = React.useContext(BrandContext);
49
+ if (!brand) {
50
+ throw new Error(
51
+ "useBrand() must be used inside <BrandProvider>. Pass your app's brand.json as the `brand` prop."
52
+ );
53
+ }
54
+ return brand;
55
+ }
56
+ // Annotate the CommonJS export names for ESM import in node:
57
+ 0 && (module.exports = {
58
+ BrandProvider,
59
+ useBrand
60
+ });
61
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/BrandProvider.tsx"],"sourcesContent":["/**\n * Theme identifier. Apps can use any string — `@augmenting-integrations/themes` ships a base\n * registry (`BASE_THEMES`) but apps register their own additional themes via\n * the merged-registry pattern. There is no enum constraint here on purpose —\n * each tenant invents its own brand themes.\n */\nexport type ThemeName = string;\n\nexport type Variant = \"light\" | \"dark\";\n\nexport type BrandContact = {\n email: string;\n phone?: string;\n address?: {\n line1: string;\n line2?: string;\n city: string;\n state: string;\n zip: string;\n };\n};\n\nexport type BrandSocial = {\n twitter?: string;\n linkedin?: string;\n github?: string;\n};\n\nexport type BrandLogo = {\n src: string;\n alt: string;\n darkSrc?: string;\n};\n\nexport type BrandDefaults = {\n theme: ThemeName;\n publicVariant: Variant;\n authedVariant: Variant;\n};\n\nexport type Brand = {\n name: string;\n shortName: string;\n tagline: string;\n description: string;\n logo: BrandLogo;\n contact: BrandContact;\n social?: BrandSocial;\n defaults: BrandDefaults;\n};\n\nexport { BrandProvider, useBrand } from \"./BrandProvider.js\";\n","\"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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,YAAuB;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/dist/index.js CHANGED
@@ -1,2 +1,23 @@
1
- export { BrandProvider, useBrand } from "./BrandProvider.js";
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
+ };
2
23
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmDA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augmenting-integrations/brand",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Tenant-agnostic brand reader and BrandProvider. Reads brand.json from the consuming app via a config injection pattern.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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.mjs DELETED
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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":[]}