react-semaphor 0.1.461 → 0.1.463

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.
Files changed (37) hide show
  1. package/dist/appearance-runtime/index.cjs +1 -0
  2. package/dist/appearance-runtime/index.js +5 -0
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +1 -1
  5. package/dist/chunks/appearance-context-DVXt8qjW.js +126 -0
  6. package/dist/chunks/appearance-context-DhyjbQk1.cjs +1 -0
  7. package/dist/chunks/appearance-runtime-provider-BgNYdUYH.cjs +1 -0
  8. package/dist/chunks/appearance-runtime-provider-CjmE4gBY.js +81 -0
  9. package/dist/chunks/{dashboard-briefing-launcher-3owMxX5K.js → dashboard-briefing-launcher-Dcfh50rg.js} +1264 -1260
  10. package/dist/chunks/dashboard-briefing-launcher-Dyf9-SMG.cjs +26 -0
  11. package/dist/chunks/{dashboard-controls-B4GvjGr1.js → dashboard-controls-Cux9l7G3.js} +8 -6
  12. package/dist/chunks/{dashboard-controls-Bpm_xOXQ.cjs → dashboard-controls-Dk_4fD9Y.cjs} +1 -1
  13. package/dist/chunks/dashboard-json-6vY_UIQ9.cjs +1 -0
  14. package/dist/chunks/{dashboard-json-DzyxoBp-.js → dashboard-json-CLSh4K-P.js} +12 -10
  15. package/dist/chunks/{edit-dashboard-visual-1T278Nr_.cjs → edit-dashboard-visual-BNNbxMoA.cjs} +28 -28
  16. package/dist/chunks/{edit-dashboard-visual-nwSasO_j.js → edit-dashboard-visual-WYIa0u5O.js} +854 -852
  17. package/dist/chunks/{editor-action-buttons-CX1Pken3.cjs → editor-action-buttons-B1QYcu9f.cjs} +1 -1
  18. package/dist/chunks/{editor-action-buttons-Dqw0asfA.js → editor-action-buttons-DfKOZoQs.js} +2 -2
  19. package/dist/chunks/{index-B1qplNxl.cjs → index-BnsIn34X.cjs} +183 -183
  20. package/dist/chunks/{index-DazD5k0F.js → index-BxQ_lHnZ.js} +28144 -28185
  21. package/dist/chunks/{report-preferences-dialog-DKPyjiCt.cjs → report-preferences-dialog-Cd7yCULW.cjs} +1 -1
  22. package/dist/chunks/{report-preferences-dialog-Dv3vCCFt.js → report-preferences-dialog-jy8Ck1pK.js} +2 -2
  23. package/dist/chunks/{switch-DBZsEV0U.cjs → switch-CNqDn5b8.cjs} +26 -26
  24. package/dist/chunks/{switch-kPUJEC1A.js → switch-G_-UwdXX.js} +2721 -2842
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/data-app-builder/index.cjs +1 -1
  28. package/dist/data-app-builder/index.js +2 -2
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +152 -150
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +2 -2
  34. package/dist/types/appearance-runtime.d.ts +151 -0
  35. package/package.json +8 -2
  36. package/dist/chunks/dashboard-briefing-launcher-xuGrw8H3.cjs +0 -26
  37. package/dist/chunks/dashboard-json-yLM01xK4.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../chunks/appearance-runtime-provider-BgNYdUYH.cjs");exports.AppearanceRuntimeProvider=e.AppearanceRuntimeProvider;
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { A as a } from "../chunks/appearance-runtime-provider-CjmE4gBY.js";
3
+ export {
4
+ a as AppearanceRuntimeProvider
5
+ };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-DBZsEV0U.cjs"),oe=require("../chunks/color-CyB5o13F.cjs"),L=require("../chunks/x-B6ghREd2.cjs");require("../chunks/saved-temporal-bucket-format-3QKveR3v.cjs");require("../chunks/validators-dJlwubP4.cjs");require("../chunks/analyze-result-contract-DSGoFuXQ.cjs");require("../value-format-preferences/index.cjs");const W=require("../chunks/index-ByFbacH7.cjs"),_=require("../chunks/palette-BN-jYtaK.cjs"),fe=require("../chunks/braces-v55uLCAK.cjs"),me=require("../chunks/save-3dYRmehL.cjs"),xe=require("../chunks/layout-grid-xm8pqtx0.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-CNqDn5b8.cjs"),oe=require("../chunks/color-CyB5o13F.cjs"),L=require("../chunks/x-B6ghREd2.cjs");require("../chunks/saved-temporal-bucket-format-3QKveR3v.cjs");require("../chunks/validators-dJlwubP4.cjs");require("../chunks/analyze-result-contract-DSGoFuXQ.cjs");require("../value-format-preferences/index.cjs");const W=require("../chunks/index-ByFbacH7.cjs"),_=require("../chunks/palette-BN-jYtaK.cjs"),fe=require("../chunks/braces-v55uLCAK.cjs"),me=require("../chunks/save-3dYRmehL.cjs"),xe=require("../chunks/layout-grid-xm8pqtx0.cjs");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
1
  import { jsxs as d, jsx as r, Fragment as ce } from "react/jsx-runtime";
2
2
  import m from "react";
3
- import { c as q, P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, L as le, S as se, d as Je, T as je, F as Le, G as U, H as $e, I as M, J as _e, K as Ve, M as Ue, N as Me, O as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/switch-kPUJEC1A.js";
3
+ import { c as q, P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, L as le, S as se, d as Je, T as je, F as Le, G as U, H as $e, I as M, J as _e, K as Ve, M as Ue, N as Me, O as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/switch-G_-UwdXX.js";
4
4
  import { A as We, p as He } from "../chunks/color-CJvdlFM_.js";
5
5
  import { c as ae, X as Xe } from "../chunks/x-CXDkqdur.js";
6
6
  import "../chunks/saved-temporal-bucket-format-Dd2eixTH.js";
@@ -0,0 +1,126 @@
1
+ import { createContext as g, useContext as C } from "react";
2
+ import { c as E } from "./color-CJvdlFM_.js";
3
+ import { S as v, a as _, r as k } from "./index-DSKR3nKn.js";
4
+ const P = {
5
+ background: "--semaphor-background",
6
+ foreground: "--semaphor-foreground",
7
+ muted: "--semaphor-muted",
8
+ mutedForeground: "--semaphor-muted-foreground",
9
+ border: "--semaphor-border",
10
+ input: "--semaphor-input",
11
+ primary: "--semaphor-primary",
12
+ primaryForeground: "--semaphor-primary-foreground",
13
+ accent: "--semaphor-accent",
14
+ accentForeground: "--semaphor-accent-foreground",
15
+ card: "--semaphor-card",
16
+ cardForeground: "--semaphor-card-foreground",
17
+ positive: "--semaphor-positive",
18
+ negative: "--semaphor-negative",
19
+ warning: "--semaphor-warning",
20
+ info: "--semaphor-info",
21
+ destructive: "--semaphor-destructive",
22
+ destructiveForeground: "--semaphor-destructive-foreground"
23
+ }, R = {
24
+ light: {
25
+ "--semaphor-code-string": "158 64% 22%",
26
+ "--semaphor-code-number": "158 64% 22%",
27
+ "--semaphor-code-boolean": "158 64% 22%",
28
+ "--semaphor-code-fn": "217 91% 40%",
29
+ "--semaphor-code-keyword": "263 70% 42%"
30
+ },
31
+ dark: {
32
+ "--semaphor-code-string": "158 64% 52%",
33
+ "--semaphor-code-number": "158 64% 52%",
34
+ "--semaphor-code-boolean": "158 64% 52%",
35
+ "--semaphor-code-fn": "213 94% 68%",
36
+ "--semaphor-code-keyword": "264 89% 74%"
37
+ }
38
+ };
39
+ function T(o) {
40
+ var a, c, s, d, f, h, u, i;
41
+ const e = o.defaults ?? v, n = o.mode ?? O(o.spec.mode, o.systemMode), r = o.spec.schemes[n] ?? e.schemes[n], m = ((a = r.tokens) == null ? void 0 : a.color) ?? {}, t = {
42
+ ...R[n]
43
+ };
44
+ for (const [p, A] of Object.entries(P)) {
45
+ const l = m[p];
46
+ if (!l) continue;
47
+ const F = E(l);
48
+ if (!F)
49
+ throw new Error(`Invalid compiled appearance color for ${p}`);
50
+ t[A] = F;
51
+ }
52
+ return z(t, (c = r.tokens) == null ? void 0 : c.radius), x(t, (s = r.tokens) == null ? void 0 : s.typography), {
53
+ mode: n,
54
+ scheme: r,
55
+ cssVariables: t,
56
+ colorValues: m,
57
+ chartPalette: ((f = (d = r.components) == null ? void 0 : d.chart) == null ? void 0 : f.palette) ?? ((u = (h = e.schemes[n].components) == null ? void 0 : h.chart) == null ? void 0 : u.palette) ?? _,
58
+ table: (i = r.components) == null ? void 0 : i.table
59
+ };
60
+ }
61
+ function x(o, e) {
62
+ e != null && e.fontFamily && (o["--semaphor-font-family"] = e.fontFamily), e != null && e.headingFontFamily && (o["--semaphor-heading-font-family"] = e.headingFontFamily), e != null && e.monoFontFamily && (o["--semaphor-mono-font-family"] = e.monoFontFamily), (e == null ? void 0 : e.baseFontSize) !== void 0 && (o["--semaphor-font-size"] = `${e.baseFontSize}px`);
63
+ }
64
+ function z(o, e) {
65
+ o["--semaphor-brand"] = o["--semaphor-primary"] ?? o["--semaphor-foreground"], o["--semaphor-secondary"] = o["--semaphor-accent"] ?? o["--semaphor-muted"], o["--semaphor-secondary-foreground"] = o["--semaphor-accent-foreground"] ?? o["--semaphor-foreground"], o["--semaphor-popover"] = o["--semaphor-card"] ?? o["--semaphor-background"], o["--semaphor-popover-foreground"] = o["--semaphor-card-foreground"] ?? o["--semaphor-foreground"], o["--semaphor-ring"] = o["--semaphor-primary"] ?? o["--semaphor-foreground"];
66
+ const n = S((e == null ? void 0 : e.control) ?? 5), r = S((e == null ? void 0 : e.card) ?? (e == null ? void 0 : e.control) ?? 5);
67
+ o["--semaphor-radius"] = n, o["--semaphor-control-radius"] = n, o["--semaphor-card-radius"] = r;
68
+ }
69
+ function S(o) {
70
+ return `${Number((o / 16).toFixed(4))}rem`;
71
+ }
72
+ function O(o, e = "light") {
73
+ return o === "system" ? e : o;
74
+ }
75
+ const w = T({
76
+ spec: k(),
77
+ mode: "light"
78
+ }), M = g(
79
+ D(
80
+ "semaphor-default-appearance",
81
+ w
82
+ )
83
+ );
84
+ function $() {
85
+ return C(M);
86
+ }
87
+ function D(o, e) {
88
+ return {
89
+ instanceId: o,
90
+ compiledAppearance: e,
91
+ scopeProps: H(o, e),
92
+ portalSnapshot: {
93
+ instanceId: o,
94
+ compiledAppearance: e
95
+ }
96
+ };
97
+ }
98
+ function H(o, e) {
99
+ return {
100
+ className: e.mode,
101
+ style: L(e),
102
+ "data-semaphor-theme": e.mode,
103
+ "data-semaphor-appearance-instance": o
104
+ };
105
+ }
106
+ function L(o) {
107
+ var t, a;
108
+ const e = {
109
+ colorScheme: o.mode
110
+ };
111
+ o.cssVariables["--semaphor-font-family"] && (e.fontFamily = "var(--semaphor-font-family)");
112
+ const r = (t = o.scheme.tokens) == null ? void 0 : t.typography, m = (a = v.schemes[o.mode].tokens) == null ? void 0 : a.typography;
113
+ (r == null ? void 0 : r.baseFontSize) !== void 0 && r.baseFontSize !== (m == null ? void 0 : m.baseFontSize) && (e.fontSize = r.baseFontSize);
114
+ for (const [c, s] of Object.entries(
115
+ o.cssVariables
116
+ ))
117
+ e[c] = s;
118
+ return e;
119
+ }
120
+ export {
121
+ M as A,
122
+ D as a,
123
+ P as b,
124
+ T as c,
125
+ $ as u
126
+ };
@@ -0,0 +1 @@
1
+ "use strict";const C=require("react"),g=require("./color-CyB5o13F.cjs"),d=require("./index-ByFbacH7.cjs"),E={background:"--semaphor-background",foreground:"--semaphor-foreground",muted:"--semaphor-muted",mutedForeground:"--semaphor-muted-foreground",border:"--semaphor-border",input:"--semaphor-input",primary:"--semaphor-primary",primaryForeground:"--semaphor-primary-foreground",accent:"--semaphor-accent",accentForeground:"--semaphor-accent-foreground",card:"--semaphor-card",cardForeground:"--semaphor-card-foreground",positive:"--semaphor-positive",negative:"--semaphor-negative",warning:"--semaphor-warning",info:"--semaphor-info",destructive:"--semaphor-destructive",destructiveForeground:"--semaphor-destructive-foreground"},k={light:{"--semaphor-code-string":"158 64% 22%","--semaphor-code-number":"158 64% 22%","--semaphor-code-boolean":"158 64% 22%","--semaphor-code-fn":"217 91% 40%","--semaphor-code-keyword":"263 70% 42%"},dark:{"--semaphor-code-string":"158 64% 52%","--semaphor-code-number":"158 64% 52%","--semaphor-code-boolean":"158 64% 52%","--semaphor-code-fn":"213 94% 68%","--semaphor-code-keyword":"264 89% 74%"}};function _(e){var a,c,s,u,f,p,h,i;const o=e.defaults??d.SEMAPHOR_DEFAULT_APPEARANCE_SPEC,n=e.mode??x(e.spec.mode,e.systemMode),r=e.spec.schemes[n]??o.schemes[n],m=((a=r.tokens)==null?void 0:a.color)??{},t={...k[n]};for(const[l,R]of Object.entries(E)){const A=m[l];if(!A)continue;const F=g.compileColorToHslTriplet(A);if(!F)throw new Error(`Invalid compiled appearance color for ${l}`);t[R]=F}return T(t,(c=r.tokens)==null?void 0:c.radius),O(t,(s=r.tokens)==null?void 0:s.typography),{mode:n,scheme:r,cssVariables:t,colorValues:m,chartPalette:((f=(u=r.components)==null?void 0:u.chart)==null?void 0:f.palette)??((h=(p=o.schemes[n].components)==null?void 0:p.chart)==null?void 0:h.palette)??d.SEMAPHOR_DEFAULT_CHART_PALETTE,table:(i=r.components)==null?void 0:i.table}}function O(e,o){o!=null&&o.fontFamily&&(e["--semaphor-font-family"]=o.fontFamily),o!=null&&o.headingFontFamily&&(e["--semaphor-heading-font-family"]=o.headingFontFamily),o!=null&&o.monoFontFamily&&(e["--semaphor-mono-font-family"]=o.monoFontFamily),(o==null?void 0:o.baseFontSize)!==void 0&&(e["--semaphor-font-size"]=`${o.baseFontSize}px`)}function T(e,o){e["--semaphor-brand"]=e["--semaphor-primary"]??e["--semaphor-foreground"],e["--semaphor-secondary"]=e["--semaphor-accent"]??e["--semaphor-muted"],e["--semaphor-secondary-foreground"]=e["--semaphor-accent-foreground"]??e["--semaphor-foreground"],e["--semaphor-popover"]=e["--semaphor-card"]??e["--semaphor-background"],e["--semaphor-popover-foreground"]=e["--semaphor-card-foreground"]??e["--semaphor-foreground"],e["--semaphor-ring"]=e["--semaphor-primary"]??e["--semaphor-foreground"];const n=S((o==null?void 0:o.control)??5),r=S((o==null?void 0:o.card)??(o==null?void 0:o.control)??5);e["--semaphor-radius"]=n,e["--semaphor-control-radius"]=n,e["--semaphor-card-radius"]=r}function S(e){return`${Number((e/16).toFixed(4))}rem`}function x(e,o="light"){return e==="system"?o:e}const z=_({spec:d.resolveAppearance(),mode:"light"}),v=C.createContext(P("semaphor-default-appearance",z));function L(){return C.useContext(v)}function P(e,o){return{instanceId:e,compiledAppearance:o,scopeProps:M(e,o),portalSnapshot:{instanceId:e,compiledAppearance:o}}}function M(e,o){return{className:o.mode,style:w(o),"data-semaphor-theme":o.mode,"data-semaphor-appearance-instance":e}}function w(e){var t,a;const o={colorScheme:e.mode};e.cssVariables["--semaphor-font-family"]&&(o.fontFamily="var(--semaphor-font-family)");const r=(t=e.scheme.tokens)==null?void 0:t.typography,m=(a=d.SEMAPHOR_DEFAULT_APPEARANCE_SPEC.schemes[e.mode].tokens)==null?void 0:a.typography;(r==null?void 0:r.baseFontSize)!==void 0&&r.baseFontSize!==(m==null?void 0:m.baseFontSize)&&(o.fontSize=r.baseFontSize);for(const[c,s]of Object.entries(e.cssVariables))o[c]=s;return o}exports.APPEARANCE_COLOR_CSS_VARS=E;exports.AppearanceContext=v;exports.compileAppearance=_;exports.createAppearanceContextValue=P;exports.useAppearance=L;
@@ -0,0 +1 @@
1
+ "use strict";const f=require("react/jsx-runtime"),r=require("react"),d=require("./appearance-context-DhyjbQk1.cjs"),y=require("./index-ByFbacH7.cjs"),T={theme:"system",setTheme:()=>null},l=r.createContext(T);function M(e,n="system"){return A(e)?e:n}function A(e){return e==="light"||e==="dark"||e==="system"}function C(e){return f.jsx(v,{...e})}function v({appearance:e,organizationAppearance:n,tokenAppearance:a,reactAppearance:i,resolvedAppearance:t,systemMode:o,children:m}){const s=r.useId(),c=r.useMemo(()=>I(s),[s]),{theme:x}=r.useContext(l),u=P(x),p=r.useMemo(()=>t??y.resolveAppearance({organizationAppearance:n,tokenAppearance:a,reactAppearance:i??e}),[e,n,i,t,a]),h=r.useMemo(()=>d.compileAppearance({spec:p,systemMode:o??u}),[p,u,o]),w=r.useMemo(()=>d.createAppearanceContextValue(c,h),[h,c]);return f.jsx(d.AppearanceContext.Provider,{value:w,children:m})}function I(e){return`semaphor-appearance-${e.replace(/[^a-zA-Z0-9_-]/g,"")}`}function P(e){const n=M(e),[a,i]=r.useState(()=>R());return r.useEffect(()=>{var m,s;if(n!=="system"||typeof window>"u")return;const t=(m=window.matchMedia)==null?void 0:m.call(window,"(prefers-color-scheme: dark)");if(!t)return;const o=()=>{i(t.matches?"dark":"light")};return o(),typeof t.addEventListener=="function"?(t.addEventListener("change",o),()=>t.removeEventListener("change",o)):((s=t.addListener)==null||s.call(t,o),()=>{var c;return(c=t.removeListener)==null?void 0:c.call(t,o)})},[n]),n==="system"?a:n}function R(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}exports.AppearanceRuntimeProvider=C;exports.InternalAppearanceRuntimeProvider=v;exports.ThemeProviderContext=l;exports.normalizeTheme=M;
@@ -0,0 +1,81 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import { createContext as w, useId as y, useMemo as m, useContext as M, useState as v, useEffect as A } from "react";
3
+ import { c as T, a as x, A as I } from "./appearance-context-DVXt8qjW.js";
4
+ import { r as g } from "./index-DSKR3nKn.js";
5
+ const k = {
6
+ theme: "system",
7
+ setTheme: () => null
8
+ }, C = w(k);
9
+ function L(e, n = "system") {
10
+ return S(e) ? e : n;
11
+ }
12
+ function S(e) {
13
+ return e === "light" || e === "dark" || e === "system";
14
+ }
15
+ function $(e) {
16
+ return /* @__PURE__ */ f(E, { ...e });
17
+ }
18
+ function E({
19
+ appearance: e,
20
+ organizationAppearance: n,
21
+ tokenAppearance: a,
22
+ reactAppearance: c,
23
+ resolvedAppearance: t,
24
+ systemMode: r,
25
+ children: i
26
+ }) {
27
+ const o = y(), s = m(() => P(o), [o]), { theme: h } = M(C), d = z(h), u = m(
28
+ () => t ?? g({
29
+ organizationAppearance: n,
30
+ tokenAppearance: a,
31
+ reactAppearance: c ?? e
32
+ }),
33
+ [
34
+ e,
35
+ n,
36
+ c,
37
+ t,
38
+ a
39
+ ]
40
+ ), p = m(
41
+ () => T({
42
+ spec: u,
43
+ systemMode: r ?? d
44
+ }),
45
+ [u, d, r]
46
+ ), l = m(
47
+ () => x(s, p),
48
+ [p, s]
49
+ );
50
+ return /* @__PURE__ */ f(I.Provider, { value: l, children: i });
51
+ }
52
+ function P(e) {
53
+ return `semaphor-appearance-${e.replace(/[^a-zA-Z0-9_-]/g, "")}`;
54
+ }
55
+ function z(e) {
56
+ const n = L(e), [a, c] = v(
57
+ () => R()
58
+ );
59
+ return A(() => {
60
+ var i, o;
61
+ if (n !== "system" || typeof window > "u") return;
62
+ const t = (i = window.matchMedia) == null ? void 0 : i.call(window, "(prefers-color-scheme: dark)");
63
+ if (!t) return;
64
+ const r = () => {
65
+ c(t.matches ? "dark" : "light");
66
+ };
67
+ return r(), typeof t.addEventListener == "function" ? (t.addEventListener("change", r), () => t.removeEventListener("change", r)) : ((o = t.addListener) == null || o.call(t, r), () => {
68
+ var s;
69
+ return (s = t.removeListener) == null ? void 0 : s.call(t, r);
70
+ });
71
+ }, [n]), n === "system" ? a : n;
72
+ }
73
+ function R() {
74
+ return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
75
+ }
76
+ export {
77
+ $ as A,
78
+ E as I,
79
+ C as T,
80
+ L as n
81
+ };