@keenmate/pure-admin-core 2.9.0-rc01 → 2.9.0-rc04

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 (36) hide show
  1. package/README.md +61 -14
  2. package/dist/css/main.css +748 -2
  3. package/package.json +3 -1
  4. package/snippets/buttons.html +51 -0
  5. package/snippets/cards.html +34 -4
  6. package/snippets/comparison.html +26 -22
  7. package/snippets/manifest.json +180 -115
  8. package/snippets/range-group.html +125 -0
  9. package/snippets/splitter.html +216 -0
  10. package/snippets/statistics.html +31 -0
  11. package/src/js/btn-split-auto-absorb.js +327 -0
  12. package/src/js/command-palette.js +472 -0
  13. package/src/js/file-selector.js +1275 -0
  14. package/src/js/internal/logging.js +121 -0
  15. package/src/js/logic-tree-renderer.js +303 -0
  16. package/src/js/modal-dialogs.js +460 -0
  17. package/src/js/overflow.js +371 -0
  18. package/src/js/pa-stat-fit.js +184 -0
  19. package/src/js/range-group.js +663 -0
  20. package/src/js/search-autocomplete-v2.js +907 -0
  21. package/src/js/search-autocomplete.js +434 -0
  22. package/src/js/settings-panel.js +245 -0
  23. package/src/js/split-button.js +141 -0
  24. package/src/js/splitter.js +1323 -0
  25. package/src/js/toast-service.js +302 -0
  26. package/src/js/tooltips-popovers.js +275 -0
  27. package/src/js/virtual-scroll.js +143 -0
  28. package/src/js/virtual-textbox.js +803 -0
  29. package/src/scss/_core.scss +10 -0
  30. package/src/scss/core-components/_buttons.scss +59 -0
  31. package/src/scss/core-components/_cards.scss +206 -0
  32. package/src/scss/core-components/_overflow.scss +50 -0
  33. package/src/scss/core-components/_range-group.scss +474 -0
  34. package/src/scss/core-components/_splitter.scss +206 -0
  35. package/src/scss/core-components/_statistics.scss +163 -0
  36. package/src/scss/variables/_components.scss +56 -2
package/README.md CHANGED
@@ -2,20 +2,26 @@
2
2
 
3
3
  Lightweight, data-focused CSS/SCSS admin framework with Corporate theme as default.
4
4
 
5
- ## What's New in 2.9.0-rc01
6
-
7
- - **`color-scheme` now emitted per theme via the new `$theme-color-scheme` SCSS variable.** Themes signal their colour scheme to the browser so native UA elements (scrollbars, form controls, `<input type="date">`) and the CSS `light-dark()` function resolve correctly. Previously themes applied dark palettes via `--pa-*` / `--base-*` overrides alone, so the browser still saw the host page as `color-scheme: normal` (effectively light) — embedded web components (`web-multiselect`, `web-daterangepicker`) using `light-dark()` for adaptive palettes silently picked the light value on dark themes. Themes set `$theme-color-scheme: dark` (always-dark) or add a one-line `color-scheme: dark;` to their `.pa-mode-dark` block (dual-mode). The unthemed `dist/css/main.css` now ships `color-scheme: light` at `:root`.
8
- - **Six `--base-*` legacy aliases dropped (breaking for consumers using them directly).** `--base-surface-1`, `--base-surface-2`, `--base-surface-3`, `--base-surface-inverse`, `--base-primary-bg`, `--base-primary-bg-hover` are gone they aliased to existing semantic tokens (`--base-main-bg` / `--base-page-bg` / `--base-subtle-bg` / `--base-inverse-bg`) with no behavioural difference and added taxonomy confusion. `--base-primary-bg` specifically broke `web-multiselect@1.10.0+` dark-mode hover (its smart `color-mix` fallback was short-circuited by our compile-time `#ffffff` emit). Migration: rename to the matching `--base-*-bg` semantic name; for `--base-primary-bg-hover` consumers, switch to `--base-hover-bg` or compose with `color-mix`.
9
- - **Profile panel role chip migrated to `.pa-badge` (markup-breaking).** The bespoke `.pa-profile-panel__role` class hardcoded uppercase + letter-spacing and pointed at `--pa-header-profile-name-color`, which rendered as black-on-dark in panel context. Replaced with the standard `.pa-badge` component (theme-tuned for both modes). Snippet markup updated: `<span class="pa-profile-panel__role">…</span>` `<span class="pa-badge">…</span>`. Use `.pa-badge--light` / `--primary` / `--info` / `--success` / `--warning` / `--danger` for variants.
10
- - **Coloured card variants no longer leak white pixels around the header chrome.** Two independent causes addressed together corner-radius mismatch at the header's TOP corners (header's 8px curved more than the card's effective 7px inner radius, exposing a thin slice of card bg) and a gray hairline along the header's BOTTOM edge (border-bottom stayed `--pa-border-color` on coloured variants). The header now omits `border-top-*-radius` (card's `overflow: hidden` clips it) and each variant overrides `border-bottom-color` to match its background. Affects `.pa-card--primary` / `--success` / `--warning` / `--danger` and `.pa-card--color-1` through `--color-9`.
11
-
12
- ## What's New in 2.8.0
13
-
14
- - **CSS variable defaults now ship at `:root` in `dist/css/main.css`.** The unthemed bundle previously had no `--pa-*` / `--base-*` values they were emitted only by theme stylesheets, so consuming `@keenmate/pure-admin-core/css` standalone (or any page before its theme link resolved) left tokens unresolved and components rendered with broken fallbacks (KPI sparklines and deltas in near-black via inherited text colour, web components reverting to hardcoded literals). `main.scss` now emits `output-base-css-variables`, `output-pa-css-variables`, and `output-pa-alert-variables-light` at `:root` for a complete neutral default. Themes are unaffected they emit their own `:root` from their theme file and all 15 themes rebuild byte-identical. Supersedes the partial 2.7.1-era sentiment-scale fallback patch.
15
- - **KPI layout modifiers and CSS-variable knobs across four showcases.** `.pa-kpi-spark-list--no-delta` drops the Δ% column (with track widths now lifted to local SCSS variables for one source of truth); `.pa-kpi-hero-list__layout--hero-2-3` / `--hero-3-4` shift the hero/rail split off the locked 50/50; `.pa-kpi-bento__grid--hero-right` mirrors the default and `--5-tile` swaps to a five-tile composition, plus a new `--pa-kpi-bento-row-height` variable for tuning row height per instance.
16
- - **KPI grids redesigned as cell-min-driven auto-fit (Visual breaking).** `.pa-kpi-gauge-list__grid` and `.pa-kpi-edit__grid` swap fixed `repeat(N, 1fr)` + `@container` breakpoints for `repeat(auto-fit, minmax(var(--pa-kpi-X-cell-min, …), 1fr))` — intrinsic responsive cascade, no `@container` queries on the grids. Five new cap-at-N modifiers (`--max-2` through `--max-6`) constrain column count without forcing it; a `--2col` modifier forces a deterministic 2×N rhythm. Migration: bare grids with fixed item counts may produce uneven rows at widths that fit 4+ columns — add the appropriate `--max-N` to preserve a fixed rhythm.
17
- - **`.pa-kpi-terminal` view-mode toggle generalised to a tab strip (Visual breaking).** `__viewtoggle`/`__viewbtn` renamed to `__tabs`/`__tab`; `data-view` attribute on the root is gone in favour of `data-tab` on tabs and panes; the per-tile `__value[data-mode]` triple-value mechanism is removed. Each tab now swaps in a separate `__pane` with its own tile set and grid layout — authors can put a different number of tiles (and a different grid modifier) behind each tab. JS contract: `initTerminalViewToggle` → `initTerminalTabs`.
18
- - **`.pa-kpi-strip` column toggles extended to a composable 2–5 column family.** Three independently composable toggle modifiers (`--no-prev`, `--no-delta`, `--no-target`) replace the previous fixed 4/5-col shapes, yielding eight visible-column combinations. Per-column header classes (`__head--metric`/`--now`/`--prev`/`--delta`/`--target`) keep the header row in sync with the data rows. Track widths lifted to local SCSS variables so the eight precomputed templates share one source of truth.
5
+ ## What's New in 2.9.0-rc04
6
+
7
+ - **New: Range Group a compact multi-range filter (`.pa-range-group` + a reusable `.pa-range` slider).** One toggle summarises several numeric filters inline (`AGE 25–60 / SALARY $40,000–$200,000 / CHILDREN 2+`) and expands into a Floating-UI panel with one slider per dimension standing in for a row of separate sliders in a filter bar. Per-row dual-thumb range or single-thumb threshold, RTL-correct by construction, with a `--pa-range-*` theming token namespace and a bubbling `change` / `apply` / `reset` event contract keyed by dimension.
8
+ - **Range Group sliders are richly interactive.** Major/minor tick marks with optional value labels, opt-in snap-to-tick, click-anywhere-to-seek tracks that grab the nearest handle, and five selectable handle shapes (circle, rectangle, bar, chevron, needle) all pure CSS, mixable per row. Behaviour ships in the package as `range-group.js` (exposed via the `./js/*` export).
9
+ - **The package now ships the components' JavaScript (`src/js/`, via the `./js/*` export).** Interactive behaviours (split-button dropdowns, splitter drag, tooltips/popovers, toasts, command palette, …) were previously referenced in markup but never published; consumers now get the actual implementations instead of dangling handlers.
10
+ - **Stat square fit-to-box mode (`data-pa-stat-fit` + `pa-stat-fit.js`).** The primary number scales to fill the tile at the largest font that still fits, and supporting rows (symbol, label, change, context) reveal by priority as the tile earns both width and height one tile that adapts across dashboard sizes instead of a fixed layout.
11
+ - **Auto-absorb split-button toolbars (`.pa-btn-toolbar` + `pa-btn-split--auto-absorb`).** Sibling buttons fold into a split button's dropdown when the row runs out of width and pop back out as space returns, with per-button drop priority — progressive collapse without a parallel "more" menu.
12
+ - **`.pa-splitter` — `pa-splitter:resize` / `:collapse` / `:expand` `CustomEvent`s.** Three bubbling events fire from the affected pane (`resize.detail = { index, pane, size }`, collapse / expand detail = `{ index, pane }`) so consumers can wire sidebars, analytics, or persistence-coupled toolbars on the splitter root with a single delegated listener. `resize` is unfiltered — debounce in the handler. `collapse` / `expand` fire only on user-initiated transitions; init from saved state stays silent.
13
+ - **`.pa-splitter` — drag against a rail'd primary is now asymmetric.** Dragging outward (the direction that would grow the pane) releases the rail and follows the cursor; dragging inward (into the rail, would shrink further) is fully inert. Previously the drag-from-rail path pre-cleared `isMin` on `pointerdown` regardless of direction, so the card visually flashed out of its rail state before the user could express expand intent in the opposite direction — read as the splitter "guessing wrong". Mirrors `svelte-fluentui/MultiSplitter`'s drag-to-be-explicit gate.
14
+ - **`.pa-splitter` — tap-without-drag on the gutter no longer restores a rail'd pane.** Restore gestures are now: rail-body click, dblclick on the gutter, focus + `Enter`/`Space`, `[data-pa-splitter-toggle]` button, or drag outward past the snap threshold. Users expected drag-to-be-explicit and didn't connect "tap the gutter" with the rail-pane body as a restore surface.
15
+ - **`.pa-splitter` per-pane orientation class** (`pa-splitter__pane--horizontal` / `--vertical`) stamped at registration. Forward-compat hook for theme authors writing nested-splitter-safe rail CSS without walking the DOM to figure out the enclosing splitter's orientation.
16
+
17
+ ## What's New in 2.9.0-rc03
18
+
19
+ - **`.pa-splitter` drag model reworked to "rebalance-on-drag".** Each gutter now resizes only its primary neighbour (edge-closer side, LTR/RTL tiebreaker on ties); the matching delta is absorbed by the immediate adjacent non-rail pane (classic boundary feel), or — when the adjacent pane is rail — tunnels through the rail wall to the contiguous non-rail block beyond. Eliminates the "boundary locks when both sides are rail" deadlock from the prior model — drag-from-rail with a railed neighbour now grows the primary by pulling room from the next section.
20
+ - **Middle panes can now minimize to rail** (previously first / last only). Any pane with `data-pa-splitter-minimize` collapses on toggle / dblclick / drag-snap regardless of position. Snap-into-rail enforces an "at least one expanded pane" invariant — you can't drag the last visible pane to rail and end up with nothing to grab.
21
+ - **Restoring a minimized pane reclaims layout gaps cleanly.** When a prior minimize hit an absorber's `max` cap and left empty space in the layout, restoring the pane now reaches its remembered size by drawing from the gap (not just from other panes' shrink headroom) — fixes the "restored pane stuck at min width" surprise. Conversely, restoring no longer aggressively inflates a sibling pane to fill remaining gap — empty space stays as empty space and gets consumed as more panes restore. No more "sibling pane suddenly jumps" UX.
22
+ - **Rail width in `--pa-splitter-rail-size` now correctly resolves `rem` / non-px units.** Previously `parseFloat("4rem")` returned `4` and snapped rail panes to 4px-wide strips; rebuilt via a hidden probe element so the browser does the unit resolution. The three-step fallback chain (per-instance attribute → CSS var → literal 40) still applies.
23
+ - **Gutter highlighting now isolates the dragged gutter only.** During a drag, the splitter `--dragging` modifier suppresses `:hover` / `:focus-visible` on sibling gutters so they don't light up as the cursor passes over them or as a stale focus ring lingers — only the active gutter carries the highlight.
24
+ - **Splitter padding subtracted from available space.** Flex children sit inside the splitter's content box but `clientWidth` includes padding — without subtracting it the last pane's `flex-basis` overflowed and got clipped by `overflow: hidden`. Visible in the N-pane demo where the rightmost rail's right edge touched the splitter border.
19
25
 
20
26
  ## Installation
21
27
 
@@ -63,6 +69,47 @@ $btn-primary-bg: #your-button-color;
63
69
  @import '@keenmate/pure-admin-core/src/scss/main';
64
70
  ```
65
71
 
72
+ ### JavaScript (Interactive Components)
73
+
74
+ The framework is CSS-first, but several components need a small vanilla-JS
75
+ behavior to work (no framework runtime, no build step required). These ship
76
+ in `src/js/` and are exposed under the `./js/*` export:
77
+
78
+ ```js
79
+ // Split buttons + the auto-absorb button toolbar
80
+ import '@keenmate/pure-admin-core/js/split-button.js'; // toggleSplitMenu()
81
+ import '@keenmate/pure-admin-core/js/btn-split-auto-absorb.js';
82
+ ```
83
+
84
+ Or via a plain script tag:
85
+
86
+ ```html
87
+ <script src="node_modules/@keenmate/pure-admin-core/src/js/split-button.js"></script>
88
+ ```
89
+
90
+ Each file is a self-contained IIFE that wires itself up on load (and exposes a
91
+ small global / `window.Pa*` API for re-init after dynamic markup injection).
92
+ Pull in only the files for the components you use:
93
+
94
+ | Component | File(s) |
95
+ |---|---|
96
+ | Split button dropdown | `split-button.js` (defines `toggleSplitMenu`) |
97
+ | Auto-absorb toolbar (`.pa-btn-toolbar`) | `split-button.js` **+** `btn-split-auto-absorb.js` |
98
+ | Tooltips / popovers | `tooltips-popovers.js` |
99
+ | Splitter | `splitter.js` |
100
+ | Toasts | `toast-service.js` |
101
+ | Command palette | `command-palette.js` |
102
+ | Progressive overflow | `overflow.js` |
103
+ | Fit-to-box stat | `pa-stat-fit.js` |
104
+ | Modal dialogs | `modal-dialogs.js` |
105
+ | Range group (`.pa-range-group` / `.pa-range`) | `range-group.js` |
106
+
107
+ **Positioning dependency:** `split-button.js`, `tooltips-popovers.js`, and
108
+ `range-group.js` use
109
+ [Floating UI](https://floating-ui.com) for dropdown/tooltip placement and
110
+ expect it on the page as the `window.FloatingUIDOM` global (e.g. the
111
+ `@floating-ui/dom` UMD build). Load it before those scripts.
112
+
66
113
  ## Using HTML Snippets
67
114
 
68
115
  The `snippets/` directory contains clean HTML patterns for all components: