@funnest/charts-ui 0.2.1 → 0.4.0

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.
@@ -2,6 +2,7 @@
2
2
  * Mounts a persistent, host-owned element inside Preact-rendered UI. The element outlives
3
3
  * re-renders, so whatever the host app rendered into it (React, Vue, plain DOM) stays intact.
4
4
  */
5
- export declare function Slot({ el }: {
5
+ export declare function Slot({ el, fixed }: {
6
6
  el: HTMLElement;
7
+ fixed?: boolean;
7
8
  }): import("preact").JSX.Element;
package/dist/index.js CHANGED
@@ -1604,13 +1604,13 @@ function IntervalPicker({ ctx }) {
1604
1604
  }
1605
1605
 
1606
1606
  // src/components/slot.tsx
1607
- function Slot({ el }) {
1607
+ function Slot({ el, fixed = false }) {
1608
1608
  const ref = T2(null);
1609
1609
  F2(() => {
1610
1610
  ref.current?.appendChild(el);
1611
1611
  return () => el.remove();
1612
1612
  }, [el]);
1613
- return /* @__PURE__ */ a2("div", { class: "fnc-slot-host", ref });
1613
+ return /* @__PURE__ */ a2("div", { class: fixed ? "fnc-slot-host fnc-slot-host-fixed" : "fnc-slot-host", ref });
1614
1614
  }
1615
1615
 
1616
1616
  // src/components/symbol-search.tsx
@@ -1912,7 +1912,7 @@ function Toolbar({ ctx }) {
1912
1912
  children: /* @__PURE__ */ a2(PencilIcon, {})
1913
1913
  }
1914
1914
  ),
1915
- /* @__PURE__ */ a2(Slot, { el: ctx.slots.toolbarEnd }),
1915
+ /* @__PURE__ */ a2(Slot, { el: ctx.slots.toolbarEnd, fixed: true }),
1916
1916
  /* @__PURE__ */ a2(
1917
1917
  "button",
1918
1918
  {
@@ -2025,7 +2025,10 @@ var CSS = (
2025
2025
  border-radius: var(--fnc-radius);
2026
2026
  font-weight: 700;
2027
2027
  font-size: 15px;
2028
- flex: none;
2028
+ /* The symbol gives way first when the toolbar is tight: its name truncates, never overlaps. */
2029
+ flex: 0 1 auto;
2030
+ min-width: 36px;
2031
+ overflow: hidden;
2029
2032
  }
2030
2033
  .fnc-symbol .fnc-icon { color: var(--fnc-text-2); display: flex; }
2031
2034
  .fnc-symbol-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@@ -2278,6 +2281,8 @@ var CSS = (
2278
2281
  /* \u2500\u2500 Slots: host-app UI inside the widget (collapse when empty) \u2500\u2500 */
2279
2282
  .fnc-slot:empty { display: none; }
2280
2283
  .fnc-slot-host { display: flex; align-self: stretch; min-width: 0; flex: 0 1 auto; }
2284
+ /* Buttons next to the gear keep their size (they'd otherwise slide under it on phones). */
2285
+ .fnc-slot-host-fixed { flex: none; }
2281
2286
  .fnc-slot-toolbar { position: relative; display: flex; align-items: center; min-width: 0; padding-left: 9px; margin-left: 4px; }
2282
2287
  .fnc-slot-toolbar::before {
2283
2288
  content: '';
@@ -2686,10 +2691,23 @@ var CSS = (
2686
2691
  .fnc-action-primary { background: var(--fnc-accent); color: #fff; }
2687
2692
  .fnc-action-danger { flex: 0 0 auto; padding: 0 16px; color: var(--fnc-danger, #F04452); background: none; }
2688
2693
 
2694
+ /* \u2500\u2500 Narrow phones (\u2264 400px): drop the menu chevrons and separators so every button fits \u2500\u2500 */
2695
+ @media (max-width: 400px) {
2696
+ .fnc-toolbar .fnc-btn-wide > svg:last-child { display: none; }
2697
+ .fnc-toolbar .fnc-btn-wide { padding: 0 3px; }
2698
+ .fnc-toolbar > .fnc-sep { display: none; }
2699
+ .fnc-toolbar > .fnc-spacer { min-width: 0; }
2700
+ }
2701
+
2689
2702
  /* \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 */
2690
2703
  @media (max-width: 640px) {
2691
- .fnc-toolbar { padding: 0 4px; }
2704
+ .fnc-toolbar { padding: 0 4px; gap: 2px; }
2705
+ .fnc-toolbar .fnc-btn { width: 32px; height: 32px; }
2706
+ .fnc-toolbar .fnc-btn-wide, .fnc-toolbar .fnc-btn-label { width: auto; padding: 0 6px; }
2707
+ .fnc-toolbar .fnc-sep { margin: 0 2px; }
2692
2708
  .fnc-symbol { max-width: 140px; padding: 0 8px 0 6px; }
2709
+ /* Logo only on phones; the name is in the chart legend right below. */
2710
+ .fnc-toolbar .fnc-symbol:has(.fnc-avatar) :is(.fnc-symbol-name, .fnc-icon) { display: none; }
2693
2711
  .fnc-chip { padding: 0 8px; }
2694
2712
  .fnc-btn-screenshot { display: none; }
2695
2713
  .fnc-btn-label span { display: none; }
@@ -2715,7 +2733,7 @@ var CSS = (
2715
2733
  .fnc-dialog.fnc-search-dialog { width: 100%; height: 100%; }
2716
2734
  .fnc-sr-footer, .fnc-sr-side, .fnc-hide-mobile, .fnc-sr-spark { display: none; }
2717
2735
  /* The interval button must stay whole; the symbol name truncates instead. */
2718
- .fnc-symbol { flex: 0 1 auto; min-width: 0; }
2736
+ .fnc-symbol { flex: 0 1 auto; min-width: 36px; }
2719
2737
  /* MA rows wrap to two lines: [label \u2713 color width \xD7] / [source period] */
2720
2738
  .fnc-rows .fnc-row { flex-wrap: wrap; row-gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--fnc-border); }
2721
2739
  /* Basis = row \u2212 indent(52) \u2212 gap(8) \u2212 period(72): too wide for line 1, so it always wraps. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
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.2.1"
45
+ "@funnest/charts": "0.4.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"