@augmenting-integrations/brand 0.2.1 → 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.
@@ -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":[]}
@@ -1,11 +1,12 @@
1
- // src/BrandProvider.tsx
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import * as React from "react";
3
- var BrandContext = React.createContext(null);
4
+ const BrandContext = React.createContext(null);
4
5
  function BrandProvider({
5
6
  brand,
6
7
  children
7
8
  }) {
8
- return /* @__PURE__ */ React.createElement(BrandContext.Provider, { value: brand }, children);
9
+ return /* @__PURE__ */ jsx(BrandContext.Provider, { value: brand, children });
9
10
  }
10
11
  function useBrand() {
11
12
  const brand = React.useContext(BrandContext);
@@ -20,4 +21,4 @@ export {
20
21
  BrandProvider,
21
22
  useBrand
22
23
  };
23
- //# sourceMappingURL=index.mjs.map
24
+ //# sourceMappingURL=BrandProvider.js.map
@@ -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/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 ADDED
@@ -0,0 +1,31 @@
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
+ var index_exports = {};
20
+ __export(index_exports, {
21
+ BrandProvider: () => import_BrandProvider.BrandProvider,
22
+ useBrand: () => import_BrandProvider.useBrand
23
+ });
24
+ module.exports = __toCommonJS(index_exports);
25
+ var import_BrandProvider = require("./BrandProvider.js");
26
+ // Annotate the CommonJS export names for ESM import in node:
27
+ 0 && (module.exports = {
28
+ BrandProvider,
29
+ useBrand
30
+ });
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
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,2 +1,6 @@
1
- export { BrandProvider, useBrand } from "./BrandProvider.js";
1
+ import { BrandProvider, useBrand } from "./BrandProvider.js";
2
+ export {
3
+ BrandProvider,
4
+ useBrand
5
+ };
2
6
  //# 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/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.1",
3
+ "version": "1.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": {
@@ -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"}