@inkeep/cxkit-primitives 0.5.112 → 0.5.113

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.d.cts CHANGED
@@ -1400,6 +1400,54 @@ declare const defaultInkeepBaseSettings: {
1400
1400
  '8xl': string;
1401
1401
  '9xl': string;
1402
1402
  };
1403
+ spacing: {
1404
+ 0: string;
1405
+ px: string;
1406
+ 0.5: string;
1407
+ 1: string;
1408
+ 1.5: string;
1409
+ 2: string;
1410
+ 2.5: string;
1411
+ 3: string;
1412
+ 3.5: string;
1413
+ 4: string;
1414
+ 5: string;
1415
+ 6: string;
1416
+ 7: string;
1417
+ 8: string;
1418
+ 9: string;
1419
+ 10: string;
1420
+ 11: string;
1421
+ 12: string;
1422
+ 14: string;
1423
+ 16: string;
1424
+ 20: string;
1425
+ 24: string;
1426
+ 28: string;
1427
+ 32: string;
1428
+ 36: string;
1429
+ 40: string;
1430
+ 44: string;
1431
+ 48: string;
1432
+ 52: string;
1433
+ 56: string;
1434
+ 60: string;
1435
+ 64: string;
1436
+ 72: string;
1437
+ 80: string;
1438
+ 96: string;
1439
+ };
1440
+ borderRadius: {
1441
+ none: string;
1442
+ sm: string;
1443
+ DEFAULT: string;
1444
+ md: string;
1445
+ lg: string;
1446
+ xl: string;
1447
+ '2xl': string;
1448
+ '3xl': string;
1449
+ full: string;
1450
+ };
1403
1451
  zIndex: {
1404
1452
  hide: number;
1405
1453
  auto: string;
package/dist/index.d.ts CHANGED
@@ -1400,6 +1400,54 @@ declare const defaultInkeepBaseSettings: {
1400
1400
  '8xl': string;
1401
1401
  '9xl': string;
1402
1402
  };
1403
+ spacing: {
1404
+ 0: string;
1405
+ px: string;
1406
+ 0.5: string;
1407
+ 1: string;
1408
+ 1.5: string;
1409
+ 2: string;
1410
+ 2.5: string;
1411
+ 3: string;
1412
+ 3.5: string;
1413
+ 4: string;
1414
+ 5: string;
1415
+ 6: string;
1416
+ 7: string;
1417
+ 8: string;
1418
+ 9: string;
1419
+ 10: string;
1420
+ 11: string;
1421
+ 12: string;
1422
+ 14: string;
1423
+ 16: string;
1424
+ 20: string;
1425
+ 24: string;
1426
+ 28: string;
1427
+ 32: string;
1428
+ 36: string;
1429
+ 40: string;
1430
+ 44: string;
1431
+ 48: string;
1432
+ 52: string;
1433
+ 56: string;
1434
+ 60: string;
1435
+ 64: string;
1436
+ 72: string;
1437
+ 80: string;
1438
+ 96: string;
1439
+ };
1440
+ borderRadius: {
1441
+ none: string;
1442
+ sm: string;
1443
+ DEFAULT: string;
1444
+ md: string;
1445
+ lg: string;
1446
+ xl: string;
1447
+ '2xl': string;
1448
+ '3xl': string;
1449
+ full: string;
1450
+ };
1403
1451
  zIndex: {
1404
1452
  hide: number;
1405
1453
  auto: string;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),t=require("react"),f=require("../atoms/api/analytics/events.cjs"),b=require("./config-provider.cjs"),x=require("./user-provider.cjs"),E=t.createContext(void 0),q=({children:e})=>{const{baseSettings:s,componentType:r}=b.useInkeepConfig(),{apiKey:i,analyticsApiBaseUrl:c,tags:a,privacyPreferences:m,env:g,analyticsProperties:v}=s,{userProperties:u}=x.useUser(),l=t.useMemo(()=>({widgetLibraryVersion:"0.5.112",componentType:r,tags:a}),[r,a]),d=!m.optOutAllAnalytics&&g!=="development",P={logEvent:t.useCallback(async n=>{const o={...l,...n.properties,...v},p={eventName:n.eventName,properties:o,userProperties:u},y=["modal_opened","modal_closed"].includes(n.eventName);if(d&&!y){if("conversation"in o&&!o.conversation?.id)return;f.logEvent(p,i,c)}s.onEvent?.(p)},[d,s,i,c,u,l,v])};return B.jsx(E.Provider,{value:P,children:e})},C=()=>{const e=t.useContext(E);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=q;exports.useBaseEvents=C;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),t=require("react"),f=require("../atoms/api/analytics/events.cjs"),b=require("./config-provider.cjs"),x=require("./user-provider.cjs"),E=t.createContext(void 0),q=({children:e})=>{const{baseSettings:s,componentType:r}=b.useInkeepConfig(),{apiKey:i,analyticsApiBaseUrl:c,tags:a,privacyPreferences:m,env:g,analyticsProperties:v}=s,{userProperties:u}=x.useUser(),l=t.useMemo(()=>({widgetLibraryVersion:"0.5.113",componentType:r,tags:a}),[r,a]),d=!m.optOutAllAnalytics&&g!=="development",P={logEvent:t.useCallback(async n=>{const o={...l,...n.properties,...v},p={eventName:n.eventName,properties:o,userProperties:u},y=["modal_opened","modal_closed"].includes(n.eventName);if(d&&!y){if("conversation"in o&&!o.conversation?.id)return;f.logEvent(p,i,c)}s.onEvent?.(p)},[d,s,i,c,u,l,v])};return B.jsx(E.Provider,{value:P,children:e})},C=()=>{const e=t.useContext(E);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=q;exports.useBaseEvents=C;
@@ -7,7 +7,7 @@ import { useUser as A } from "./user-provider.js";
7
7
  const u = B(void 0), $ = ({ children: e }) => {
8
8
  const { baseSettings: t, componentType: s } = w(), { apiKey: r, analyticsApiBaseUrl: i, tags: a, privacyPreferences: d, env: E, analyticsProperties: c } = t, { userProperties: v } = A(), p = P(
9
9
  () => ({
10
- widgetLibraryVersion: "0.5.112",
10
+ widgetLibraryVersion: "0.5.113",
11
11
  componentType: s,
12
12
  tags: a
13
13
  }),
@@ -1,3 +1,3 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("@inkeep/cxkit-theme"),D=require("@inkeep/cxkit-color-mode"),H=require("./config-provider.cjs"),L=require("merge-anything"),z=require("../atoms/custom-styles.cjs"),i=require("react"),E=({children:g})=>{const{baseSettings:y}=H.useInkeepConfig(),{theme:s,primaryBrandColor:h,shadowHost:f,rootElement:b,colorMode:S}=y,{primaryColors:C,varsClassName:M}=s,{disableLoadingDefaultFont:p,fontFamily:v,fontSize:x,zIndex:q}=s,k=m.createColorScheme(C,h),T={colors:L.merge(s.colors,k),fontFamily:v,fontSize:x,zIndex:q},j=m.createCSSVariables(T),{customStyles:I,loaded:w}=z.useCustomStyles(),{sync:e,forcedColorMode:P,...F}=S??{},[R,l]=i.useState(),V=i.useRef(null);return i.useEffect(()=>{if(!e?.target)return;const o=typeof e.target=="string"?document.querySelector(e.target):e.target;if(!o)return;function a(c,r){return r.reduce((A,d)=>({...A,[d]:c.getAttribute(d)}),{})}const n=new MutationObserver(()=>{const c=a(o,e.attributes),r=e.isDarkMode?.(c)?"dark":"light";e.onChange?.(r),l(r)});n.observe(o,{attributes:!0,attributeFilter:e.attributes,childList:!1,subtree:!1}),V.current=n;const u=e.isDarkMode?.(a(o,e?.attributes))?"dark":"light";return e.onChange?.(u),l(u),()=>n.disconnect()},[e]),t.jsxs(t.Fragment,{children:[!p&&t.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:`
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),m=require("@inkeep/cxkit-theme"),L=require("@inkeep/cxkit-color-mode"),z=require("./config-provider.cjs"),E=require("merge-anything"),N=require("../atoms/custom-styles.cjs"),i=require("react"),O=({children:g})=>{const{baseSettings:y}=z.useInkeepConfig(),{theme:s,primaryBrandColor:h,shadowHost:f,rootElement:b,colorMode:S}=y,{primaryColors:C,varsClassName:M}=s,{disableLoadingDefaultFont:p,fontFamily:v,fontSize:x,spacing:q,borderRadius:k,zIndex:T}=s,j=m.createColorScheme(C,h),I={colors:E.merge(s.colors,j),fontFamily:v,fontSize:x,spacing:q,borderRadius:k,zIndex:T},w=m.createCSSVariables(I),{customStyles:P,loaded:R}=N.useCustomStyles(),{sync:e,forcedColorMode:F,...V}=S??{},[A,l]=i.useState(),D=i.useRef(null);return i.useEffect(()=>{if(!e?.target)return;const o=typeof e.target=="string"?document.querySelector(e.target):e.target;if(!o)return;function a(c,r){return r.reduce((H,d)=>({...H,[d]:c.getAttribute(d)}),{})}const n=new MutationObserver(()=>{const c=a(o,e.attributes),r=e.isDarkMode?.(c)?"dark":"light";e.onChange?.(r),l(r)});n.observe(o,{attributes:!0,attributeFilter:e.attributes,childList:!1,subtree:!1}),D.current=n;const u=e.isDarkMode?.(a(o,e?.attributes))?"dark":"light";return e.onChange?.(u),l(u),()=>n.disconnect()},[e]),t.jsxs(t.Fragment,{children:[!p&&t.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:`
2
2
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
3
- `}}),I,w&&t.jsx(D.ColorModeProvider,{forcedColorMode:P??R,...F,shadowHostId:f?.id,rootId:b?.id,children:t.jsx("div",{className:M,style:{display:"contents",...j},children:g})})]})};exports.ThemeProvider=E;
3
+ `}}),P,R&&t.jsx(L.ColorModeProvider,{forcedColorMode:F??A,...V,shadowHostId:f?.id,rootId:b?.id,children:t.jsx("div",{className:M,style:{display:"contents",...w},children:g})})]})};exports.ThemeProvider=O;
@@ -1,26 +1,28 @@
1
1
  "use client";
2
- import { jsxs as j, Fragment as z, jsx as c } from "react/jsx-runtime";
3
- import { createColorScheme as A, createCSSVariables as E } from "@inkeep/cxkit-theme";
4
- import { ColorModeProvider as N } from "@inkeep/cxkit-color-mode";
5
- import { useInkeepConfig as P } from "./config-provider.js";
6
- import { merge as R } from "merge-anything";
7
- import { useCustomStyles as _ } from "../atoms/custom-styles.js";
8
- import { useState as q, useRef as B, useEffect as O } from "react";
9
- const Z = ({ children: u }) => {
10
- const { baseSettings: m } = P(), { theme: r, primaryBrandColor: f, shadowHost: g, rootElement: p, colorMode: y } = m, { primaryColors: h, varsClassName: b } = r, { disableLoadingDefaultFont: C, fontFamily: M, fontSize: S, zIndex: v } = r, I = A(h, f), k = {
11
- colors: R(r.colors, I),
2
+ import { jsxs as z, Fragment as A, jsx as c } from "react/jsx-runtime";
3
+ import { createColorScheme as E, createCSSVariables as N } from "@inkeep/cxkit-theme";
4
+ import { ColorModeProvider as P } from "@inkeep/cxkit-color-mode";
5
+ import { useInkeepConfig as _ } from "./config-provider.js";
6
+ import { merge as q } from "merge-anything";
7
+ import { useCustomStyles as B } from "../atoms/custom-styles.js";
8
+ import { useState as O, useRef as G, useEffect as J } from "react";
9
+ const ee = ({ children: u }) => {
10
+ const { baseSettings: m } = _(), { theme: r, primaryBrandColor: f, shadowHost: g, rootElement: p, colorMode: y } = m, { primaryColors: h, varsClassName: b } = r, { disableLoadingDefaultFont: C, fontFamily: M, fontSize: S, spacing: v, borderRadius: I, zIndex: k } = r, w = E(h, f), x = {
11
+ colors: q(r.colors, w),
12
12
  fontFamily: M,
13
13
  fontSize: S,
14
- zIndex: v
15
- }, w = E(k), { customStyles: x, loaded: F } = _(), { sync: e, forcedColorMode: T, ...V } = y ?? {}, [D, a] = q(), H = B(null);
16
- return O(() => {
14
+ spacing: v,
15
+ borderRadius: I,
16
+ zIndex: k
17
+ }, F = N(x), { customStyles: T, loaded: V } = B(), { sync: e, forcedColorMode: D, ...H } = y ?? {}, [L, a] = O(), R = G(null);
18
+ return J(() => {
17
19
  if (!e?.target) return;
18
20
  const t = typeof e.target == "string" ? document.querySelector(e.target) : e.target;
19
21
  if (!t) return;
20
22
  function i(n, o) {
21
23
  return o.reduce(
22
- (L, d) => ({
23
- ...L,
24
+ (j, d) => ({
25
+ ...j,
24
26
  [d]: n.getAttribute(d)
25
27
  }),
26
28
  {}
@@ -35,10 +37,10 @@ const Z = ({ children: u }) => {
35
37
  attributeFilter: e.attributes,
36
38
  childList: !1,
37
39
  subtree: !1
38
- }), H.current = s;
40
+ }), R.current = s;
39
41
  const l = e.isDarkMode?.(i(t, e?.attributes)) ? "dark" : "light";
40
42
  return e.onChange?.(l), a(l), () => s.disconnect();
41
- }, [e]), /* @__PURE__ */ j(z, { children: [
43
+ }, [e]), /* @__PURE__ */ z(A, { children: [
42
44
  !C && /* @__PURE__ */ c(
43
45
  "style",
44
46
  {
@@ -50,12 +52,12 @@ const Z = ({ children: u }) => {
50
52
  }
51
53
  }
52
54
  ),
53
- x,
54
- F && /* @__PURE__ */ c(
55
- N,
55
+ T,
56
+ V && /* @__PURE__ */ c(
57
+ P,
56
58
  {
57
- forcedColorMode: T ?? D,
58
- ...V,
59
+ forcedColorMode: D ?? L,
60
+ ...H,
59
61
  shadowHostId: g?.id,
60
62
  rootId: p?.id,
61
63
  children: /* @__PURE__ */ c(
@@ -64,7 +66,7 @@ const Z = ({ children: u }) => {
64
66
  className: b,
65
67
  style: {
66
68
  display: "contents",
67
- ...w
69
+ ...F
68
70
  },
69
71
  children: u
70
72
  }
@@ -74,5 +76,5 @@ const Z = ({ children: u }) => {
74
76
  ] });
75
77
  };
76
78
  export {
77
- Z as ThemeProvider
79
+ ee as ThemeProvider
78
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/cxkit-primitives",
3
- "version": "0.5.112",
3
+ "version": "0.5.113",
4
4
  "description": "",
5
5
  "license": "Inkeep, Inc. Customer License (IICL) v1.1",
6
6
  "homepage": "",
@@ -67,9 +67,9 @@
67
67
  "remark-gfm": "^4.0.1",
68
68
  "unist-util-visit": "^5.0.0",
69
69
  "use-sync-external-store": "^1.4.0",
70
- "@inkeep/cxkit-color-mode": "^0.5.112",
71
- "@inkeep/cxkit-theme": "0.5.112",
72
- "@inkeep/cxkit-types": "0.5.112"
70
+ "@inkeep/cxkit-color-mode": "^0.5.113",
71
+ "@inkeep/cxkit-theme": "0.5.113",
72
+ "@inkeep/cxkit-types": "0.5.113"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@biomejs/biome": "1.9.4",