react-semaphor 0.1.569 → 0.1.571
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/appearance/index.js +6 -3
- package/dist/appearance-runtime/index.js +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +570 -432
- package/dist/briefings/index.js +2 -2
- package/dist/chunks/appearance-context-BwBp25ZG.js +162 -0
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +80 -0
- package/dist/chunks/assistant-chat-SkCraw2C.js +5940 -0
- package/dist/chunks/{bookmark-impact-Czg6FGt5.js → bookmark-impact-DCYD-6Fr.js} +1 -1
- package/dist/chunks/brand-BoUV0iHF.js +54 -0
- package/dist/chunks/{card-filter-builder-BS982X7x.js → card-filter-builder-D-aSYpyr.js} +72 -72
- package/dist/chunks/{comparison-window-caption-lLTgzOkM.js → comparison-window-caption-PtcDWvkN.js} +2 -2
- package/dist/chunks/{dashboard-BiYSbxZv.js → dashboard-B_w_ekUz.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Bdj7luOr.js → dashboard-briefing-launcher-_g1m2tJ3.js} +183 -182
- package/dist/chunks/{dashboard-controls-TViDsnb8.js → dashboard-controls-CY0gbcCt.js} +285 -280
- package/dist/chunks/{dashboard-json-Dg9dQd9U.js → dashboard-json-DsM79yem.js} +3 -3
- package/dist/chunks/{dates-BsPrWZIP.js → dates-RSEzJ9N7.js} +13 -12
- package/dist/chunks/edit-9df1zOWe.js +226 -0
- package/dist/chunks/{edit-dashboard-visual-C6hoIeEJ.js → edit-dashboard-visual-cX0FM-4i.js} +2256 -2268
- package/dist/chunks/{filter-reach-copy-hcQ4os0u.js → filter-reach-copy-thzt25Rc.js} +1303 -1226
- package/dist/chunks/{filter-value-text-CVxEEDVl.js → filter-value-text-DvvSNlho.js} +1 -1
- package/dist/chunks/index-BVKzKl5d.js +90 -0
- package/dist/chunks/{index-RNaTnE3m.js → index-CV_Kzou0.js} +233 -223
- package/dist/chunks/{index-G4q89J6O.js → index-y3HUzRNk.js} +61 -60
- package/dist/chunks/{layout-grid-BIcoFfdS.js → layout-grid-8rR-LPTk.js} +1 -1
- package/dist/chunks/{list-filter-C6tYkHyv.js → list-filter-C1-uTgjR.js} +1 -1
- package/dist/chunks/paintbrush-aR17Z3C9.js +27 -0
- package/dist/chunks/{palette-NjHOE_6B.js → palette-a5FCZKFI.js} +1 -1
- package/dist/chunks/{_commonjsHelpers-Bid1ZNYj.js → pickers-DkqmtnTL.js} +179 -166
- package/dist/chunks/{pivot-result-contract-expectations-DkmueDTW.js → pivot-result-contract-expectations-C-HnUKYe.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-Xc8_GFju.js → report-preferences-dialog-B_GXs91t.js} +79 -79
- package/dist/chunks/{resolve-dashboard-input-context-KqvcLcTM.js → resolve-dashboard-input-context-Lkbwycwe.js} +5179 -5391
- package/dist/chunks/resolver-DG_tfEpt.js +156 -0
- package/dist/chunks/{save-C6VmEJTA.js → save-D985VvYp.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BeXXyoD4.js → saved-dashboard-context-DC_TEd6y.js} +3 -3
- package/dist/chunks/schema-C9NPiIru.js +2568 -0
- package/dist/chunks/{semaphor-ready-indicator-BNkaANsG.js → semaphor-ready-indicator-CBQamwQY.js} +33931 -34031
- package/dist/chunks/{shelf-drop-preview-context-C_issPBA.js → shelf-drop-preview-context-Bkjf0XXw.js} +50 -50
- package/dist/chunks/{stored-dashboard-B6_StAty.js → stored-dashboard-C0hekXiI.js} +189 -188
- package/dist/chunks/{code-editor-BsxHzm9u.js → style-sheet-parts-C7qGZuH1.js} +2400 -2036
- package/dist/chunks/{table-export-sheet-BWP2joD1.js → table-export-sheet-CP8zSOhj.js} +1 -1
- package/dist/chunks/{temporal-input-presentation-scSWQXAB.js → temporal-input-presentation-CqbJjIuu.js} +14 -14
- package/dist/chunks/{upload-BRW4Mwrd.js → upload-CiGNKJ_0.js} +1 -1
- package/dist/chunks/{variable-draft-BQ3OMjvy.js → variable-draft-DvglU8yj.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +2064 -1946
- package/dist/format-utils/index.js +8 -8
- package/dist/index.js +332 -335
- package/dist/layouts/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/appearance/index.d.ts +1 -0
- package/dist/types/brand-studio/brand-studio-draft.d.ts +7 -0
- package/dist/types/brand-studio/index.d.ts +1 -1
- package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
- package/dist/types/components/providers/appearance-runtime-provider.d.ts +4 -1
- package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -2
- package/dist/types/components/sharing-and-management/utils/types.d.ts +0 -72
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -9
- package/dist/types/components/visual/data-table/utils/pagination-utils.d.ts +0 -19
- package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -1
- package/dist/types/lib/appearance/aliases.d.ts +42 -0
- package/dist/types/lib/appearance/compiler.d.ts +6 -0
- package/dist/types/lib/appearance/defaults.d.ts +6 -0
- package/dist/types/lib/appearance/index.d.ts +2 -0
- package/dist/types/lib/appearance/normalize-organization.d.ts +17 -0
- package/dist/types/lib/appearance/resolver.d.ts +2 -2
- package/dist/types/lib/appearance/types.d.ts +38 -1
- package/dist/types/lib/charts/types.d.ts +6 -2
- package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -1
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +0 -2
- package/dist/types/lib/dashboard-variables/types.d.ts +1 -6
- package/dist/types/lib/download-pdf.d.ts +0 -1
- package/dist/types/lib/hooks/use-dashboard.d.ts +3 -4
- package/dist/types/lib/stores/dashboard-store.d.ts +15 -6
- package/dist/types/lib/stores/editor-store.d.ts +0 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -1
- package/dist/types/lib/table-formatting/table-formatting-css.d.ts +0 -5
- package/dist/types/lib/types/common-types.d.ts +3 -52
- package/dist/types/lib/types/summary-types.d.ts +0 -5
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +4 -4
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +68 -68
- package/dist/types/shared/assistant-protocol/context.d.ts +18 -18
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +212 -42
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +30 -30
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-style/bounds.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/brand.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/edit-words.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/edit.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +20 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/legacy.d.ts +21 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/parse.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/pickers.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/types.d.ts +122 -0
- package/dist/types/shared/dashboard-authoring/dashboard-style/view.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +19 -0
- package/dist/types/shared/format-utils/matrix-continuation.d.ts +7 -7
- package/package.json +6 -3
- package/dist/chunks/appearance-context-DEYtWinQ.js +0 -126
- package/dist/chunks/appearance-runtime-provider-B-M8gwlZ.js +0 -81
- package/dist/chunks/assistant-chat-Dzf2Mbph.js +0 -8847
- package/dist/chunks/color-CJvdlFM_.js +0 -2162
- package/dist/chunks/index-CLIro-EG.js +0 -425
- package/dist/types/components/sharing-and-management/utils/group-types.d.ts +0 -105
|
@@ -47,23 +47,23 @@ export declare const matrixBatchResponseSchema: z.ZodDiscriminatedUnion<"kind",
|
|
|
47
47
|
encoding: z.ZodOptional<z.ZodLiteral<"gzip-base64">>;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
49
|
key: string;
|
|
50
|
-
content: string;
|
|
51
50
|
contentType: string;
|
|
51
|
+
content: string;
|
|
52
52
|
encoding?: "gzip-base64" | undefined;
|
|
53
53
|
}, {
|
|
54
54
|
key: string;
|
|
55
|
-
content: string;
|
|
56
55
|
contentType: string;
|
|
56
|
+
content: string;
|
|
57
57
|
encoding?: "gzip-base64" | undefined;
|
|
58
58
|
}>, {
|
|
59
59
|
key: string;
|
|
60
|
-
content: string;
|
|
61
60
|
contentType: string;
|
|
61
|
+
content: string;
|
|
62
62
|
encoding?: "gzip-base64" | undefined;
|
|
63
63
|
}, {
|
|
64
64
|
key: string;
|
|
65
|
-
content: string;
|
|
66
65
|
contentType: string;
|
|
66
|
+
content: string;
|
|
67
67
|
encoding?: "gzip-base64" | undefined;
|
|
68
68
|
}>, "many">;
|
|
69
69
|
deadlineAt: z.ZodNumber;
|
|
@@ -74,8 +74,8 @@ export declare const matrixBatchResponseSchema: z.ZodDiscriminatedUnion<"kind",
|
|
|
74
74
|
checkpointKey: string;
|
|
75
75
|
objects: {
|
|
76
76
|
key: string;
|
|
77
|
-
content: string;
|
|
78
77
|
contentType: string;
|
|
78
|
+
content: string;
|
|
79
79
|
encoding?: "gzip-base64" | undefined;
|
|
80
80
|
}[];
|
|
81
81
|
}, {
|
|
@@ -85,8 +85,8 @@ export declare const matrixBatchResponseSchema: z.ZodDiscriminatedUnion<"kind",
|
|
|
85
85
|
checkpointKey: string;
|
|
86
86
|
objects: {
|
|
87
87
|
key: string;
|
|
88
|
-
content: string;
|
|
89
88
|
contentType: string;
|
|
89
|
+
content: string;
|
|
90
90
|
encoding?: "gzip-base64" | undefined;
|
|
91
91
|
}[];
|
|
92
92
|
}>, z.ZodObject<{
|
|
@@ -115,8 +115,8 @@ export declare function parseMatrixBatchResponse(value: unknown, input: MatrixBa
|
|
|
115
115
|
checkpointKey: string;
|
|
116
116
|
objects: {
|
|
117
117
|
key: string;
|
|
118
|
-
content: string;
|
|
119
118
|
contentType: string;
|
|
119
|
+
content: string;
|
|
120
120
|
encoding?: "gzip-base64" | undefined;
|
|
121
121
|
}[];
|
|
122
122
|
} | {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.571",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"build": "node scripts/build.mjs",
|
|
114
114
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
115
115
|
"lint:regressions": "node scripts/lint-regressions.mjs",
|
|
116
|
-
"check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/matrix-conversion-imports.mjs && node scripts/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/kpi-figure-reads.mjs && node scripts/layout-engine.mjs && node scripts/text-variable-refs.mjs && node scripts/data-variable-derivation.mjs && node scripts/variable-name-allocation.mjs",
|
|
116
|
+
"check:guards": "node scripts/card-config-consumers.mjs && node scripts/components-entry-imports.mjs && node scripts/types-entry-imports.mjs && node scripts/card-query-assembly-imports.mjs && node scripts/matrix-conversion-imports.mjs && node scripts/legacy-table-type-references.mjs && node scripts/assistant-chat-imports.mjs && node scripts/filter-model-reads.mjs && node scripts/kpi-figure-reads.mjs && node scripts/layout-engine.mjs && node scripts/text-variable-refs.mjs && node scripts/data-variable-derivation.mjs && node scripts/variable-name-allocation.mjs && node scripts/unreached-modules.mjs && node scripts/dashboard-style-reads.mjs",
|
|
117
117
|
"preview": "vite preview",
|
|
118
118
|
"test": "vitest run",
|
|
119
119
|
"test:changed": "vitest run --changed",
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
"@dnd-kit/sortable": "^10.0.0",
|
|
148
148
|
"@dnd-kit/utilities": "^3.2.2",
|
|
149
149
|
"@floating-ui/react-dom": "^2.1.8",
|
|
150
|
+
"@lexical/clipboard": "^0.43.0",
|
|
150
151
|
"@lexical/link": "^0.43.0",
|
|
151
152
|
"@lexical/list": "^0.43.0",
|
|
152
153
|
"@lexical/react": "^0.43.0",
|
|
@@ -162,6 +163,7 @@
|
|
|
162
163
|
"@radix-ui/react-context-menu": "^2.2.15",
|
|
163
164
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
164
165
|
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
166
|
+
"@radix-ui/react-focus-scope": "^1.1.7",
|
|
165
167
|
"@radix-ui/react-hover-card": "^1.1.4",
|
|
166
168
|
"@radix-ui/react-icons": "^1.3.2",
|
|
167
169
|
"@radix-ui/react-label": "^2.1.1",
|
|
@@ -177,6 +179,7 @@
|
|
|
177
179
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
178
180
|
"@radix-ui/react-toggle": "^1.1.1",
|
|
179
181
|
"@radix-ui/react-tooltip": "^1.1.6",
|
|
182
|
+
"@radix-ui/react-visually-hidden": "^1.2.3",
|
|
180
183
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
181
184
|
"@tanstack/react-query": "^5.62.15",
|
|
182
185
|
"@tanstack/react-table": "^8.11.7",
|
|
@@ -202,7 +205,7 @@
|
|
|
202
205
|
"lodash.merge": "^4.6.2",
|
|
203
206
|
"lucide-react": "^0.453.0",
|
|
204
207
|
"ms": "^2.1.3",
|
|
205
|
-
"
|
|
208
|
+
"nanoid": "^3.3.11",
|
|
206
209
|
"prismjs": "^1.30.0",
|
|
207
210
|
"react-day-picker": "^9.9.0",
|
|
208
211
|
"react-error-boundary": "^4.1.2",
|
|
@@ -1,126 +0,0 @@
|
|
|
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-CLIro-EG.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
|
-
selection: "--semaphor-selection",
|
|
16
|
-
card: "--semaphor-card",
|
|
17
|
-
cardForeground: "--semaphor-card-foreground",
|
|
18
|
-
positive: "--semaphor-positive",
|
|
19
|
-
negative: "--semaphor-negative",
|
|
20
|
-
warning: "--semaphor-warning",
|
|
21
|
-
info: "--semaphor-info",
|
|
22
|
-
destructive: "--semaphor-destructive",
|
|
23
|
-
destructiveForeground: "--semaphor-destructive-foreground"
|
|
24
|
-
}, R = {
|
|
25
|
-
light: {
|
|
26
|
-
"--semaphor-code-string": "158 64% 22%",
|
|
27
|
-
"--semaphor-code-number": "158 64% 22%",
|
|
28
|
-
"--semaphor-code-boolean": "158 64% 22%",
|
|
29
|
-
"--semaphor-code-fn": "217 91% 40%",
|
|
30
|
-
"--semaphor-code-keyword": "263 70% 42%"
|
|
31
|
-
},
|
|
32
|
-
dark: {
|
|
33
|
-
"--semaphor-code-string": "158 64% 52%",
|
|
34
|
-
"--semaphor-code-number": "158 64% 52%",
|
|
35
|
-
"--semaphor-code-boolean": "158 64% 52%",
|
|
36
|
-
"--semaphor-code-fn": "213 94% 68%",
|
|
37
|
-
"--semaphor-code-keyword": "264 89% 74%"
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
function T(o) {
|
|
41
|
-
var a, c, s, d, f, h, u, i;
|
|
42
|
-
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 = {
|
|
43
|
-
...R[n]
|
|
44
|
-
};
|
|
45
|
-
for (const [p, A] of Object.entries(P)) {
|
|
46
|
-
const l = m[p];
|
|
47
|
-
if (!l) continue;
|
|
48
|
-
const F = E(l);
|
|
49
|
-
if (!F)
|
|
50
|
-
throw new Error(`Invalid compiled appearance color for ${p}`);
|
|
51
|
-
t[A] = F;
|
|
52
|
-
}
|
|
53
|
-
return z(t, (c = r.tokens) == null ? void 0 : c.radius), x(t, (s = r.tokens) == null ? void 0 : s.typography), {
|
|
54
|
-
mode: n,
|
|
55
|
-
scheme: r,
|
|
56
|
-
cssVariables: t,
|
|
57
|
-
colorValues: m,
|
|
58
|
-
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) ?? _,
|
|
59
|
-
table: (i = r.components) == null ? void 0 : i.table
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function x(o, e) {
|
|
63
|
-
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`);
|
|
64
|
-
}
|
|
65
|
-
function z(o, e) {
|
|
66
|
-
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"];
|
|
67
|
-
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);
|
|
68
|
-
o["--semaphor-radius"] = n, o["--semaphor-control-radius"] = n, o["--semaphor-card-radius"] = r;
|
|
69
|
-
}
|
|
70
|
-
function S(o) {
|
|
71
|
-
return `${Number((o / 16).toFixed(4))}rem`;
|
|
72
|
-
}
|
|
73
|
-
function O(o, e = "light") {
|
|
74
|
-
return o === "system" ? e : o;
|
|
75
|
-
}
|
|
76
|
-
const w = T({
|
|
77
|
-
spec: k(),
|
|
78
|
-
mode: "light"
|
|
79
|
-
}), M = g(
|
|
80
|
-
D(
|
|
81
|
-
"semaphor-default-appearance",
|
|
82
|
-
w
|
|
83
|
-
)
|
|
84
|
-
);
|
|
85
|
-
function $() {
|
|
86
|
-
return C(M);
|
|
87
|
-
}
|
|
88
|
-
function D(o, e) {
|
|
89
|
-
return {
|
|
90
|
-
instanceId: o,
|
|
91
|
-
compiledAppearance: e,
|
|
92
|
-
scopeProps: H(o, e),
|
|
93
|
-
portalSnapshot: {
|
|
94
|
-
instanceId: o,
|
|
95
|
-
compiledAppearance: e
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function H(o, e) {
|
|
100
|
-
return {
|
|
101
|
-
className: e.mode,
|
|
102
|
-
style: L(e),
|
|
103
|
-
"data-semaphor-theme": e.mode,
|
|
104
|
-
"data-semaphor-appearance-instance": o
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
function L(o) {
|
|
108
|
-
var t, a;
|
|
109
|
-
const e = {
|
|
110
|
-
colorScheme: o.mode
|
|
111
|
-
};
|
|
112
|
-
o.cssVariables["--semaphor-font-family"] && (e.fontFamily = "var(--semaphor-font-family)");
|
|
113
|
-
const r = (t = o.scheme.tokens) == null ? void 0 : t.typography, m = (a = v.schemes[o.mode].tokens) == null ? void 0 : a.typography;
|
|
114
|
-
(r == null ? void 0 : r.baseFontSize) !== void 0 && r.baseFontSize !== (m == null ? void 0 : m.baseFontSize) && (e.fontSize = r.baseFontSize);
|
|
115
|
-
for (const [c, s] of Object.entries(
|
|
116
|
-
o.cssVariables
|
|
117
|
-
))
|
|
118
|
-
e[c] = s;
|
|
119
|
-
return e;
|
|
120
|
-
}
|
|
121
|
-
export {
|
|
122
|
-
M as A,
|
|
123
|
-
D as a,
|
|
124
|
-
T as c,
|
|
125
|
-
$ as u
|
|
126
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
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-DEYtWinQ.js";
|
|
4
|
-
import { r as g } from "./index-CLIro-EG.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
|
-
};
|