@augmenting-integrations/brand 0.2.2 → 2.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.
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var BrandProvider_exports = {};
31
+ __export(BrandProvider_exports, {
32
+ BrandProvider: () => BrandProvider,
33
+ useBrand: () => useBrand
34
+ });
35
+ module.exports = __toCommonJS(BrandProvider_exports);
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var React = __toESM(require("react"));
38
+ const BrandContext = React.createContext(null);
39
+ function BrandProvider({
40
+ brand,
41
+ children
42
+ }) {
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BrandContext.Provider, { value: brand, children });
44
+ }
45
+ function useBrand() {
46
+ const brand = React.useContext(BrandContext);
47
+ if (!brand) {
48
+ throw new Error(
49
+ "useBrand() must be used inside <BrandProvider>. Pass your app's brand.json as the `brand` prop."
50
+ );
51
+ }
52
+ return brand;
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ BrandProvider,
57
+ useBrand
58
+ });
59
+ //# sourceMappingURL=BrandProvider.cjs.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcS;AAZT,YAAuB;AAGvB,MAAM,eAAe,MAAM,cAA4B,IAAI;AAEpD,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,SAAO,4CAAC,aAAa,UAAb,EAAsB,OAAO,OAAQ,UAAS;AACxD;AAEO,SAAS,WAAkB;AAChC,QAAM,QAAQ,MAAM,WAAW,YAAY;AAC3C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ const BrandContext = React.createContext(null);
5
+ function BrandProvider({
6
+ brand,
7
+ children
8
+ }) {
9
+ return /* @__PURE__ */ jsx(BrandContext.Provider, { value: brand, children });
10
+ }
11
+ function useBrand() {
12
+ const brand = React.useContext(BrandContext);
13
+ if (!brand) {
14
+ throw new Error(
15
+ "useBrand() must be used inside <BrandProvider>. Pass your app's brand.json as the `brand` prop."
16
+ );
17
+ }
18
+ return brand;
19
+ }
20
+ export {
21
+ BrandProvider,
22
+ useBrand
23
+ };
24
+ //# sourceMappingURL=BrandProvider.js.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":";AAcS;AAZT,YAAY,WAAW;AAGvB,MAAM,eAAe,MAAM,cAA4B,IAAI;AAEpD,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AACF,GAGG;AACD,SAAO,oBAAC,aAAa,UAAb,EAAsB,OAAO,OAAQ,UAAS;AACxD;AAEO,SAAS,WAAkB;AAChC,QAAM,QAAQ,MAAM,WAAW,YAAY;AAC3C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
package/dist/index.cjs CHANGED
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,42 +15,14 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
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
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
19
  var index_exports = {};
32
20
  __export(index_exports, {
33
- BrandProvider: () => BrandProvider,
34
- useBrand: () => useBrand
21
+ BrandProvider: () => import_BrandProvider.BrandProvider,
22
+ useBrand: () => import_BrandProvider.useBrand
35
23
  });
36
24
  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
- }
25
+ var import_BrandProvider = require("./BrandProvider.js");
56
26
  // Annotate the CommonJS export names for ESM import in node:
57
27
  0 && (module.exports = {
58
28
  BrandProvider,
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDA,2BAAwC;","names":[]}
package/dist/index.js CHANGED
@@ -1,21 +1,4 @@
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
- }
1
+ import { BrandProvider, useBrand } from "./BrandProvider.js";
19
2
  export {
20
3
  BrandProvider,
21
4
  useBrand
package/dist/index.js.map CHANGED
@@ -1 +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":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"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"],"mappings":"AAmDA,SAAS,eAAe,gBAAgB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@augmenting-integrations/brand",
3
- "version": "0.2.2",
3
+ "version": "2.0.0",
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": {