@fasl-work/caos-app-shell 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/chart.js CHANGED
@@ -1,4 +1,4 @@
1
- import { useShellLang, useThemeStore, useStageSize, pick, resolveToken, NBSP, formatNumber, formatTicks } from './chunk-IDUNUMCR.js';
1
+ import { useShellLang, useThemeStore, useStageSize, pick, resolveToken, NBSP, formatNumber, formatTicks } from './chunk-DX36XRD5.js';
2
2
  import './chunk-X6Y5CDUD.js';
3
3
  import { useRef, useCallback, useState, useMemo, useEffect } from 'react';
4
4
  import uPlot from 'uplot';
@@ -142,12 +142,15 @@ function useThemeTokens() {
142
142
  var LOCALE = { en: "en-US", es: "es-CL" };
143
143
  var NBSP = "\xA0";
144
144
  var SCIENTIFIC_BELOW = 1e-4;
145
+ function belowScientific(magnitude) {
146
+ return magnitude !== 0 && Math.abs(magnitude) < SCIENTIFIC_BELOW * (1 - 1e-12);
147
+ }
145
148
  var NOT_AVAILABLE = { en: "not available", es: "no disponible" };
146
149
  function formatNumber(value, lang, opts = {}) {
147
150
  if (value === null || value === void 0 || !Number.isFinite(value)) return NOT_AVAILABLE[lang];
148
151
  const v = opts.percent ? value * 100 : value;
149
152
  const digits = opts.digits ?? 4;
150
- const scientific = v !== 0 && (opts.notation === "scientific" || Math.abs(v) < SCIENTIFIC_BELOW);
153
+ const scientific = v !== 0 && (opts.notation === "scientific" || belowScientific(v));
151
154
  const grouping = opts.grouping === false ? { useGrouping: false } : {};
152
155
  const nf = opts.decimals !== void 0 ? new Intl.NumberFormat(LOCALE[lang], { minimumFractionDigits: opts.decimals, maximumFractionDigits: opts.decimals, ...grouping }) : scientific ? new Intl.NumberFormat(LOCALE[lang], { notation: "scientific", maximumSignificantDigits: digits }) : Math.abs(v) >= 10 ** (digits - 1) ? new Intl.NumberFormat(LOCALE[lang], { maximumFractionDigits: 0, ...grouping }) : new Intl.NumberFormat(LOCALE[lang], { maximumSignificantDigits: digits, ...grouping });
153
156
  return opts.percent ? `${nf.format(v)}${NBSP}%` : nf.format(v);
@@ -156,7 +159,7 @@ function formatTicks(values, lang, opts = {}) {
156
159
  let o = opts;
157
160
  if (opts.decimals === void 0 && opts.notation === void 0) {
158
161
  const scale = opts.percent ? 100 : 1;
159
- const small = values.some((v) => v !== null && v !== void 0 && Number.isFinite(v) && v !== 0 && Math.abs(v * scale) < SCIENTIFIC_BELOW);
162
+ const small = values.some((v) => v !== null && v !== void 0 && Number.isFinite(v) && belowScientific(v * scale));
160
163
  if (small) o = { ...opts, notation: "scientific" };
161
164
  }
162
165
  return values.map((v) => v === null || v === void 0 ? "" : formatNumber(v, lang, o));
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { useThemeStore, useShellLang, useLangStore, SHELL_TOKENS, pick, useStageSize, NOT_AVAILABLE, formatTicks, formatNumber, NBSP } from './chunk-IDUNUMCR.js';
2
- export { NBSP, NOT_AVAILABLE, SCIENTIFIC_BELOW, SHELL_TOKENS, Stage, applyTheme, formatNumber, formatTicks, pick, readTheme, resolveToken, useFormat, useLangStore, useShellLang, useStageSize, useThemeStore, useThemeTokens } from './chunk-IDUNUMCR.js';
1
+ import { useThemeStore, useShellLang, useLangStore, SHELL_TOKENS, pick, useStageSize, NOT_AVAILABLE, formatTicks, formatNumber, NBSP } from './chunk-DX36XRD5.js';
2
+ export { NBSP, NOT_AVAILABLE, SCIENTIFIC_BELOW, SHELL_TOKENS, Stage, applyTheme, formatNumber, formatTicks, pick, readTheme, resolveToken, useFormat, useLangStore, useShellLang, useStageSize, useThemeStore, useThemeTokens } from './chunk-DX36XRD5.js';
3
3
  export { LANG_STORAGE_KEY, STANDARD_ROUTES, THEME_BOOT_SCRIPT, THEME_STORAGE_KEY } from './chunk-X6Y5CDUD.js';
4
4
  import { createContext, Component, useState, useRef, useId, useEffect, useCallback, useContext, useMemo, Children } from 'react';
5
5
  import { useInRouterContext, NavLink, useLocation } from 'react-router';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fasl-work/caos-app-shell",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Shared web-app shell, workbench primitives, content primitives, design system and measured gate for the CAOS / Faena public apps (ADR-0016, ADR-0017, ADR-0071).",
5
5
  "license": "MIT",
6
6
  "author": "Felipe Santibáñez-Leal",
package/styles.css CHANGED
@@ -446,6 +446,9 @@ code, kbd { font-family: var(--font-mono); }
446
446
  .chip { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-fg-subtle); border-radius: var(--radius-pill); padding: 0.3rem 0.72rem; font-size: 0.82rem; font-weight: 500; white-space: nowrap; transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
447
447
  .chip:hover:not(:disabled) { color: var(--color-fg); border-color: var(--color-fg-faint); }
448
448
  .chip.on { background: var(--color-accent); color: var(--color-accent-fg); border-color: transparent; font-weight: 600; }
449
+ /* the active chip keeps its colours under the pointer: the hover rule above outranks `.chip.on` and, until 0.9.4, wrote
450
+ the text colour on the accent (3.04:1 in light, 1.64:1 in dark; known shell defect 33) */
451
+ .chip.on:hover:not(:disabled) { color: var(--color-accent-fg); border-color: transparent; }
449
452
  .chip:disabled { opacity: 0.45; cursor: default; }
450
453
 
451
454
  /* Registered controls (Knob, ChipGroup). */
@@ -475,6 +478,8 @@ svg.lucide { flex: none; }
475
478
  .cs-chip { display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.32rem 0.6rem; border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-fg-subtle); font-size: var(--text-sm); font-weight: 500; transition: color 0.15s, background-color 0.15s, border-color 0.15s; }
476
479
  .cs-chip:hover:not(:disabled) { color: var(--color-fg); background: var(--color-surface-2); }
477
480
  .cs-chip.on { color: var(--color-accent); background: var(--color-accent-soft); border-color: color-mix(in oklab, var(--color-accent) 40%, transparent); font-weight: 600; }
481
+ /* as for `.chip`: the chosen case's chip keeps its accent under the pointer (known shell defect 33) */
482
+ .cs-chip.on:hover:not(:disabled) { color: var(--color-accent); background: var(--color-accent-soft); }
478
483
  .cs-chip:disabled { opacity: 0.45; cursor: default; }
479
484
  .cs-chip-id { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.76rem; font-weight: 600; opacity: 0.85; }
480
485
  .cs-kind { font-size: 0.62rem; font-weight: 700; line-height: 1; padding: 0.12rem 0.28rem; border-radius: 4px; border: 1px solid var(--color-border); color: var(--color-fg-faint); background: var(--color-surface-2); align-self: center; }