react-semaphor 0.1.568 → 0.1.570

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 (191) hide show
  1. package/README.md +0 -7
  2. package/dist/analytics-protocol/index.js +434 -454
  3. package/dist/appearance/index.js +6 -3
  4. package/dist/appearance-runtime/index.js +1 -1
  5. package/dist/assistant-context/index.js +1 -1
  6. package/dist/brand-studio/index.js +572 -436
  7. package/dist/briefings/index.js +4 -4
  8. package/dist/chunks/appearance-context-BwBp25ZG.js +162 -0
  9. package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +80 -0
  10. package/dist/chunks/assistant-chat-B-Ddyy8b.js +5940 -0
  11. package/dist/chunks/{bookmark-impact-CJ-65omV.js → bookmark-impact-DCYD-6Fr.js} +2 -2
  12. package/dist/chunks/{bookmark-state-Du3s13_V.js → bookmark-state-CflS88gq.js} +251 -250
  13. package/dist/chunks/brand-B4BdpAB_.js +54 -0
  14. package/dist/chunks/{card-filter-builder-BBuB99GZ.js → card-filter-builder-0VvKmRst.js} +992 -991
  15. package/dist/chunks/{comparison-window-caption-CMLb3mut.js → comparison-window-caption-PtcDWvkN.js} +252 -253
  16. package/dist/chunks/{dashboard-YnWZC4dK.js → dashboard-DxGIr1vZ.js} +1 -1
  17. package/dist/chunks/{dashboard-briefing-launcher-BF89TU2h.js → dashboard-briefing-launcher-B-quOOOQ.js} +253 -253
  18. package/dist/chunks/{dashboard-controls-atHc1EjP.js → dashboard-controls-Caodx80b.js} +288 -285
  19. package/dist/chunks/dashboard-json-Ct-AGDHF.js +66 -0
  20. package/dist/chunks/{dates-CKO05ino.js → dates-B9mL8BHE.js} +16 -15
  21. package/dist/chunks/edit-Bpdh_P_a.js +226 -0
  22. package/dist/chunks/{edit-dashboard-visual-DdmTfn-J.js → edit-dashboard-visual-DeDTuYB5.js} +2257 -2270
  23. package/dist/chunks/{filter-reach-copy-jZGzK_IH.js → filter-reach-copy-BSY33ro5.js} +1440 -1301
  24. package/dist/chunks/filter-value-text-DvvSNlho.js +146 -0
  25. package/dist/chunks/index-BVKzKl5d.js +90 -0
  26. package/dist/chunks/{index-RNaTnE3m.js → index-CV_Kzou0.js} +233 -223
  27. package/dist/chunks/{index-CPNZW0mu.js → index-y3HUzRNk.js} +76 -77
  28. package/dist/chunks/{layout-grid-0hIlqEtk.js → layout-grid-8rR-LPTk.js} +1 -1
  29. package/dist/chunks/{list-filter-DkgoCeBm.js → list-filter-C1-uTgjR.js} +1 -1
  30. package/dist/chunks/matrix-analytical-definition-dkS8szLM.js +1253 -0
  31. package/dist/chunks/matrix-member-presentation-DRa-9e6Q.js +169 -0
  32. package/dist/chunks/{matrix-operation-contract-Eb6elidS.js → matrix-operation-contract-DCVinw1o.js} +122 -122
  33. package/dist/chunks/{metric-comparison-ChXUFaZu.js → metric-comparison-n9NsIa-2.js} +175 -128
  34. package/dist/chunks/paintbrush-aR17Z3C9.js +27 -0
  35. package/dist/chunks/{palette-4vf2BEEg.js → palette-a5FCZKFI.js} +1 -1
  36. package/dist/chunks/{_commonjsHelpers-DimLPMtv.js → pickers-DkqmtnTL.js} +352 -290
  37. package/dist/chunks/pivot-result-contract-expectations-C-HnUKYe.js +55 -0
  38. package/dist/chunks/{pivot-result-identity-BlbLrqaC.js → pivot-result-identity-B89X5xjb.js} +1 -1
  39. package/dist/chunks/raw-temporal-value-DdT0s47W.js +159 -0
  40. package/dist/chunks/{report-preferences-dialog-Mbd-I0wV.js → report-preferences-dialog-Yvhv3WX2.js} +95 -97
  41. package/dist/chunks/{report-runtime-context-DnA_PiKo.js → report-runtime-context-BhPzLTbS.js} +1 -1
  42. package/dist/chunks/{resolve-dashboard-input-context-Du0fjN3h.js → resolve-dashboard-input-context-Lkbwycwe.js} +5491 -5683
  43. package/dist/chunks/resolver-DG_tfEpt.js +156 -0
  44. package/dist/chunks/{save-D6pHmSSP.js → save-D985VvYp.js} +1 -1
  45. package/dist/chunks/{saved-dashboard-context-y8N6RvjS.js → saved-dashboard-context-DC_TEd6y.js} +6 -6
  46. package/dist/chunks/schema-C9NPiIru.js +2568 -0
  47. package/dist/chunks/{semaphor-ready-indicator-BSEdUq40.js → semaphor-ready-indicator-ByFvqHEO.js} +35916 -36001
  48. package/dist/chunks/{shelf-drop-preview-context-D7QqPl36.js → shelf-drop-preview-context-CjoVaK6J.js} +64 -66
  49. package/dist/chunks/{stored-dashboard-d3xQYxBD.js → stored-dashboard-C0hekXiI.js} +332 -333
  50. package/dist/chunks/{code-editor-DJNOsgJH.js → style-sheet-parts-C7qGZuH1.js} +2402 -2040
  51. package/dist/chunks/{table-export-sheet--DUKWk6o.js → table-export-sheet-CP8zSOhj.js} +1 -1
  52. package/dist/chunks/{temporal-input-presentation--2r9BLr0.js → temporal-input-presentation-CqbJjIuu.js} +18 -18
  53. package/dist/chunks/{token-types-C8JymO8s.js → token-types-iKMplaBL.js} +1 -1
  54. package/dist/chunks/{upload-Cf3wXZT8.js → upload-CiGNKJ_0.js} +1 -1
  55. package/dist/chunks/validators-B8fpdinG.js +3651 -0
  56. package/dist/chunks/{variable-draft-DOX03R4A.js → variable-draft-9-huI1h4.js} +4 -4
  57. package/dist/dashboard/index.js +2 -2
  58. package/dist/dashboard-authoring/index.js +1888 -1826
  59. package/dist/format-utils/index.js +230 -231
  60. package/dist/index.js +349 -353
  61. package/dist/layouts/index.js +1 -1
  62. package/dist/report-runtime-context/index.js +1 -1
  63. package/dist/style.css +1 -1
  64. package/dist/surfboard/index.js +2 -2
  65. package/dist/types/appearance/index.d.ts +1 -0
  66. package/dist/types/brand-studio/brand-studio-draft.d.ts +7 -0
  67. package/dist/types/brand-studio/index.d.ts +1 -1
  68. package/dist/types/components/briefings/briefing-author/run-model.d.ts +1 -2
  69. package/dist/types/components/providers/appearance-runtime-provider.d.ts +4 -1
  70. package/dist/types/components/sharing-and-management/hooks/use-resource-management.d.ts +0 -2
  71. package/dist/types/components/sharing-and-management/utils/types.d.ts +0 -72
  72. package/dist/types/components/surfboard/filter/types.d.ts +5 -4
  73. package/dist/types/components/ui-custom/date-range-presets.d.ts +1 -17
  74. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -1
  75. package/dist/types/components/visual/data-table/types/data-table.d.ts +0 -9
  76. package/dist/types/components/visual/data-table/utils/pagination-utils.d.ts +0 -19
  77. package/dist/types/components/visual/shared/utils/table-column-order.d.ts +0 -1
  78. package/dist/types/index.js +9 -9
  79. package/dist/types/lib/appearance/aliases.d.ts +42 -0
  80. package/dist/types/lib/appearance/compiler.d.ts +6 -0
  81. package/dist/types/lib/appearance/defaults.d.ts +6 -0
  82. package/dist/types/lib/appearance/index.d.ts +2 -0
  83. package/dist/types/lib/appearance/normalize-organization.d.ts +17 -0
  84. package/dist/types/lib/appearance/resolver.d.ts +2 -2
  85. package/dist/types/lib/appearance/types.d.ts +38 -1
  86. package/dist/types/lib/charts/types.d.ts +6 -2
  87. package/dist/types/lib/dashboard/semantic-dataset-references.d.ts +0 -1
  88. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +0 -2
  89. package/dist/types/lib/dashboard-variables/types.d.ts +1 -6
  90. package/dist/types/lib/download-pdf.d.ts +0 -1
  91. package/dist/types/lib/hooks/use-dashboard.d.ts +3 -4
  92. package/dist/types/lib/hooks/use-date-filter.d.ts +3 -3
  93. package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +1 -1
  94. package/dist/types/lib/stores/dashboard-store.d.ts +15 -6
  95. package/dist/types/lib/stores/editor-store.d.ts +0 -1
  96. package/dist/types/lib/stores/table-actions.d.ts +0 -1
  97. package/dist/types/lib/table-formatting/table-formatting-css.d.ts +0 -5
  98. package/dist/types/lib/types/common-types.d.ts +3 -2
  99. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  100. package/dist/types/lib/types/index.d.ts +1 -1
  101. package/dist/types/lib/types/summary-types.d.ts +0 -5
  102. package/dist/types/lib/utils/card-definition.d.ts +7 -7
  103. package/dist/types/shared/analytics-protocol/agent-time-window.d.ts +84 -0
  104. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +4 -4
  105. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +2 -2
  106. package/dist/types/shared/analytics-protocol/contracts.d.ts +8 -17
  107. package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +10 -10
  108. package/dist/types/shared/analytics-protocol/fixtures.d.ts +3 -2
  109. package/dist/types/shared/analytics-protocol/index.d.ts +2 -4
  110. package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +72 -72
  111. package/dist/types/shared/analytics-protocol/relative-date/describe.d.ts +18 -0
  112. package/dist/types/shared/analytics-protocol/relative-date/index.d.ts +7 -0
  113. package/dist/types/shared/analytics-protocol/relative-date/limits.d.ts +3 -0
  114. package/dist/types/shared/analytics-protocol/relative-date/presets.d.ts +11 -0
  115. package/dist/types/shared/analytics-protocol/relative-date/resolve.d.ts +49 -0
  116. package/dist/types/shared/analytics-protocol/relative-date/schemas.d.ts +76 -0
  117. package/dist/types/shared/analytics-protocol/relative-date/traits.d.ts +51 -0
  118. package/dist/types/shared/analytics-protocol/relative-date/window.d.ts +111 -0
  119. package/dist/types/shared/analytics-protocol/selection-contract.d.ts +1 -1
  120. package/dist/types/shared/assistant-protocol/context.d.ts +30 -30
  121. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +0 -2
  122. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +344 -1772
  123. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +4 -1
  124. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +8 -4
  125. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +9 -0
  126. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +104 -104
  127. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +20 -20
  128. package/dist/types/shared/dashboard-authoring/dashboard-style/bounds.d.ts +17 -0
  129. package/dist/types/shared/dashboard-authoring/dashboard-style/brand.d.ts +20 -0
  130. package/dist/types/shared/dashboard-authoring/dashboard-style/edit-words.d.ts +7 -0
  131. package/dist/types/shared/dashboard-authoring/dashboard-style/edit.d.ts +19 -0
  132. package/dist/types/shared/dashboard-authoring/dashboard-style/index.d.ts +15 -0
  133. package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +19 -0
  134. package/dist/types/shared/dashboard-authoring/dashboard-style/legacy.d.ts +21 -0
  135. package/dist/types/shared/dashboard-authoring/dashboard-style/parse.d.ts +18 -0
  136. package/dist/types/shared/dashboard-authoring/dashboard-style/pickers.d.ts +12 -0
  137. package/dist/types/shared/dashboard-authoring/dashboard-style/types.d.ts +122 -0
  138. package/dist/types/shared/dashboard-authoring/dashboard-style/view.d.ts +10 -0
  139. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  140. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +11 -0
  141. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +23 -0
  142. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +10 -2
  143. package/dist/types/shared/format-utils/filter-detail.d.ts +2 -8
  144. package/dist/types/shared/format-utils/filter-line.d.ts +2 -2
  145. package/dist/types/shared/format-utils/matrix-continuation.d.ts +10 -10
  146. package/dist/types/shared/temporal/index.d.ts +0 -2
  147. package/dist/types/shared/temporal/temporal-parity-fixtures.d.ts +2 -2
  148. package/package.json +7 -26
  149. package/DATA_APP_SDK.md +0 -339
  150. package/dist/chunks/appearance-context-DEYtWinQ.js +0 -126
  151. package/dist/chunks/appearance-runtime-provider-B-M8gwlZ.js +0 -81
  152. package/dist/chunks/assistant-chat-BN5I8KuN.js +0 -8849
  153. package/dist/chunks/color-CJvdlFM_.js +0 -2162
  154. package/dist/chunks/dashboard-json-Cxp3inxd.js +0 -68
  155. package/dist/chunks/filter-value-text-7zhmth1S.js +0 -163
  156. package/dist/chunks/index-CLIro-EG.js +0 -425
  157. package/dist/chunks/index-CuHybtft.js +0 -51
  158. package/dist/chunks/matrix-analytical-definition-C9xB_T84.js +0 -717
  159. package/dist/chunks/matrix-card-BSUeSXpD.js +0 -42
  160. package/dist/chunks/matrix-member-presentation-DZNgQpUq.js +0 -105
  161. package/dist/chunks/operators-B3zZoskU.js +0 -66
  162. package/dist/chunks/pivot-result-contract-expectations-Ddh1rNz5.js +0 -56
  163. package/dist/chunks/raw-temporal-value-Bqz8wc7L.js +0 -242
  164. package/dist/chunks/selection-reducer-OaJ-N5uN.js +0 -46
  165. package/dist/chunks/source-entity-resolution-DF6GulDn.js +0 -607
  166. package/dist/chunks/validators-wtjw0aw6.js +0 -3332
  167. package/dist/data-app-sdk/index.js +0 -1412
  168. package/dist/data-app-sdk-adapters/index.js +0 -361
  169. package/dist/data-app-sdk-validation/index.js +0 -1031
  170. package/dist/types/components/sharing-and-management/utils/group-types.d.ts +0 -105
  171. package/dist/types/data-app-sdk/adapters.d.ts +0 -35
  172. package/dist/types/data-app-sdk/builders.d.ts +0 -62
  173. package/dist/types/data-app-sdk/contracts.d.ts +0 -419
  174. package/dist/types/data-app-sdk/executor.d.ts +0 -5
  175. package/dist/types/data-app-sdk/field-catalog-validation.d.ts +0 -29
  176. package/dist/types/data-app-sdk/hooks.d.ts +0 -11
  177. package/dist/types/data-app-sdk/index.d.ts +0 -9
  178. package/dist/types/data-app-sdk/provider.d.ts +0 -8
  179. package/dist/types/data-app-sdk/relationship-aware-field-policy.d.ts +0 -21
  180. package/dist/types/data-app-sdk/selection.d.ts +0 -2
  181. package/dist/types/data-app-sdk/validation.d.ts +0 -58
  182. package/dist/types/data-app-sdk-adapters.d.ts +0 -2
  183. package/dist/types/data-app-sdk-validation.d.ts +0 -2
  184. package/dist/types/data-app-sdk.d.ts +0 -2
  185. package/dist/types/shared/analytics-protocol/relative-date-filter.d.ts +0 -68
  186. package/dist/types/shared/analytics-protocol/relative-date-label.d.ts +0 -20
  187. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +0 -314
  188. package/dist/types/shared/analytics-protocol/time-window.d.ts +0 -52
  189. package/dist/types/shared/temporal/relative-date.d.ts +0 -21
  190. package/dist/types/shared/temporal/time-window-periods.d.ts +0 -21
  191. package/src/data-app-sdk/README.md +0 -402
@@ -1,26 +1,27 @@
1
- import { jsxs as d, jsx as r, Fragment as de } from "react/jsx-runtime";
2
- import b from "react";
3
- import { c as ee, P as ue, a as pe, B as C, b as ze, d as be, C as De, R as ge, L as ce, X as je, S as ie, e as Ie, T as Je, f as Le, g as L, h as $e, i as $, j as _e, k as Ue, l as Ve, m as Me, n as T, o as X, p as Y, q, I as fe, r as Z, s as K, t as me, u as he, v as ke, w as xe, x as ye, y as Ge } from "../chunks/code-editor-DJNOsgJH.js";
4
- import { A as We, p as He } from "../chunks/color-CJvdlFM_.js";
5
- import "../chunks/index-CuHybtft.js";
6
- import "../chunks/validators-wtjw0aw6.js";
7
- import "../chunks/matrix-operation-contract-Eb6elidS.js";
1
+ import { jsxs as d, jsx as r, Fragment as ue } from "react/jsx-runtime";
2
+ import g, { useState as pe } from "react";
3
+ import { c as de, P as be, N as B, S as M, a as Ye, b as We, d as Ce, e as ye, f as Ne, B as S, g as qe, h as Se, C as Ke, R as we, L as fe, X as Xe, i as me, j as Ze, T as Qe, k as er, l as V, m as rr, n as G, o as or, p as ar, q as nr, r as tr, s as E, t as Q, u as ee, v as re, I as Fe, w as oe, x as ae, y as Pe, z as Oe, A as Te, D as Be, E as Re } from "../chunks/style-sheet-parts-C7qGZuH1.js";
4
+ import { v as dr, A as ne, d as cr, p as sr } from "../chunks/schema-C9NPiIru.js";
5
+ import { S as j, C as lr, a as ge, c as te } from "../chunks/pickers-DkqmtnTL.js";
6
+ import "../chunks/validators-B8fpdinG.js";
7
+ import "../chunks/matrix-operation-contract-DCVinw1o.js";
8
8
  import "../chunks/analytics-base-schemas-BaIQrEzX.js";
9
- import "zod";
10
9
  import "../value-format-preferences/index.js";
11
- import { c as Q } from "../chunks/_commonjsHelpers-DimLPMtv.js";
12
- import { r as Xe, v as Ye, A as qe } from "../chunks/index-CLIro-EG.js";
13
- import { P as _ } from "../chunks/palette-4vf2BEEg.js";
14
- import { U as Ze } from "../chunks/upload-Cf3wXZT8.js";
15
- import { S as Ke } from "../chunks/save-D6pHmSSP.js";
16
- import { L as Qe } from "../chunks/layout-grid-0hIlqEtk.js";
10
+ import { e as ir } from "../chunks/brand-B4BdpAB_.js";
11
+ import { b as ur, D as pr } from "../chunks/edit-Bpdh_P_a.js";
12
+ import { n as Ee } from "../chunks/index-BVKzKl5d.js";
13
+ import { b as br } from "../chunks/resolver-DG_tfEpt.js";
14
+ import { P as H } from "../chunks/palette-a5FCZKFI.js";
15
+ import { U as fr } from "../chunks/upload-CiGNKJ_0.js";
16
+ import { S as mr } from "../chunks/save-D985VvYp.js";
17
+ import { L as gr } from "../chunks/layout-grid-8rR-LPTk.js";
17
18
  /**
18
19
  * @license lucide-react v0.453.0 - ISC
19
20
  *
20
21
  * This source code is licensed under the ISC license.
21
22
  * See the LICENSE file in the root directory of this source tree.
22
23
  */
23
- const er = ee("Ban", [
24
+ const hr = de("Ban", [
24
25
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
25
26
  ["path", { d: "m4.9 4.9 14.2 14.2", key: "1m5liu" }]
26
27
  ]);
@@ -30,7 +31,7 @@ const er = ee("Ban", [
30
31
  * This source code is licensed under the ISC license.
31
32
  * See the LICENSE file in the root directory of this source tree.
32
33
  */
33
- const rr = ee("Clipboard", [
34
+ const xr = de("Clipboard", [
34
35
  ["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
35
36
  [
36
37
  "path",
@@ -46,7 +47,7 @@ const rr = ee("Clipboard", [
46
47
  * This source code is licensed under the ISC license.
47
48
  * See the LICENSE file in the root directory of this source tree.
48
49
  */
49
- const or = ee("Pipette", [
50
+ const vr = de("Pipette", [
50
51
  ["path", { d: "m2 22 1-1h3l9-9", key: "1sre89" }],
51
52
  ["path", { d: "M3 21v-3l9-9", key: "hpe2y6" }],
52
53
  [
@@ -56,7 +57,140 @@ const or = ee("Pipette", [
56
57
  key: "196du1"
57
58
  }
58
59
  ]
59
- ]), Ce = [
60
+ ]), kr = [
61
+ { value: "none", label: "None" },
62
+ { value: "compact", label: "Compact" },
63
+ { value: "default", label: "Default" },
64
+ { value: "roomy", label: "Roomy" }
65
+ ], he = [
66
+ { value: "outlined", label: "Outlined", note: "A border on a muted canvas" },
67
+ { value: "raised", label: "Raised", note: "A shadow and no border on a muted canvas" },
68
+ { value: "open", label: "Open", note: "No border or shadow on a plain canvas" }
69
+ ], Cr = [
70
+ { value: "square", label: "Square" },
71
+ { value: "subtle", label: "Subtle" },
72
+ { value: "rounded", label: "Rounded" },
73
+ { value: "round", label: "Round" }
74
+ ];
75
+ function yr({
76
+ spec: e,
77
+ mode: a,
78
+ onEdit: n
79
+ }) {
80
+ var F;
81
+ const c = ur({ organizationAppearance: e }, a), s = c.authored, [f, h] = pe(null), [x, v] = pe(!1), b = (l) => h(n(l)), i = (l) => pr[l], p = s.canvas === "muted" ? "muted" : s.canvas === "background" ? "background" : "color", y = (l) => ({ [a]: l });
82
+ return /* @__PURE__ */ d("div", { className: "-mx-4", children: [
83
+ /* @__PURE__ */ r(
84
+ be,
85
+ {
86
+ label: "Spacing",
87
+ options: kr.map((l) => ({
88
+ ...l,
89
+ title: `${j[l.value]} px between cards and around them`,
90
+ preview: { ...s, spacing: j[l.value], canvasPadding: j[l.value] }
91
+ })),
92
+ lit: c.pickers.spacing,
93
+ note: "Card sizes never change with spacing.",
94
+ changed: c.source.spacing === "organization" || c.source.canvasPadding === "organization",
95
+ resetTitle: `Back to the default: ${j.default} px`,
96
+ onPick: (l) => b({ spacing: l }),
97
+ onReset: () => b({ reset: ["spacing", "canvasPadding"] }),
98
+ children: /* @__PURE__ */ d("div", { className: "mt-2 flex items-center gap-1.5", children: [
99
+ /* @__PURE__ */ r("span", { className: "text-[11px] text-muted-foreground", children: "Gap" }),
100
+ /* @__PURE__ */ r(B, { value: s.spacing, ...i("spacing"), onChange: (l) => b({ spacing: l }) }),
101
+ /* @__PURE__ */ r("span", { className: "ml-2 text-[11px] text-muted-foreground", children: "Canvas padding" }),
102
+ /* @__PURE__ */ r(B, { value: s.canvasPadding, ...i("canvasPadding"), onChange: (l) => b({ canvasPadding: l }) })
103
+ ] })
104
+ }
105
+ ),
106
+ /* @__PURE__ */ r(
107
+ be,
108
+ {
109
+ label: "Cards",
110
+ options: he.map((l) => ({ value: l.value, label: l.label, title: l.note, preview: { ...s, ...lr[l.value] } })),
111
+ lit: c.pickers.cards,
112
+ note: ((F = he.find((l) => l.value === c.pickers.cards)) == null ? void 0 : F.note) ?? "Your own mix of border, shadow and canvas",
113
+ changed: ["cardBorder", "cardShadow", "canvas"].some((l) => c.source[l] === "organization"),
114
+ resetTitle: "Back to the default cards",
115
+ onPick: (l) => b({ cards: l }),
116
+ onReset: () => b({ reset: ["cards"] })
117
+ }
118
+ ),
119
+ /* @__PURE__ */ d("div", { className: "grid gap-2 px-4 pb-3", children: [
120
+ /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
121
+ /* @__PURE__ */ d("span", { className: "w-24 text-[12px] text-muted-foreground", children: [
122
+ "Canvas (",
123
+ a,
124
+ ")"
125
+ ] }),
126
+ /* @__PURE__ */ r(
127
+ M,
128
+ {
129
+ label: "Canvas background",
130
+ value: p,
131
+ onChange: (l) => b({ canvas: y(l === "color" ? a === "dark" ? "#111318" : "#f4f6f8" : l) }),
132
+ options: [
133
+ { value: "muted", label: "Muted" },
134
+ { value: "background", label: "Plain" },
135
+ { value: "color", label: "Custom" }
136
+ ]
137
+ }
138
+ ),
139
+ p === "color" ? /* @__PURE__ */ r(Ye, { color: We(s.canvas), label: "Canvas color", onChange: (l) => b({ canvas: y(l) }) }) : null
140
+ ] }),
141
+ /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-2", children: [
142
+ /* @__PURE__ */ r("span", { className: "w-24 text-[12px] text-muted-foreground", children: "Corners" }),
143
+ /* @__PURE__ */ r(
144
+ M,
145
+ {
146
+ label: "Corners",
147
+ value: c.pickers.corners,
148
+ onChange: (l) => b({ corners: l }),
149
+ options: Cr.map((l) => ({
150
+ ...l,
151
+ title: `Cards ${ge[l.value].cardCorners} px, controls ${ge[l.value].controlCorners} px`
152
+ }))
153
+ }
154
+ ),
155
+ /* @__PURE__ */ r("button", { type: "button", className: "text-[11px] text-foreground underline-offset-2 hover:underline", onClick: () => v(!x), children: x || !c.pickers.corners ? "Hide" : "Set separately" })
156
+ ] }),
157
+ x || !c.pickers.corners ? /* @__PURE__ */ d("div", { className: "flex items-center gap-1.5 pl-[104px]", children: [
158
+ /* @__PURE__ */ r("span", { className: "text-[11px] text-muted-foreground", children: "Cards" }),
159
+ /* @__PURE__ */ r(B, { value: s.cardCorners, ...i("cardCorners"), onChange: (l) => b({ corners: { cards: l } }) }),
160
+ /* @__PURE__ */ r("span", { className: "ml-1 text-[11px] text-muted-foreground", children: "Controls" }),
161
+ /* @__PURE__ */ r(B, { value: s.controlCorners, ...i("controlCorners"), onChange: (l) => b({ corners: { controls: l } }) })
162
+ ] }) : null,
163
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
164
+ /* @__PURE__ */ r("span", { className: "w-24 text-[12px] text-muted-foreground", children: "Card border" }),
165
+ /* @__PURE__ */ r(Ce, { checked: s.cardBorder === "on", onCheckedChange: (l) => b({ border: l ? "on" : "off" }), "aria-label": "Card border" }),
166
+ /* @__PURE__ */ r("span", { className: "ml-4 w-20 text-[12px] text-muted-foreground", children: "Shadow" }),
167
+ /* @__PURE__ */ r(
168
+ M,
169
+ {
170
+ label: "Card shadow",
171
+ value: s.cardShadow === "custom" ? null : s.cardShadow,
172
+ onChange: (l) => b({ shadow: l }),
173
+ options: [
174
+ { value: "none", label: "None" },
175
+ { value: "subtle", label: "Subtle" },
176
+ { value: "raised", label: "Raised" }
177
+ ]
178
+ }
179
+ )
180
+ ] }),
181
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
182
+ /* @__PURE__ */ r("span", { className: "w-24 text-[12px] text-muted-foreground", children: "Bar corners" }),
183
+ /* @__PURE__ */ r(B, { value: s.barCorners, ...i("barCorners"), onChange: (l) => b({ barCorners: l }) })
184
+ ] }),
185
+ f ? /* @__PURE__ */ d("p", { role: "alert", className: "text-[12px] text-destructive", children: [
186
+ f.message,
187
+ " ",
188
+ f.fix
189
+ ] }) : null
190
+ ] })
191
+ ] });
192
+ }
193
+ const Ae = [
60
194
  {
61
195
  id: "semaphor",
62
196
  name: "Semaphor",
@@ -211,15 +345,15 @@ const or = ee("Pipette", [
211
345
  }
212
346
  }
213
347
  ];
214
- function D(e) {
215
- const a = Xe({
216
- organizationAppearance: e ?? void 0
348
+ function R(e) {
349
+ const a = br({
350
+ organizationAppearance: e ? Ee(e).spec : void 0
217
351
  });
218
- return ar(
219
- tr(re(a))
352
+ return Nr(
353
+ ze(J(a))
220
354
  );
221
355
  }
222
- function ar(e) {
356
+ function Nr(e) {
223
357
  var a;
224
358
  for (const n of Object.values(e.schemes)) {
225
359
  const c = (a = n.components.table) == null ? void 0 : a.row;
@@ -227,12 +361,12 @@ function ar(e) {
227
361
  }
228
362
  return e;
229
363
  }
230
- function j(e) {
231
- const a = re({
232
- version: qe,
364
+ function $(e) {
365
+ const a = J({
366
+ version: ne,
233
367
  mode: e.mode,
234
368
  schemes: e.schemes
235
- }), n = Ye(a);
369
+ }), n = dr(a);
236
370
  if (!n.success) {
237
371
  const c = n.issues[0];
238
372
  throw new Error(
@@ -241,17 +375,39 @@ function j(e) {
241
375
  }
242
376
  return n.value;
243
377
  }
244
- function nr(e, a) {
245
- const n = Ce.find((i) => i.id === a);
378
+ function xe(e) {
379
+ var n, c;
380
+ const a = $(e);
381
+ for (const s of ["light", "dark"]) {
382
+ const f = (n = a.schemes) == null ? void 0 : n[s];
383
+ if (!(f != null && f.components)) continue;
384
+ const h = ze(
385
+ J({ version: ne, mode: e.mode, schemes: { light: { tokens: f.tokens, components: {} }, dark: { tokens: f.tokens, components: {} } } })
386
+ ).schemes[s].components;
387
+ for (const x of Sr) {
388
+ const v = f.components[x];
389
+ if (v)
390
+ for (const b of wr[x])
391
+ v[b] !== void 0 && v[b] === ((c = h[x]) == null ? void 0 : c[b]) && delete v[b];
392
+ }
393
+ }
394
+ return Ee(a).spec ?? { version: ne, mode: e.mode };
395
+ }
396
+ const Sr = ["dashboard", "card"], wr = {
397
+ dashboard: ["foreground", "borderColor"],
398
+ card: ["background", "foreground", "borderColor"]
399
+ };
400
+ function Fr(e, a) {
401
+ const n = Ae.find((s) => s.id === a);
246
402
  if (!n)
247
403
  return e;
248
- const c = re(e);
249
- return se(c.schemes.light, n.light), se(c.schemes.dark, n.dark), c;
404
+ const c = J(e);
405
+ return ve(c.schemes.light, n.light), ve(c.schemes.dark, n.dark), c;
250
406
  }
251
- function se(e, a) {
407
+ function ve(e, a) {
252
408
  e.tokens.color.background = a.background, e.tokens.color.foreground = a.foreground, e.tokens.color.muted = a.muted, e.tokens.color.mutedForeground = a.mutedForeground, e.tokens.color.border = a.border, e.tokens.color.input = a.border, e.tokens.color.primary = a.primary, e.tokens.color.primaryForeground = a.primaryForeground, e.tokens.color.accent = a.accent, e.tokens.color.accentForeground = a.accentForeground, e.tokens.color.selection = a.selection, e.tokens.color.card = a.card, e.tokens.color.cardForeground = a.cardForeground, e.components.dashboard.background = a.background, e.components.dashboard.foreground = a.foreground, e.components.dashboard.borderColor = a.border, e.components.card.background = a.card, e.components.card.foreground = a.cardForeground, e.components.card.borderColor = a.border, e.components.interactive.toolbarBackground = a.background, e.components.interactive.background = a.card, e.components.interactive.foreground = a.foreground, e.components.interactive.borderColor = a.border, e.components.chart.palette = [...a.chartPalette], e.components.chart.background = a.card, e.components.chart.foreground = a.foreground, e.components.chart.gridColor = a.border, e.components.chart.axisColor = a.mutedForeground, e.components.table.container.background = a.card, e.components.table.container.borderColor = a.border, e.components.table.header.background = a.muted, e.components.table.header.foreground = a.mutedForeground, e.components.table.header.dividerColor = a.border, e.components.table.row.dividerColor = a.border, e.components.table.row.zebraBackground = a.muted, e.components.table.pagination.background = a.card, e.components.table.pagination.foreground = a.foreground, e.components.table.pagination.borderColor = a.border;
253
409
  }
254
- function U(e, a, n) {
410
+ function Y(e, a, n) {
255
411
  switch (e.tokens.color[a] = n, a) {
256
412
  case "background":
257
413
  e.components.dashboard.background = n, e.components.interactive.toolbarBackground = n;
@@ -279,22 +435,16 @@ function U(e, a, n) {
279
435
  break;
280
436
  }
281
437
  }
282
- function V(e, a, n) {
438
+ function Pr(e, a, n) {
283
439
  switch (e.tokens.radius[a] = n, a) {
284
- case "control":
285
- e.components.interactive.borderRadius = n, e.components.pagination.borderRadius = n;
286
- break;
287
- case "card":
288
- e.components.card.borderRadius = n;
289
- break;
290
440
  case "table":
291
441
  e.components.table.container.borderRadius = n;
292
442
  break;
293
443
  }
294
444
  }
295
- function tr(e) {
445
+ function ze(e) {
296
446
  for (const a of ["light", "dark"]) {
297
- const n = e.schemes[a], c = n.tokens, i = c.color, f = {
447
+ const n = e.schemes[a], c = n.tokens, s = c.color, f = {
298
448
  fontFamily: "",
299
449
  headingFontFamily: "",
300
450
  monoFontFamily: "",
@@ -302,14 +452,14 @@ function tr(e) {
302
452
  density: "comfortable"
303
453
  };
304
454
  c.typography = { ...f, ...c.typography };
305
- const g = {
455
+ const h = {
306
456
  control: 5,
307
457
  card: 5,
308
458
  table: 5,
309
459
  badge: 999
310
460
  };
311
- c.radius = { ...g, ...c.radius };
312
- const y = {
461
+ c.radius = { ...h, ...c.radius };
462
+ const x = {
313
463
  dashboardPadding: 16,
314
464
  gridGap: 12,
315
465
  cardPadding: 16,
@@ -317,66 +467,67 @@ function tr(e) {
317
467
  tableCellX: 12,
318
468
  tableCellY: 8
319
469
  };
320
- c.spacing = { ...y, ...c.spacing };
321
- const x = {
470
+ c.spacing = { ...x, ...c.spacing };
471
+ const v = {
322
472
  card: "none",
323
473
  popover: "0 12px 32px rgba(15, 23, 42, 0.14)",
324
474
  focusRing: "0 0 0 2px rgba(37, 99, 235, 0.35)"
325
475
  };
326
- c.shadow = { ...x, ...c.shadow };
327
- const w = {
476
+ c.shadow = { ...v, ...c.shadow };
477
+ const b = {
328
478
  dashboard: {
329
- background: i.background,
330
- foreground: i.foreground,
331
- borderColor: i.border,
332
- padding: c.spacing.dashboardPadding
479
+ background: s.background,
480
+ foreground: s.foreground,
481
+ borderColor: s.border
333
482
  },
334
483
  card: {
335
- background: i.card,
336
- foreground: i.cardForeground,
337
- borderColor: i.border,
338
- borderRadius: c.radius.card,
339
- padding: c.spacing.cardPadding,
340
- shadow: c.shadow.card
484
+ background: s.card,
485
+ foreground: s.cardForeground,
486
+ borderColor: s.border
341
487
  },
342
488
  interactive: {
343
- toolbarBackground: i.background,
344
- background: i.card,
345
- foreground: i.foreground,
346
- borderColor: i.border,
347
- borderRadius: c.radius.control
489
+ toolbarBackground: s.background,
490
+ background: s.card,
491
+ foreground: s.foreground,
492
+ borderColor: s.border
348
493
  },
349
494
  chart: {
350
495
  palette: [],
351
- background: i.card,
352
- foreground: i.foreground,
353
- gridColor: i.border,
354
- axisColor: i.mutedForeground
496
+ background: s.card,
497
+ foreground: s.foreground,
498
+ gridColor: s.border,
499
+ axisColor: s.mutedForeground,
500
+ barRadius: 0
355
501
  },
356
- table: le(i, c),
502
+ table: ke(s, c),
357
503
  pagination: {
358
- background: i.card,
359
- foreground: i.foreground,
360
- borderColor: i.border,
361
- borderRadius: c.radius.control
504
+ background: s.card,
505
+ foreground: s.foreground,
506
+ borderColor: s.border
362
507
  }
363
508
  };
364
- n.components = { ...w, ...n.components };
365
- const p = {
509
+ n.components = Object.fromEntries(
510
+ Object.entries({ ...b, ...n.components }).map(([p, y]) => [
511
+ p,
512
+ { ...b[p], ...y }
513
+ ])
514
+ );
515
+ const i = {
366
516
  palette: [],
367
- background: i.card,
368
- foreground: i.foreground,
369
- gridColor: i.border,
370
- axisColor: i.mutedForeground
517
+ background: s.card,
518
+ foreground: s.foreground,
519
+ gridColor: s.border,
520
+ axisColor: s.mutedForeground,
521
+ barRadius: 2
371
522
  };
372
- n.components.chart = { ...p, ...n.components.chart }, n.components.table = {
373
- ...le(i, c),
523
+ n.components.chart = { ...i, ...n.components.chart }, n.components.table = {
524
+ ...ke(s, c),
374
525
  ...n.components.table
375
526
  };
376
527
  }
377
528
  return e;
378
529
  }
379
- function le(e, a) {
530
+ function ke(e, a) {
380
531
  return {
381
532
  density: a.typography.density,
382
533
  container: {
@@ -424,10 +575,10 @@ function le(e, a) {
424
575
  }
425
576
  };
426
577
  }
427
- function re(e) {
578
+ function J(e) {
428
579
  return JSON.parse(JSON.stringify(e));
429
580
  }
430
- const dr = [
581
+ const Or = [
431
582
  ["background", "Canvas"],
432
583
  ["foreground", "Text"],
433
584
  ["card", "Card"],
@@ -443,7 +594,7 @@ const dr = [
443
594
  ["negative", "Negative"],
444
595
  ["warning", "Warning"],
445
596
  ["info", "Info"]
446
- ], cr = [0, 1, 2, 3, 4, 5], M = We, ir = [
597
+ ], W = cr, Tr = [
447
598
  "#ffffff",
448
599
  "#f8fafc",
449
600
  "#f4f4f5",
@@ -457,146 +608,157 @@ const dr = [
457
608
  "#dc2626",
458
609
  "#7c3aed"
459
610
  ];
460
- function Or({
611
+ function Zr({
461
612
  appearance: e,
462
613
  previewTitle: a,
463
614
  isLoading: n = !1,
464
615
  isSaving: c = !1,
465
- error: i = null,
616
+ error: s = null,
466
617
  className: f,
467
- onDraftChange: g,
468
- onSave: y,
469
- onClearConfig: x,
470
- onCancel: w
618
+ onDraftChange: h,
619
+ onSave: x,
620
+ onClearConfig: v,
621
+ onCancel: b
471
622
  }) {
472
- const [p, u] = b.useState(null), [B, O] = b.useState("light"), [ve, R] = b.useState(!1), [Ne, F] = b.useState(
623
+ const [i, p] = g.useState(null), [y, F] = g.useState("light"), [l, A] = g.useState(!1), [De, O] = g.useState(
473
624
  "idle"
474
- ), [oe, we] = b.useState(!1), [A, I] = b.useState(""), [E, m] = b.useState(null), ae = b.useRef(null), z = b.useRef(g), P = b.useRef(!1);
475
- b.useEffect(() => {
476
- z.current = g;
477
- }, [g]), b.useEffect(() => {
625
+ ), [ce, Ie] = g.useState(!1), [z, U] = g.useState(""), [D, C] = g.useState(null), se = g.useRef(null), I = g.useRef(h), T = g.useRef(!1);
626
+ g.useEffect(() => {
627
+ I.current = h;
628
+ }, [h]), g.useEffect(() => {
478
629
  if (e === void 0) {
479
- P.current = !0, u(null);
630
+ T.current = !0, p(null);
480
631
  return;
481
632
  }
482
- const o = D(e);
483
- P.current = !0, u(o), O("light"), m(null);
484
- }, [e]), b.useEffect(() => {
633
+ const o = R(e);
634
+ T.current = !0, p(o), F("light"), C(null);
635
+ }, [e]), g.useEffect(() => {
485
636
  var o;
486
- if (p) {
487
- if (P.current) {
488
- P.current = !1;
637
+ if (i) {
638
+ if (T.current) {
639
+ T.current = !1;
489
640
  return;
490
641
  }
491
642
  try {
492
- const t = j(p);
493
- (o = z.current) == null || o.call(z, t), m(null);
643
+ const t = $(i);
644
+ (o = I.current) == null || o.call(I, t), C(null);
494
645
  } catch (t) {
495
- m(
646
+ C(
496
647
  t instanceof Error ? t.message : "Appearance is invalid"
497
648
  );
498
649
  }
499
650
  }
500
- }, [p]);
501
- const s = p == null ? void 0 : p.schemes[B], J = c || ve, Se = b.useMemo(
502
- () => s ? ur(s.tokens.radius.control) : void 0,
503
- [s]
504
- ), Fe = (o) => {
505
- u((t) => {
651
+ }, [i]);
652
+ const u = i == null ? void 0 : i.schemes[y], L = c || l, _e = g.useMemo(
653
+ () => u ? Er(u.tokens.radius.control) : void 0,
654
+ [u]
655
+ ), je = (o) => {
656
+ p((t) => {
506
657
  if (!t) return t;
507
- const h = pr(t);
508
- return o(h), h;
658
+ const k = Ar(t);
659
+ return o(k), k;
509
660
  });
510
- }, l = (o) => {
511
- Fe((t) => {
512
- o(t.schemes[B]);
661
+ }, m = (o) => {
662
+ je((t) => {
663
+ o(t.schemes[y]);
513
664
  });
514
- }, Pe = async () => {
515
- if (!p || !y) return;
665
+ }, _ = g.useMemo(() => {
666
+ if (!i) return null;
667
+ try {
668
+ return xe(i);
669
+ } catch {
670
+ return null;
671
+ }
672
+ }, [i]), $e = (o) => {
673
+ if (!_) return null;
674
+ const t = ir({ spec: _, edit: o, mode: y });
675
+ return t.ok ? (p(R(t.spec)), null) : t.refusal;
676
+ }, Je = async () => {
677
+ if (!i || !x) return;
516
678
  let o;
517
679
  try {
518
- o = j(p);
680
+ o = xe(i);
519
681
  } catch (t) {
520
- m(
682
+ C(
521
683
  t instanceof Error ? t.message : "Appearance is invalid"
522
684
  );
523
685
  return;
524
686
  }
525
- R(!0);
687
+ A(!0);
526
688
  try {
527
- await y(o);
689
+ await x(o);
528
690
  } finally {
529
- R(!1);
691
+ A(!1);
530
692
  }
531
- }, Te = () => {
532
- const o = D(null);
533
- F("idle"), u(o);
534
- }, Be = async () => {
535
- if (x) {
536
- R(!0), m(null), F("idle");
693
+ }, Ue = () => {
694
+ const o = R(null);
695
+ O("idle"), p(o);
696
+ }, Le = async () => {
697
+ if (v) {
698
+ A(!0), C(null), O("idle");
537
699
  try {
538
- await x(), P.current = !0, u(D(null)), O("light");
700
+ await v(), T.current = !0, p(R(null)), F("light");
539
701
  } catch (o) {
540
- m(
702
+ C(
541
703
  o instanceof Error ? o.message : "Unable to clear organization appearance"
542
704
  );
543
705
  } finally {
544
- R(!1);
706
+ A(!1);
545
707
  }
546
708
  }
547
- }, ne = b.useCallback(() => p ? JSON.stringify(j(p), null, 2) : "", [p]), Oe = (o) => {
548
- if (we(o), o)
709
+ }, le = g.useCallback(() => i ? JSON.stringify($(i), null, 2) : "", [i]), Me = (o) => {
710
+ if (Ie(o), o)
549
711
  try {
550
- I(ne()), m(null);
712
+ U(le()), C(null);
551
713
  } catch (t) {
552
- m(
714
+ C(
553
715
  t instanceof Error ? t.message : "Appearance is invalid"
554
716
  );
555
717
  }
556
- }, Re = async () => {
557
- if (p)
718
+ }, Ve = async () => {
719
+ if (i)
558
720
  try {
559
- const o = oe && A ? A : ne();
560
- await navigator.clipboard.writeText(o), m(null), F("copied");
721
+ const o = ce && z ? z : le();
722
+ await navigator.clipboard.writeText(o), C(null), O("copied");
561
723
  } catch (o) {
562
- m(
724
+ C(
563
725
  o instanceof Error ? o.message : "Unable to copy brand spec"
564
726
  );
565
727
  }
566
- }, te = (o) => {
567
- const t = JSON.parse(o), h = D(t), S = j(h);
568
- F("idle"), O("light"), u(h), I(JSON.stringify(S, null, 2));
569
- }, Ae = () => {
728
+ }, ie = (o) => {
729
+ const t = JSON.parse(o), k = R(t), w = $(k);
730
+ O("idle"), F("light"), p(k), U(JSON.stringify(w, null, 2));
731
+ }, Ge = () => {
570
732
  try {
571
- te(A);
733
+ ie(z);
572
734
  } catch (o) {
573
- m(
735
+ C(
574
736
  o instanceof Error ? o.message : "Brand spec must be valid JSON"
575
737
  );
576
738
  }
577
- }, Ee = async (o) => {
578
- var h;
579
- const t = (h = o.target.files) == null ? void 0 : h[0];
739
+ }, He = async (o) => {
740
+ var k;
741
+ const t = (k = o.target.files) == null ? void 0 : k[0];
580
742
  if (o.target.value = "", !!t)
581
743
  try {
582
- te(await br(t));
583
- } catch (S) {
584
- m(
585
- S instanceof Error ? S.message : "Uploaded file must be a valid brand spec"
744
+ ie(await zr(t));
745
+ } catch (w) {
746
+ C(
747
+ w instanceof Error ? w.message : "Uploaded file must be a valid brand spec"
586
748
  );
587
749
  }
588
750
  };
589
751
  return /* @__PURE__ */ d(
590
752
  "div",
591
753
  {
592
- className: Q(
754
+ className: te(
593
755
  "flex min-h-0 flex-1 flex-col bg-background text-foreground",
594
756
  f
595
757
  ),
596
- style: Se,
758
+ style: _e,
597
759
  children: [
598
760
  /* @__PURE__ */ d("header", { className: "flex h-11 shrink-0 items-start gap-3 border-b border-border/60 px-4 pt-2", children: [
599
- /* @__PURE__ */ r("div", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-control border border-border/70", children: /* @__PURE__ */ r(_, { className: "h-3.5 w-3.5" }) }),
761
+ /* @__PURE__ */ r("div", { className: "mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-control border border-border/70", children: /* @__PURE__ */ r(H, { className: "h-3.5 w-3.5" }) }),
600
762
  /* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: [
601
763
  /* @__PURE__ */ r("h2", { className: "truncate text-[13px] font-semibold leading-tight", children: "Brand Studio" }),
602
764
  /* @__PURE__ */ d("p", { className: "truncate text-[11px] leading-tight text-muted-foreground", children: [
@@ -605,17 +767,17 @@ function Or({
605
767
  ] })
606
768
  ] }),
607
769
  /* @__PURE__ */ d(
608
- ue,
770
+ ye,
609
771
  {
610
- open: oe,
611
- onOpenChange: Oe,
772
+ open: ce,
773
+ onOpenChange: Me,
612
774
  children: [
613
- /* @__PURE__ */ r(pe, { asChild: !0, children: /* @__PURE__ */ d(C, { type: "button", size: "xs", variant: "ghost", disabled: !p, children: [
614
- /* @__PURE__ */ r(ze, { className: "h-3.5 w-3.5" }),
775
+ /* @__PURE__ */ r(Ne, { asChild: !0, children: /* @__PURE__ */ d(S, { type: "button", size: "xs", variant: "ghost", disabled: !i, children: [
776
+ /* @__PURE__ */ r(qe, { className: "h-3.5 w-3.5" }),
615
777
  "Brand Spec"
616
778
  ] }) }),
617
779
  /* @__PURE__ */ d(
618
- be,
780
+ Se,
619
781
  {
620
782
  align: "end",
621
783
  sideOffset: 6,
@@ -628,44 +790,44 @@ function Or({
628
790
  ] }),
629
791
  /* @__PURE__ */ d("div", { className: "flex shrink-0 items-center gap-1", children: [
630
792
  /* @__PURE__ */ d(
631
- C,
793
+ S,
632
794
  {
633
795
  type: "button",
634
796
  size: "xs",
635
797
  variant: "ghost",
636
- onClick: Re,
798
+ onClick: Ve,
637
799
  children: [
638
- /* @__PURE__ */ r(rr, { className: "h-3.5 w-3.5" }),
639
- Ne === "copied" ? "Copied" : "Copy"
800
+ /* @__PURE__ */ r(xr, { className: "h-3.5 w-3.5" }),
801
+ De === "copied" ? "Copied" : "Copy"
640
802
  ]
641
803
  }
642
804
  ),
643
805
  /* @__PURE__ */ d(
644
- C,
806
+ S,
645
807
  {
646
808
  type: "button",
647
809
  size: "xs",
648
810
  variant: "ghost",
649
811
  onClick: () => {
650
812
  var o;
651
- return (o = ae.current) == null ? void 0 : o.click();
813
+ return (o = se.current) == null ? void 0 : o.click();
652
814
  },
653
815
  children: [
654
- /* @__PURE__ */ r(Ze, { className: "h-3.5 w-3.5" }),
816
+ /* @__PURE__ */ r(fr, { className: "h-3.5 w-3.5" }),
655
817
  "Upload"
656
818
  ]
657
819
  }
658
820
  ),
659
- /* @__PURE__ */ r(C, { type: "button", size: "xs", onClick: Ae, children: "Apply" })
821
+ /* @__PURE__ */ r(S, { type: "button", size: "xs", onClick: Ge, children: "Apply" })
660
822
  ] })
661
823
  ] }),
662
824
  /* @__PURE__ */ r("div", { className: "h-[320px] overflow-hidden rounded-control border border-input", children: /* @__PURE__ */ r(
663
- De,
825
+ Ke,
664
826
  {
665
827
  ariaLabel: "Brand spec",
666
- value: A,
828
+ value: z,
667
829
  onValueChange: (o) => {
668
- I(o), F("idle");
830
+ U(o), O("idle");
669
831
  },
670
832
  language: "json",
671
833
  embedded: !0,
@@ -682,111 +844,111 @@ function Or({
682
844
  /* @__PURE__ */ r(
683
845
  "input",
684
846
  {
685
- ref: ae,
847
+ ref: se,
686
848
  "aria-label": "Upload brand spec",
687
849
  type: "file",
688
850
  accept: "application/json,.json",
689
851
  className: "sr-only",
690
- onChange: Ee
852
+ onChange: He
691
853
  }
692
854
  ),
693
855
  /* @__PURE__ */ d(
694
- C,
856
+ S,
695
857
  {
696
858
  type: "button",
697
859
  size: "xs",
698
860
  variant: "ghost",
699
- onClick: Te,
700
- disabled: !p,
861
+ onClick: Ue,
862
+ disabled: !i,
701
863
  children: [
702
- /* @__PURE__ */ r(ge, { className: "h-3.5 w-3.5" }),
864
+ /* @__PURE__ */ r(we, { className: "h-3.5 w-3.5" }),
703
865
  "Reset"
704
866
  ]
705
867
  }
706
868
  ),
707
- x && /* @__PURE__ */ d(
708
- C,
869
+ v && /* @__PURE__ */ d(
870
+ S,
709
871
  {
710
872
  type: "button",
711
873
  size: "xs",
712
874
  variant: "ghost",
713
- onClick: Be,
714
- disabled: J,
875
+ onClick: Le,
876
+ disabled: L,
715
877
  children: [
716
- /* @__PURE__ */ r(er, { className: "h-3.5 w-3.5" }),
878
+ /* @__PURE__ */ r(hr, { className: "h-3.5 w-3.5" }),
717
879
  "No config"
718
880
  ]
719
881
  }
720
882
  ),
721
883
  /* @__PURE__ */ d(
722
- C,
884
+ S,
723
885
  {
724
886
  type: "button",
725
887
  size: "xs",
726
- onClick: Pe,
727
- disabled: !p || J || !!E || !y,
888
+ onClick: Je,
889
+ disabled: !i || L || !!D || !x,
728
890
  children: [
729
- J ? /* @__PURE__ */ r(ce, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(Ke, { className: "h-3.5 w-3.5" }),
891
+ L ? /* @__PURE__ */ r(fe, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ r(mr, { className: "h-3.5 w-3.5" }),
730
892
  "Save"
731
893
  ]
732
894
  }
733
895
  ),
734
- w && /* @__PURE__ */ r(
896
+ b && /* @__PURE__ */ r(
735
897
  "button",
736
898
  {
737
899
  type: "button",
738
900
  "aria-label": "Close Brand Studio",
739
901
  className: "flex h-7 w-7 items-center justify-center rounded-control text-muted-foreground hover:bg-muted hover:text-foreground",
740
- onClick: w,
741
- children: /* @__PURE__ */ r(je, { className: "h-3.5 w-3.5" })
902
+ onClick: b,
903
+ children: /* @__PURE__ */ r(Xe, { className: "h-3.5 w-3.5" })
742
904
  }
743
905
  )
744
906
  ] }),
745
907
  /* @__PURE__ */ d("div", { className: "flex shrink-0 items-center justify-between border-b border-border/60 px-4 py-2", children: [
746
- /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[12px] text-muted-foreground", children: E ? /* @__PURE__ */ d(de, { children: [
747
- /* @__PURE__ */ r(ie, { className: "h-3.5 w-3.5 text-destructive" }),
908
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[12px] text-muted-foreground", children: D ? /* @__PURE__ */ d(ue, { children: [
909
+ /* @__PURE__ */ r(me, { className: "h-3.5 w-3.5 text-destructive" }),
748
910
  "Preview keeps the last valid draft"
749
- ] }) : /* @__PURE__ */ d(de, { children: [
750
- /* @__PURE__ */ r(Ie, { className: "h-3.5 w-3.5 text-emerald-500" }),
911
+ ] }) : /* @__PURE__ */ d(ue, { children: [
912
+ /* @__PURE__ */ r(Ze, { className: "h-3.5 w-3.5 text-emerald-500" }),
751
913
  "Draft is applied to the live dashboard preview"
752
914
  ] }) }),
753
915
  /* @__PURE__ */ r("div", { className: "inline-flex h-7 items-center overflow-hidden rounded-control border border-border/70", children: ["light", "dark"].map((o) => /* @__PURE__ */ r(
754
916
  "button",
755
917
  {
756
918
  type: "button",
757
- className: Q(
919
+ className: te(
758
920
  "h-full px-2.5 text-[12px] capitalize transition-colors",
759
- B === o ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"
921
+ y === o ? "bg-muted text-foreground" : "text-muted-foreground hover:text-foreground"
760
922
  ),
761
- onClick: () => O(o),
923
+ onClick: () => F(o),
762
924
  children: o
763
925
  },
764
926
  o
765
927
  )) })
766
928
  ] }),
767
- E && /* @__PURE__ */ r("div", { className: "border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-[12px] text-destructive", children: E }),
768
- n ? /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ r(ce, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : i ? /* @__PURE__ */ r("div", { className: "p-4 text-[13px] text-muted-foreground", children: i }) : p && s ? /* @__PURE__ */ d(Je, { defaultValue: "style", className: "flex min-h-0 flex-1 flex-col", children: [
769
- /* @__PURE__ */ r("div", { className: "shrink-0 px-4 pt-3", children: /* @__PURE__ */ d(Le, { variant: "underline", className: "w-full gap-5", children: [
770
- /* @__PURE__ */ r(L, { value: "style", children: "Style" }),
771
- /* @__PURE__ */ r(L, { value: "surfaces", children: "Surfaces" }),
772
- /* @__PURE__ */ r(L, { value: "data", children: "Data" })
929
+ D && /* @__PURE__ */ r("div", { className: "border-b border-destructive/20 bg-destructive/5 px-4 py-2 text-[12px] text-destructive", children: D }),
930
+ n ? /* @__PURE__ */ r("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ r(fe, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : s ? /* @__PURE__ */ r("div", { className: "p-4 text-[13px] text-muted-foreground", children: s }) : i && u ? /* @__PURE__ */ d(Qe, { defaultValue: "style", className: "flex min-h-0 flex-1 flex-col", children: [
931
+ /* @__PURE__ */ r("div", { className: "shrink-0 px-4 pt-3", children: /* @__PURE__ */ d(er, { variant: "underline", className: "w-full gap-5", children: [
932
+ /* @__PURE__ */ r(V, { value: "style", children: "Style" }),
933
+ /* @__PURE__ */ r(V, { value: "surfaces", children: "Surfaces" }),
934
+ /* @__PURE__ */ r(V, { value: "data", children: "Data" })
773
935
  ] }) }),
774
- /* @__PURE__ */ d($e, { className: "min-h-0 flex-1", children: [
775
- /* @__PURE__ */ d($, { value: "style", className: "m-0 p-4", children: [
936
+ /* @__PURE__ */ d(rr, { className: "min-h-0 flex-1", children: [
937
+ /* @__PURE__ */ d(G, { value: "style", className: "m-0 p-4", children: [
776
938
  /* @__PURE__ */ r(
777
- v,
939
+ P,
778
940
  {
779
- icon: _,
941
+ icon: H,
780
942
  title: "Presets",
781
943
  description: "Start from a full light and dark appearance.",
782
- children: /* @__PURE__ */ r("div", { className: "grid grid-cols-1 gap-2", children: Ce.map((o) => /* @__PURE__ */ d(
944
+ children: /* @__PURE__ */ r("div", { className: "grid grid-cols-1 gap-2", children: Ae.map((o) => /* @__PURE__ */ d(
783
945
  "button",
784
946
  {
785
947
  type: "button",
786
948
  className: "flex items-center gap-3 rounded-control border border-border/70 px-3 py-2 text-left hover:bg-muted/60",
787
949
  onClick: () => {
788
- const t = nr(p, o.id);
789
- u(t);
950
+ const t = Fr(i, o.id);
951
+ p(t);
790
952
  },
791
953
  children: [
792
954
  /* @__PURE__ */ d("div", { className: "flex h-7 w-10 overflow-hidden rounded-control border border-border/70", children: [
@@ -816,18 +978,18 @@ function Or({
816
978
  }
817
979
  ),
818
980
  /* @__PURE__ */ r(
819
- v,
981
+ P,
820
982
  {
821
- icon: _,
983
+ icon: H,
822
984
  title: "Color",
823
- description: `Editing the ${B} scheme.`,
824
- children: /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2", children: dr.map(([o, t]) => /* @__PURE__ */ r(
825
- k,
985
+ description: `Editing the ${y} scheme.`,
986
+ children: /* @__PURE__ */ r("div", { className: "grid grid-cols-2 gap-2", children: Or.map(([o, t]) => /* @__PURE__ */ r(
987
+ N,
826
988
  {
827
989
  label: t,
828
- value: s.tokens.color[o],
829
- onChange: (h) => l((S) => {
830
- U(S, o, h);
990
+ value: u.tokens.color[o],
991
+ onChange: (k) => m((w) => {
992
+ Y(w, o, k);
831
993
  })
832
994
  },
833
995
  o
@@ -835,45 +997,45 @@ function Or({
835
997
  }
836
998
  ),
837
999
  /* @__PURE__ */ d(
838
- v,
1000
+ P,
839
1001
  {
840
- icon: _e,
1002
+ icon: or,
841
1003
  title: "Typography",
842
1004
  description: "Fonts and density used by dashboard and workflow chrome.",
843
1005
  children: [
844
1006
  /* @__PURE__ */ r(
845
- sr,
1007
+ Br,
846
1008
  {
847
- value: s.tokens.typography.fontFamily,
848
- onChange: (o) => l((t) => {
1009
+ value: u.tokens.typography.fontFamily,
1010
+ onChange: (o) => m((t) => {
849
1011
  t.tokens.typography.fontFamily = o, t.tokens.typography.headingFontFamily = o;
850
1012
  })
851
1013
  }
852
1014
  ),
853
1015
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
854
1016
  /* @__PURE__ */ r(
855
- N,
1017
+ K,
856
1018
  {
857
1019
  label: "Base size",
858
- value: s.tokens.typography.baseFontSize,
1020
+ value: u.tokens.typography.baseFontSize,
859
1021
  min: 11,
860
1022
  max: 18,
861
- onChange: (o) => l((t) => {
1023
+ onChange: (o) => m((t) => {
862
1024
  t.tokens.typography.baseFontSize = o;
863
1025
  })
864
1026
  }
865
1027
  ),
866
1028
  /* @__PURE__ */ r(
867
- W,
1029
+ X,
868
1030
  {
869
1031
  label: "Density",
870
- value: s.tokens.typography.density,
1032
+ value: u.tokens.typography.density,
871
1033
  options: [
872
1034
  ["compact", "Compact"],
873
1035
  ["comfortable", "Comfortable"],
874
1036
  ["spacious", "Spacious"]
875
1037
  ],
876
- onChange: (o) => l((t) => {
1038
+ onChange: (o) => m((t) => {
877
1039
  t.tokens.typography.density = o, t.components.table.density = t.tokens.typography.density;
878
1040
  })
879
1041
  }
@@ -883,92 +1045,39 @@ function Or({
883
1045
  }
884
1046
  )
885
1047
  ] }),
886
- /* @__PURE__ */ d($, { value: "surfaces", className: "m-0 p-4", children: [
1048
+ /* @__PURE__ */ d(G, { value: "surfaces", className: "m-0 p-4", children: [
887
1049
  /* @__PURE__ */ d(
888
- v,
1050
+ P,
889
1051
  {
890
- icon: Qe,
1052
+ icon: gr,
891
1053
  title: "Layout",
892
1054
  description: "Canvas, grid, and card rhythm for embedded dashboards.",
893
1055
  children: [
1056
+ _ ? /* @__PURE__ */ r(yr, { spec: _, mode: y, onEdit: $e }) : null,
894
1057
  /* @__PURE__ */ d("div", { className: "grid grid-cols-3 gap-2", children: [
895
1058
  /* @__PURE__ */ r(
896
- N,
897
- {
898
- label: "Canvas pad",
899
- tooltip: "Outer padding around the dashboard canvas before cards begin.",
900
- value: s.tokens.spacing.dashboardPadding,
901
- min: 0,
902
- max: 48,
903
- onChange: (o) => l((t) => {
904
- t.tokens.spacing.dashboardPadding = o, t.components.dashboard.padding = o;
905
- })
906
- }
907
- ),
908
- /* @__PURE__ */ r(
909
- N,
910
- {
911
- label: "Grid gap",
912
- tooltip: "Spacing between dashboard cards in the grid.",
913
- value: s.tokens.spacing.gridGap,
914
- min: 0,
915
- max: 32,
916
- onChange: (o) => l((t) => {
917
- t.tokens.spacing.gridGap = o;
918
- })
919
- }
920
- ),
921
- /* @__PURE__ */ r(
922
- N,
1059
+ K,
923
1060
  {
924
1061
  label: "Card pad",
925
1062
  tooltip: "Inner padding inside card/widget frames around titles, controls, and visual content.",
926
- value: s.tokens.spacing.cardPadding,
1063
+ value: u.tokens.spacing.cardPadding,
927
1064
  min: 0,
928
1065
  max: 32,
929
- onChange: (o) => l((t) => {
930
- t.tokens.spacing.cardPadding = o, t.components.card.padding = o;
931
- })
932
- }
933
- )
934
- ] }),
935
- /* @__PURE__ */ d("div", { className: "grid grid-cols-3 gap-2", children: [
936
- /* @__PURE__ */ r(
937
- N,
938
- {
939
- label: "Control radius",
940
- tooltip: "Corner radius for buttons, inputs, selects, checkboxes, segmented controls, and similar interactive controls.",
941
- value: s.tokens.radius.control,
942
- min: 0,
943
- max: 12,
944
- onChange: (o) => l((t) => {
945
- V(t, "control", o);
1066
+ onChange: (o) => m((t) => {
1067
+ t.tokens.spacing.cardPadding = o;
946
1068
  })
947
1069
  }
948
1070
  ),
949
1071
  /* @__PURE__ */ r(
950
- N,
951
- {
952
- label: "Card/widget radius",
953
- tooltip: "Corner radius for dashboard card frames and widget containers.",
954
- value: s.tokens.radius.card,
955
- min: 0,
956
- max: 12,
957
- onChange: (o) => l((t) => {
958
- V(t, "card", o);
959
- })
960
- }
961
- ),
962
- /* @__PURE__ */ r(
963
- N,
1072
+ K,
964
1073
  {
965
1074
  label: "Table radius",
966
1075
  tooltip: "Corner radius for table containers, table chrome, and table pagination surfaces.",
967
- value: s.tokens.radius.table,
1076
+ value: u.tokens.radius.table,
968
1077
  min: 0,
969
1078
  max: 12,
970
- onChange: (o) => l((t) => {
971
- V(t, "table", o);
1079
+ onChange: (o) => m((t) => {
1080
+ Pr(t, "table", o);
972
1081
  })
973
1082
  }
974
1083
  )
@@ -977,53 +1086,53 @@ function Or({
977
1086
  }
978
1087
  ),
979
1088
  /* @__PURE__ */ r(
980
- v,
1089
+ P,
981
1090
  {
982
- icon: ie,
1091
+ icon: me,
983
1092
  title: "Filters and Controls",
984
1093
  description: "Dashboard filter/control toolbar, chip states, menus, and settings panels.",
985
1094
  children: /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
986
1095
  /* @__PURE__ */ r(
987
- k,
1096
+ N,
988
1097
  {
989
1098
  label: "Toolbar background",
990
1099
  tooltip: "Background color for the dashboard filter/control toolbar strip. This is separate from chip state colors.",
991
- value: s.components.interactive.toolbarBackground || s.tokens.color.background,
992
- onChange: (o) => l((t) => {
1100
+ value: u.components.interactive.toolbarBackground || u.tokens.color.background,
1101
+ onChange: (o) => m((t) => {
993
1102
  t.components.interactive.toolbarBackground = o;
994
1103
  })
995
1104
  }
996
1105
  ),
997
1106
  /* @__PURE__ */ r(
998
- k,
1107
+ N,
999
1108
  {
1000
1109
  label: "Default state",
1001
1110
  tooltip: "Unselected filter/control chips plus the base surface for their menus, dialogs, and pagination fallback.",
1002
- value: s.components.interactive.background || s.tokens.color.card,
1003
- onChange: (o) => l((t) => {
1111
+ value: u.components.interactive.background || u.tokens.color.card,
1112
+ onChange: (o) => m((t) => {
1004
1113
  t.components.interactive.background = o, t.components.pagination.background = o;
1005
1114
  })
1006
1115
  }
1007
1116
  ),
1008
1117
  /* @__PURE__ */ r(
1009
- k,
1118
+ N,
1010
1119
  {
1011
1120
  label: "Border",
1012
1121
  tooltip: "Border color for filter/control chips, runtime inputs, settings panels, and related popover chrome.",
1013
- value: s.components.interactive.borderColor || s.tokens.color.border,
1014
- onChange: (o) => l((t) => {
1122
+ value: u.components.interactive.borderColor || u.tokens.color.border,
1123
+ onChange: (o) => m((t) => {
1015
1124
  t.components.interactive.borderColor = o, t.components.pagination.borderColor = o;
1016
1125
  })
1017
1126
  }
1018
1127
  ),
1019
1128
  /* @__PURE__ */ r(
1020
- k,
1129
+ N,
1021
1130
  {
1022
1131
  label: "Selected state",
1023
1132
  tooltip: "Selected filter/control chips and hover feedback. This keeps a lighter default state and a stronger selected state.",
1024
- value: s.tokens.color.accent,
1025
- onChange: (o) => l((t) => {
1026
- U(t, "accent", o);
1133
+ value: u.tokens.color.accent,
1134
+ onChange: (o) => m((t) => {
1135
+ Y(t, "accent", o);
1027
1136
  })
1028
1137
  }
1029
1138
  )
@@ -1031,42 +1140,68 @@ function Or({
1031
1140
  }
1032
1141
  )
1033
1142
  ] }),
1034
- /* @__PURE__ */ d($, { value: "data", className: "m-0 p-4", children: [
1143
+ /* @__PURE__ */ d(G, { value: "data", className: "m-0 p-4", children: [
1035
1144
  /* @__PURE__ */ d(
1036
- v,
1145
+ P,
1037
1146
  {
1038
- icon: Ue,
1147
+ icon: ar,
1039
1148
  title: "Charts",
1040
1149
  description: "Palette and semantic chart text/grid colors.",
1041
1150
  children: [
1042
- /* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: cr.map((o) => /* @__PURE__ */ r(
1043
- k,
1151
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2", children: u.components.chart.palette.map((o, t) => /* @__PURE__ */ d("div", { className: "flex items-end gap-1", children: [
1152
+ /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ r(
1153
+ N,
1154
+ {
1155
+ label: `Series ${t + 1}`,
1156
+ value: o || "#000000",
1157
+ onChange: (k) => m((w) => {
1158
+ w.components.chart.palette[t] = k;
1159
+ })
1160
+ }
1161
+ ) }),
1162
+ u.components.chart.palette.length > 1 ? /* @__PURE__ */ r(
1163
+ S,
1164
+ {
1165
+ size: "xs",
1166
+ variant: "ghost",
1167
+ "aria-label": `Remove series ${t + 1} color`,
1168
+ className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
1169
+ onClick: () => m((k) => {
1170
+ k.components.chart.palette.splice(t, 1);
1171
+ }),
1172
+ children: "×"
1173
+ }
1174
+ ) : null
1175
+ ] }, t)) }),
1176
+ u.components.chart.palette.length < 12 ? /* @__PURE__ */ r(
1177
+ S,
1044
1178
  {
1045
- label: `Series ${o + 1}`,
1046
- value: s.components.chart.palette[o] || "#000000",
1047
- onChange: (t) => l((h) => {
1048
- h.components.chart.palette[o] = t;
1049
- })
1050
- },
1051
- o
1052
- )) }),
1179
+ size: "xs",
1180
+ variant: "outline",
1181
+ className: "w-fit",
1182
+ onClick: () => m((o) => {
1183
+ o.components.chart.palette.push("#64748b");
1184
+ }),
1185
+ children: "Add a color"
1186
+ }
1187
+ ) : null,
1053
1188
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
1054
1189
  /* @__PURE__ */ r(
1055
- k,
1190
+ N,
1056
1191
  {
1057
1192
  label: "Grid",
1058
- value: s.components.chart.gridColor,
1059
- onChange: (o) => l((t) => {
1193
+ value: u.components.chart.gridColor,
1194
+ onChange: (o) => m((t) => {
1060
1195
  t.components.chart.gridColor = o;
1061
1196
  })
1062
1197
  }
1063
1198
  ),
1064
1199
  /* @__PURE__ */ r(
1065
- k,
1200
+ N,
1066
1201
  {
1067
1202
  label: "Axis",
1068
- value: s.components.chart.axisColor,
1069
- onChange: (o) => l((t) => {
1203
+ value: u.components.chart.axisColor,
1204
+ onChange: (o) => m((t) => {
1070
1205
  t.components.chart.axisColor = o;
1071
1206
  })
1072
1207
  }
@@ -1076,38 +1211,38 @@ function Or({
1076
1211
  }
1077
1212
  ),
1078
1213
  /* @__PURE__ */ d(
1079
- v,
1214
+ P,
1080
1215
  {
1081
- icon: Ve,
1216
+ icon: nr,
1082
1217
  title: "Tables",
1083
1218
  description: "All tables share this appearance.",
1084
1219
  children: [
1085
1220
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
1086
1221
  /* @__PURE__ */ r(
1087
- W,
1222
+ X,
1088
1223
  {
1089
1224
  label: "Density",
1090
- value: s.components.table.density,
1225
+ value: u.components.table.density,
1091
1226
  options: [
1092
1227
  ["compact", "Compact"],
1093
1228
  ["comfortable", "Comfortable"],
1094
1229
  ["spacious", "Spacious"]
1095
1230
  ],
1096
- onChange: (o) => l((t) => {
1231
+ onChange: (o) => m((t) => {
1097
1232
  t.components.table.density = o;
1098
1233
  })
1099
1234
  }
1100
1235
  ),
1101
1236
  /* @__PURE__ */ r(
1102
- W,
1237
+ X,
1103
1238
  {
1104
1239
  label: "Cell wrap",
1105
- value: s.components.table.cell.wrap,
1240
+ value: u.components.table.cell.wrap,
1106
1241
  options: [
1107
1242
  ["nowrap", "No wrap"],
1108
1243
  ["wrap", "Wrap"]
1109
1244
  ],
1110
- onChange: (o) => l((t) => {
1245
+ onChange: (o) => m((t) => {
1111
1246
  t.components.table.cell.wrap = o;
1112
1247
  })
1113
1248
  }
@@ -1115,62 +1250,62 @@ function Or({
1115
1250
  ] }),
1116
1251
  /* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-2", children: [
1117
1252
  /* @__PURE__ */ r(
1118
- k,
1253
+ N,
1119
1254
  {
1120
1255
  label: "Header",
1121
- value: s.components.table.header.background,
1122
- onChange: (o) => l((t) => {
1256
+ value: u.components.table.header.background,
1257
+ onChange: (o) => m((t) => {
1123
1258
  t.components.table.header.background = o;
1124
1259
  })
1125
1260
  }
1126
1261
  ),
1127
1262
  /* @__PURE__ */ r(
1128
- k,
1263
+ N,
1129
1264
  {
1130
1265
  label: "Divider",
1131
- value: s.components.table.row.dividerColor,
1132
- onChange: (o) => l((t) => {
1266
+ value: u.components.table.row.dividerColor,
1267
+ onChange: (o) => m((t) => {
1133
1268
  t.components.table.row.dividerColor = o, t.components.table.header.dividerColor = o;
1134
1269
  })
1135
1270
  }
1136
1271
  ),
1137
1272
  /* @__PURE__ */ r(
1138
- k,
1273
+ N,
1139
1274
  {
1140
1275
  label: "Selection",
1141
- value: s.tokens.color.selection,
1142
- onChange: (o) => l((t) => {
1143
- U(t, "selection", o);
1276
+ value: u.tokens.color.selection,
1277
+ onChange: (o) => m((t) => {
1278
+ Y(t, "selection", o);
1144
1279
  })
1145
1280
  }
1146
1281
  )
1147
1282
  ] }),
1148
1283
  /* @__PURE__ */ r(
1149
- H,
1284
+ Z,
1150
1285
  {
1151
1286
  label: "Zebra rows",
1152
- checked: s.components.table.row.zebra,
1153
- onCheckedChange: (o) => l((t) => {
1287
+ checked: u.components.table.row.zebra,
1288
+ onCheckedChange: (o) => m((t) => {
1154
1289
  t.components.table.row.zebra = o;
1155
1290
  })
1156
1291
  }
1157
1292
  ),
1158
1293
  /* @__PURE__ */ r(
1159
- H,
1294
+ Z,
1160
1295
  {
1161
1296
  label: "Sticky headers",
1162
- checked: s.components.table.header.sticky,
1163
- onCheckedChange: (o) => l((t) => {
1297
+ checked: u.components.table.header.sticky,
1298
+ onCheckedChange: (o) => m((t) => {
1164
1299
  t.components.table.header.sticky = o;
1165
1300
  })
1166
1301
  }
1167
1302
  ),
1168
1303
  /* @__PURE__ */ r(
1169
- H,
1304
+ Z,
1170
1305
  {
1171
1306
  label: "Uppercase headers",
1172
- checked: s.components.table.header.uppercase,
1173
- onCheckedChange: (o) => l((t) => {
1307
+ checked: u.components.table.header.uppercase,
1308
+ onCheckedChange: (o) => m((t) => {
1174
1309
  t.components.table.header.uppercase = o;
1175
1310
  })
1176
1311
  }
@@ -1185,7 +1320,7 @@ function Or({
1185
1320
  }
1186
1321
  );
1187
1322
  }
1188
- function v({
1323
+ function P({
1189
1324
  icon: e,
1190
1325
  title: a,
1191
1326
  description: n,
@@ -1200,31 +1335,31 @@ function v({
1200
1335
  ] })
1201
1336
  ] }),
1202
1337
  /* @__PURE__ */ r("div", { className: "space-y-2", children: c }),
1203
- /* @__PURE__ */ r(Me, { className: "mt-5 bg-border/60" })
1338
+ /* @__PURE__ */ r(tr, { className: "mt-5 bg-border/60" })
1204
1339
  ] });
1205
1340
  }
1206
- function sr({
1341
+ function Br({
1207
1342
  value: e,
1208
1343
  onChange: a
1209
1344
  }) {
1210
1345
  var c;
1211
- const n = (c = M.find((i) => i.value === e)) == null ? void 0 : c.id;
1346
+ const n = (c = W.find((s) => s.value === e)) == null ? void 0 : c.id;
1212
1347
  return /* @__PURE__ */ d("div", { children: [
1213
- /* @__PURE__ */ r(T, { className: "mb-1 block text-[11px] font-normal text-muted-foreground", children: "Font family" }),
1348
+ /* @__PURE__ */ r(E, { className: "mb-1 block text-[11px] font-normal text-muted-foreground", children: "Font family" }),
1214
1349
  /* @__PURE__ */ d("div", { className: "grid grid-cols-[minmax(0,1fr)_150px] gap-2", children: [
1215
1350
  /* @__PURE__ */ d(
1216
- me,
1351
+ Pe,
1217
1352
  {
1218
1353
  value: n,
1219
- onValueChange: (i) => {
1220
- const f = M.find(
1221
- (g) => g.id === i
1354
+ onValueChange: (s) => {
1355
+ const f = W.find(
1356
+ (h) => h.id === s
1222
1357
  );
1223
1358
  f && a(f.value);
1224
1359
  },
1225
1360
  children: [
1226
- /* @__PURE__ */ r(he, { size: "xs", "aria-label": "Font family preset", children: /* @__PURE__ */ r(ke, { placeholder: "Select font" }) }),
1227
- /* @__PURE__ */ r(xe, { children: M.map((i) => /* @__PURE__ */ r(ye, { value: i.id, children: i.label }, i.id)) })
1361
+ /* @__PURE__ */ r(Oe, { size: "xs", "aria-label": "Font family preset", children: /* @__PURE__ */ r(Te, { placeholder: "Select font" }) }),
1362
+ /* @__PURE__ */ r(Be, { children: W.map((s) => /* @__PURE__ */ r(Re, { value: s.id, children: s.label }, s.id)) })
1228
1363
  ]
1229
1364
  }
1230
1365
  ),
@@ -1239,34 +1374,34 @@ function sr({
1239
1374
  ] })
1240
1375
  ] });
1241
1376
  }
1242
- function k({
1377
+ function N({
1243
1378
  label: e,
1244
1379
  tooltip: a,
1245
1380
  value: n,
1246
1381
  onChange: c
1247
1382
  }) {
1248
- const [i, f] = b.useState(!1), [g, y] = b.useState(n), x = lr(n), w = n !== g, p = (u) => {
1249
- f(u), u && y(n);
1383
+ const [s, f] = g.useState(!1), [h, x] = g.useState(n), v = Rr(n), b = n !== h, i = (p) => {
1384
+ f(p), p && x(n);
1250
1385
  };
1251
1386
  return /* @__PURE__ */ d("div", { className: "block", children: [
1252
1387
  /* @__PURE__ */ d("div", { className: "mb-1 flex items-center gap-1", children: [
1253
- /* @__PURE__ */ r(T, { className: "text-[11px] font-normal text-muted-foreground", children: e }),
1254
- a ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ d(Y, { children: [
1255
- /* @__PURE__ */ r(q, { asChild: !0, children: /* @__PURE__ */ r(
1388
+ /* @__PURE__ */ r(E, { className: "text-[11px] font-normal text-muted-foreground", children: e }),
1389
+ a ? /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ d(ee, { children: [
1390
+ /* @__PURE__ */ r(re, { asChild: !0, children: /* @__PURE__ */ r(
1256
1391
  "button",
1257
1392
  {
1258
1393
  type: "button",
1259
1394
  "aria-label": `${e} details`,
1260
1395
  className: "inline-flex h-3.5 w-3.5 items-center justify-center rounded-control text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",
1261
- children: /* @__PURE__ */ r(fe, { className: "h-3 w-3" })
1396
+ children: /* @__PURE__ */ r(Fe, { className: "h-3 w-3" })
1262
1397
  }
1263
1398
  ) }),
1264
- /* @__PURE__ */ r(Z, { side: "top", className: "max-w-64", children: a })
1399
+ /* @__PURE__ */ r(oe, { side: "top", className: "max-w-64", children: a })
1265
1400
  ] }) }) : null
1266
1401
  ] }),
1267
1402
  /* @__PURE__ */ d("div", { className: "flex h-7 items-center overflow-hidden rounded-control border border-input bg-background", children: [
1268
- /* @__PURE__ */ d(ue, { open: i, onOpenChange: p, children: [
1269
- /* @__PURE__ */ r(pe, { asChild: !0, children: /* @__PURE__ */ r(
1403
+ /* @__PURE__ */ d(ye, { open: s, onOpenChange: i, children: [
1404
+ /* @__PURE__ */ r(Ne, { asChild: !0, children: /* @__PURE__ */ r(
1270
1405
  "button",
1271
1406
  {
1272
1407
  type: "button",
@@ -1277,7 +1412,7 @@ function k({
1277
1412
  }
1278
1413
  ) }),
1279
1414
  /* @__PURE__ */ d(
1280
- be,
1415
+ Se,
1281
1416
  {
1282
1417
  align: "start",
1283
1418
  sideOffset: 6,
@@ -1295,176 +1430,177 @@ function k({
1295
1430
  {
1296
1431
  "aria-label": `${e} native color picker`,
1297
1432
  type: "color",
1298
- value: x,
1299
- onChange: (u) => c(u.target.value),
1433
+ value: v,
1434
+ onChange: (p) => c(p.target.value),
1300
1435
  className: "absolute inset-0 h-full w-full cursor-pointer opacity-0"
1301
1436
  }
1302
1437
  ),
1303
- /* @__PURE__ */ r("span", { className: "rounded-control bg-black/45 p-1 text-white shadow-sm", children: /* @__PURE__ */ r(or, { className: "h-3.5 w-3.5" }) })
1438
+ /* @__PURE__ */ r("span", { className: "rounded-control bg-black/45 p-1 text-white shadow-sm", children: /* @__PURE__ */ r(vr, { className: "h-3.5 w-3.5" }) })
1304
1439
  ]
1305
1440
  }
1306
1441
  ),
1307
1442
  /* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: [
1308
1443
  /* @__PURE__ */ d("div", { className: "mb-1 flex items-center justify-between gap-2", children: [
1309
- /* @__PURE__ */ r(T, { className: "block text-[11px] font-normal text-muted-foreground", children: "Color value" }),
1310
- /* @__PURE__ */ r(X, { children: /* @__PURE__ */ d(Y, { children: [
1311
- /* @__PURE__ */ r(q, { asChild: !0, children: /* @__PURE__ */ r(
1444
+ /* @__PURE__ */ r(E, { className: "block text-[11px] font-normal text-muted-foreground", children: "Color value" }),
1445
+ /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ d(ee, { children: [
1446
+ /* @__PURE__ */ r(re, { asChild: !0, children: /* @__PURE__ */ r(
1312
1447
  "button",
1313
1448
  {
1314
1449
  type: "button",
1315
1450
  "aria-label": `Reset ${e} color to previous value`,
1316
- disabled: !w,
1451
+ disabled: !b,
1317
1452
  className: "inline-flex h-5 w-5 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:pointer-events-none disabled:opacity-35",
1318
- onClick: () => c(g),
1319
- children: /* @__PURE__ */ r(ge, { className: "h-3 w-3" })
1453
+ onClick: () => c(h),
1454
+ children: /* @__PURE__ */ r(we, { className: "h-3 w-3" })
1320
1455
  }
1321
1456
  ) }),
1322
- /* @__PURE__ */ r(Z, { side: "top", children: "Reset to previous value" })
1457
+ /* @__PURE__ */ r(oe, { side: "top", children: "Reset to previous value" })
1323
1458
  ] }) })
1324
1459
  ] }),
1325
1460
  /* @__PURE__ */ r(
1326
- K,
1461
+ ae,
1327
1462
  {
1328
1463
  size: "xs",
1329
1464
  "aria-label": `${e} popover color value`,
1330
1465
  value: n,
1331
- onChange: (u) => c(u.target.value),
1466
+ onChange: (p) => c(p.target.value),
1332
1467
  className: "font-mono"
1333
1468
  }
1334
1469
  )
1335
1470
  ] })
1336
1471
  ] }),
1337
- /* @__PURE__ */ r("div", { className: "mt-2 grid grid-cols-6 gap-1", children: ir.map((u) => /* @__PURE__ */ r(
1472
+ /* @__PURE__ */ r("div", { className: "mt-2 grid grid-cols-6 gap-1", children: Tr.map((p) => /* @__PURE__ */ r(
1338
1473
  "button",
1339
1474
  {
1340
1475
  type: "button",
1341
- "aria-label": `Set ${e} to ${u}`,
1342
- className: Q(
1476
+ "aria-label": `Set ${e} to ${p}`,
1477
+ className: te(
1343
1478
  "h-6 rounded-control border border-border/70 shadow-sm",
1344
- n.toLowerCase() === u && "ring-2 ring-ring"
1479
+ n.toLowerCase() === p && "ring-2 ring-ring"
1345
1480
  ),
1346
- style: { backgroundColor: u },
1347
- onClick: () => c(u)
1481
+ style: { backgroundColor: p },
1482
+ onClick: () => c(p)
1348
1483
  },
1349
- u
1484
+ p
1350
1485
  )) })
1351
1486
  ]
1352
1487
  }
1353
1488
  )
1354
1489
  ] }),
1355
1490
  /* @__PURE__ */ r(
1356
- K,
1491
+ ae,
1357
1492
  {
1358
1493
  size: "xs",
1359
1494
  "aria-label": `${e} color value`,
1360
1495
  value: n,
1361
- onChange: (u) => c(u.target.value),
1496
+ onChange: (p) => c(p.target.value),
1362
1497
  className: "h-full border-0 px-2 font-mono shadow-none focus-visible:border-0"
1363
1498
  }
1364
1499
  )
1365
1500
  ] })
1366
1501
  ] });
1367
1502
  }
1368
- function lr(e) {
1369
- const a = He(e);
1370
- return a ? `#${G(a.r)}${G(a.g)}${G(a.b)}` : "#000000";
1503
+ function Rr(e) {
1504
+ const a = sr(e);
1505
+ return a ? `#${q(a.r)}${q(a.g)}${q(a.b)}` : "#000000";
1371
1506
  }
1372
- function G(e) {
1507
+ function q(e) {
1373
1508
  return Math.round(e).toString(16).padStart(2, "0");
1374
1509
  }
1375
- function N({
1510
+ function K({
1376
1511
  label: e,
1377
1512
  tooltip: a,
1378
1513
  value: n,
1379
1514
  min: c,
1380
- max: i,
1515
+ max: s,
1381
1516
  onChange: f
1382
1517
  }) {
1383
- const g = b.useId();
1518
+ const h = g.useId();
1384
1519
  return /* @__PURE__ */ d("div", { className: "block", children: [
1385
1520
  /* @__PURE__ */ d("div", { className: "mb-1 flex items-center gap-1", children: [
1386
1521
  /* @__PURE__ */ r(
1387
- T,
1522
+ E,
1388
1523
  {
1389
- htmlFor: g,
1524
+ htmlFor: h,
1390
1525
  className: "text-[11px] font-normal text-muted-foreground",
1391
1526
  children: e
1392
1527
  }
1393
1528
  ),
1394
- a ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ d(Y, { children: [
1395
- /* @__PURE__ */ r(q, { asChild: !0, children: /* @__PURE__ */ r(
1529
+ a ? /* @__PURE__ */ r(Q, { children: /* @__PURE__ */ d(ee, { children: [
1530
+ /* @__PURE__ */ r(re, { asChild: !0, children: /* @__PURE__ */ r(
1396
1531
  "button",
1397
1532
  {
1398
1533
  type: "button",
1399
1534
  "aria-label": `${e} details`,
1400
1535
  className: "inline-flex h-3.5 w-3.5 items-center justify-center rounded-control text-muted-foreground/70 transition-colors hover:bg-muted hover:text-foreground",
1401
- children: /* @__PURE__ */ r(fe, { className: "h-3 w-3" })
1536
+ children: /* @__PURE__ */ r(Fe, { className: "h-3 w-3" })
1402
1537
  }
1403
1538
  ) }),
1404
- /* @__PURE__ */ r(Z, { side: "top", className: "max-w-56", children: a })
1539
+ /* @__PURE__ */ r(oe, { side: "top", className: "max-w-56", children: a })
1405
1540
  ] }) }) : null
1406
1541
  ] }),
1407
1542
  /* @__PURE__ */ r(
1408
- K,
1543
+ ae,
1409
1544
  {
1410
- id: g,
1545
+ id: h,
1411
1546
  size: "xs",
1412
1547
  type: "number",
1413
1548
  min: c,
1414
- max: i,
1549
+ max: s,
1415
1550
  value: n,
1416
- onChange: (y) => {
1417
- const x = Number(y.target.value);
1418
- Number.isNaN(x) || f(x);
1551
+ onChange: (x) => {
1552
+ const v = Number(x.target.value);
1553
+ Number.isNaN(v) || f(v);
1419
1554
  }
1420
1555
  }
1421
1556
  )
1422
1557
  ] });
1423
1558
  }
1424
- function W({
1559
+ function X({
1425
1560
  label: e,
1426
1561
  value: a,
1427
1562
  options: n,
1428
1563
  onChange: c
1429
1564
  }) {
1430
1565
  return /* @__PURE__ */ d("div", { children: [
1431
- /* @__PURE__ */ r(T, { className: "mb-1 block text-[11px] font-normal text-muted-foreground", children: e }),
1432
- /* @__PURE__ */ d(me, { value: a, onValueChange: c, children: [
1433
- /* @__PURE__ */ r(he, { size: "xs", children: /* @__PURE__ */ r(ke, {}) }),
1434
- /* @__PURE__ */ r(xe, { children: n.map(([i, f]) => /* @__PURE__ */ r(ye, { value: i, children: f }, i)) })
1566
+ /* @__PURE__ */ r(E, { className: "mb-1 block text-[11px] font-normal text-muted-foreground", children: e }),
1567
+ /* @__PURE__ */ d(Pe, { value: a, onValueChange: c, children: [
1568
+ /* @__PURE__ */ r(Oe, { size: "xs", children: /* @__PURE__ */ r(Te, {}) }),
1569
+ /* @__PURE__ */ r(Be, { children: n.map(([s, f]) => /* @__PURE__ */ r(Re, { value: s, children: f }, s)) })
1435
1570
  ] })
1436
1571
  ] });
1437
1572
  }
1438
- function H({
1573
+ function Z({
1439
1574
  label: e,
1440
1575
  checked: a,
1441
1576
  onCheckedChange: n
1442
1577
  }) {
1443
1578
  return /* @__PURE__ */ d("div", { className: "flex h-8 items-center justify-between rounded-control border border-border/60 px-2", children: [
1444
1579
  /* @__PURE__ */ r("span", { className: "text-[12px]", children: e }),
1445
- /* @__PURE__ */ r(Ge, { size: "xs", checked: a, onCheckedChange: n })
1580
+ /* @__PURE__ */ r(Ce, { size: "xs", checked: a, onCheckedChange: n })
1446
1581
  ] });
1447
1582
  }
1448
- function ur(e) {
1583
+ function Er(e) {
1449
1584
  const a = `${Number((e / 16).toFixed(4))}rem`;
1450
1585
  return {
1451
1586
  "--semaphor-radius": a,
1452
1587
  "--semaphor-control-radius": a
1453
1588
  };
1454
1589
  }
1455
- function pr(e) {
1590
+ function Ar(e) {
1456
1591
  return JSON.parse(JSON.stringify(e));
1457
1592
  }
1458
- function br(e) {
1593
+ function zr(e) {
1459
1594
  return typeof e.text == "function" ? e.text() : new Promise((a, n) => {
1460
1595
  const c = new FileReader();
1461
1596
  c.onload = () => a(String(c.result ?? "")), c.onerror = () => n(c.error ?? new Error("Unable to read file")), c.readAsText(e);
1462
1597
  });
1463
1598
  }
1464
1599
  export {
1465
- Ce as BRAND_STUDIO_PRESETS,
1466
- Or as BrandStudioEditor,
1467
- nr as applyBrandStudioPreset,
1468
- j as buildAppearanceSpecFromDraft,
1469
- D as createBrandStudioDraft
1600
+ Ae as BRAND_STUDIO_PRESETS,
1601
+ Zr as BrandStudioEditor,
1602
+ Fr as applyBrandStudioPreset,
1603
+ xe as brandStudioSaveSpec,
1604
+ $ as buildAppearanceSpecFromDraft,
1605
+ R as createBrandStudioDraft
1470
1606
  };