@funnest/charts-ui 0.5.0 → 0.5.1

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 (2) hide show
  1. package/dist/index.js +35 -26
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1450,6 +1450,7 @@ function layoutRects(node, x2 = 0, y3 = 0, w3 = 20, h3 = 16, gap = 1.6) {
1450
1450
  }
1451
1451
 
1452
1452
  // src/components/layout-menu.tsx
1453
+ var LAYOUT_PANES = (id) => paneCount(LAYOUTS[id]);
1453
1454
  function LayoutGlyph({ id }) {
1454
1455
  return /* @__PURE__ */ a2("svg", { width: "20", height: "16", viewBox: "0 0 20 16", "aria-hidden": "true", children: layoutRects(LAYOUTS[id]).map((r3) => /* @__PURE__ */ a2("rect", { x: r3.x + 0.5, y: r3.y + 0.5, width: Math.max(0, r3.w - 1), height: Math.max(0, r3.h - 1), rx: "1.5", fill: "none", stroke: "currentColor", "stroke-width": "1.2" })) });
1455
1456
  }
@@ -1518,7 +1519,7 @@ function LayoutMenu({ ctx, multi }) {
1518
1519
  ))
1519
1520
  ] })) })
1520
1521
  ] }),
1521
- /* @__PURE__ */ a2("div", { class: "fnc-menu-wrap", ref: sync.ref, children: [
1522
+ LAYOUT_PANES(m3.layout) > 1 && /* @__PURE__ */ a2("div", { class: "fnc-menu-wrap", ref: sync.ref, children: [
1522
1523
  /* @__PURE__ */ a2(
1523
1524
  "button",
1524
1525
  {
@@ -1784,7 +1785,7 @@ function SymbolSearch({ ctx }) {
1784
1785
  }
1785
1786
  ),
1786
1787
  query && /* @__PURE__ */ a2("button", { class: "fnc-ind-btn", "aria-label": t3.cancel, onClick: () => (setQuery(""), inputRef.current?.focus()), children: /* @__PURE__ */ a2(SmallCloseIcon, {}) }),
1787
- /* @__PURE__ */ a2("kbd", { class: "fnc-kbd fnc-hide-mobile", children: "ESC" })
1788
+ /* @__PURE__ */ a2("button", { class: "fnc-kbd fnc-kbd-btn fnc-hide-mobile", "aria-label": t3.close, title: t3.close, onClick: close, children: "ESC" })
1788
1789
  ] }),
1789
1790
  /* @__PURE__ */ a2("div", { class: "fnc-tabs", role: "tablist", children: ctx.searchCategories.map((c3) => /* @__PURE__ */ a2("button", { class: "fnc-tab", role: "tab", "aria-selected": c3.id === category, onClick: () => setCategory(c3.id), children: c3.label[locale] })) }),
1790
1791
  /* @__PURE__ */ a2("div", { class: "fnc-sr-body", children: [
@@ -1819,7 +1820,7 @@ function SymbolSearch({ ctx }) {
1819
1820
  " ",
1820
1821
  t3.openAction
1821
1822
  ] }),
1822
- /* @__PURE__ */ a2("span", { children: [
1823
+ /* @__PURE__ */ a2("button", { class: "fnc-sr-foot-btn", onClick: close, children: [
1823
1824
  /* @__PURE__ */ a2("kbd", { class: "fnc-kbd", children: "ESC" }),
1824
1825
  " ",
1825
1826
  t3.close
@@ -1861,24 +1862,26 @@ function Toolbar({ ctx }) {
1861
1862
  /* @__PURE__ */ a2("div", { class: "fnc-sep" }),
1862
1863
  /* @__PURE__ */ a2(IntervalPicker, { ctx }),
1863
1864
  /* @__PURE__ */ a2(Slot, { el: ctx.slots.toolbar }),
1864
- /* @__PURE__ */ a2("div", { class: "fnc-sep" }),
1865
- /* @__PURE__ */ a2(ChartTypeMenu, { ctx }),
1866
- /* @__PURE__ */ a2(
1867
- "button",
1868
- {
1869
- class: "fnc-btn fnc-btn-wide fnc-btn-label",
1870
- title: t3.addIndicator,
1871
- "aria-label": t3.addIndicator,
1872
- "aria-haspopup": "dialog",
1873
- onClick: () => ctx.store.set({ dialog: { kind: "indicators" } }),
1874
- children: [
1875
- /* @__PURE__ */ a2(IndicatorIcon, {}),
1876
- /* @__PURE__ */ a2("span", { children: t3.indicators })
1877
- ]
1878
- }
1879
- ),
1880
- ctx.multi && /* @__PURE__ */ a2(LayoutMenu, { ctx, multi: ctx.multi }),
1881
1865
  /* @__PURE__ */ a2("div", { class: "fnc-spacer" }),
1866
+ /* @__PURE__ */ a2("div", { class: "fnc-tools", children: [
1867
+ /* @__PURE__ */ a2(ChartTypeMenu, { ctx }),
1868
+ /* @__PURE__ */ a2(
1869
+ "button",
1870
+ {
1871
+ class: "fnc-btn fnc-btn-wide fnc-btn-label",
1872
+ title: t3.addIndicator,
1873
+ "aria-label": t3.addIndicator,
1874
+ "aria-haspopup": "dialog",
1875
+ onClick: () => ctx.store.set({ dialog: { kind: "indicators" } }),
1876
+ children: [
1877
+ /* @__PURE__ */ a2(IndicatorIcon, {}),
1878
+ /* @__PURE__ */ a2("span", { children: t3.indicators })
1879
+ ]
1880
+ }
1881
+ ),
1882
+ ctx.multi && /* @__PURE__ */ a2(LayoutMenu, { ctx, multi: ctx.multi })
1883
+ ] }),
1884
+ /* @__PURE__ */ a2("div", { class: "fnc-sep" }),
1882
1885
  ctx.drawingToolbar && /* @__PURE__ */ a2(
1883
1886
  "button",
1884
1887
  {
@@ -2693,6 +2696,13 @@ var CSS = (
2693
2696
  flex: none;
2694
2697
  }
2695
2698
 
2699
+ .fnc-tools { display: flex; align-items: center; gap: 4px; flex: none; }
2700
+ /* Right-hand menus open toward the left so they stay on screen. */
2701
+ .fnc-tools .fnc-menu { left: auto; right: 0; }
2702
+ .fnc-kbd-btn { cursor: pointer; }
2703
+ .fnc-kbd-btn:hover, .fnc-sr-foot-btn:hover { color: var(--fnc-text); }
2704
+ .fnc-sr-foot-btn { display: inline-flex; align-items: center; gap: 4px; font-size: inherit; color: inherit; cursor: pointer; }
2705
+
2696
2706
  .fnc-up { color: var(--fnc-up); }
2697
2707
  .fnc-down { color: var(--fnc-down); }
2698
2708
  .fnc-flat { color: var(--fnc-text); }
@@ -2943,7 +2953,7 @@ var CSS = (
2943
2953
  content: '';
2944
2954
  position: absolute;
2945
2955
  inset: 0;
2946
- border: 1px solid var(--fnc-accent);
2956
+ border: 1px solid var(--fnc-text-2);
2947
2957
  pointer-events: none;
2948
2958
  z-index: 3;
2949
2959
  }
@@ -2953,7 +2963,7 @@ var CSS = (
2953
2963
  .fnc-splitter-row::after { inset: 0 -4px; }
2954
2964
  .fnc-splitter-col { height: 1px; cursor: row-resize; }
2955
2965
  .fnc-splitter-col::after { inset: -4px 0; }
2956
- .fnc-splitter:hover { background: var(--fnc-accent); }
2966
+ .fnc-splitter:hover { background: var(--fnc-text-2); }
2957
2967
  .fnc-resizing-x, .fnc-resizing-x * { cursor: col-resize !important; user-select: none; }
2958
2968
  .fnc-resizing-y, .fnc-resizing-y * { cursor: row-resize !important; user-select: none; }
2959
2969
  .fnc-parking { display: none; }
@@ -3004,7 +3014,7 @@ var CSS = (
3004
3014
  background: var(--fnc-surface);
3005
3015
  font-size: 11px;
3006
3016
  }
3007
- .fnc-pane-tab[aria-selected='true'] .fnc-pane-tab-num { background: var(--fnc-accent); color: #fff; }
3017
+ .fnc-pane-tab[aria-selected='true'] .fnc-pane-tab-num { background: var(--fnc-text-2); color: var(--fnc-bg); }
3008
3018
  .fnc-layout-menu { min-width: 0; gap: 2px; padding: 8px; }
3009
3019
  .fnc-layout-row { display: flex; align-items: center; gap: 2px; }
3010
3020
  .fnc-layout-count { width: 16px; flex: none; font-size: 12px; color: var(--fnc-text-2); text-align: center; }
@@ -3017,7 +3027,7 @@ var CSS = (
3017
3027
  color: var(--fnc-text-2);
3018
3028
  }
3019
3029
  .fnc-layout-opt:hover { background: var(--fnc-surface); color: var(--fnc-text); }
3020
- .fnc-layout-opt[aria-checked='true'] { background: var(--fnc-surface); color: var(--fnc-accent); }
3030
+ .fnc-layout-opt[aria-checked='true'] { background: var(--fnc-surface); color: var(--fnc-text); }
3021
3031
  .fnc-sync-menu { min-width: 220px; }
3022
3032
  .fnc-menu-title { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px 8px; font-size: 13px; font-weight: 600; color: var(--fnc-text); }
3023
3033
  .fnc-menu-title small { font-size: 12px; font-weight: 400; color: var(--fnc-text-2); }
@@ -3025,9 +3035,8 @@ var CSS = (
3025
3035
  .fnc-sync-item[aria-checked='true'] { background: none; color: var(--fnc-text); }
3026
3036
  .fnc-sync-item:hover { background: var(--fnc-surface); }
3027
3037
  .fnc-sync-item .fnc-switch { display: inline-block; transform: scale(0.8); transform-origin: right center; }
3028
- .fnc-switch[data-on='true'] { background: var(--fnc-accent); }
3038
+ .fnc-switch[data-on='true'] { background: var(--fnc-text-2); }
3029
3039
  .fnc-switch[data-on='true']::after { transform: translateX(16px); }
3030
- .fnc-btn-sync[aria-pressed='true'] { color: var(--fnc-accent); }
3031
3040
 
3032
3041
  /* \u2500\u2500 Mobile \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
3033
3042
  @media (max-width: 640px) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Pro trading UI (toolbar, drawing tools, sheets) for Funnest Charts. Framework-agnostic.",
5
5
  "keywords": [
6
6
  "chart",
@@ -42,7 +42,7 @@
42
42
  "NOTICE"
43
43
  ],
44
44
  "dependencies": {
45
- "@funnest/charts": "0.5.0"
45
+ "@funnest/charts": "0.5.1"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"