@smwb/ui-styles 2.8.0 → 2.10.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.
package/README.md CHANGED
@@ -199,13 +199,16 @@ An edge the app marks `active` shows work flowing along it (`DagViewEdge.active`
199
199
  the flow colour over a paler track, a static glow lies under it and pulses run from `source` to `target`; a running
200
200
  node's frame glows and pulses with its dot. This `active` is not the selection highlight — the selected node's edges
201
201
  keep `@dagViewEdgeActiveColor`, and where both apply the flowing edge wins the colour and the arrow. All flow rules and
202
- the node glow are gated on markup only `@smwb/ui-solid` writes (`data-animate-running` on the root, the flowing
203
- classes on the edge paths), so the shared CSS is inert for `@smwb/ui-react` until its own issue lands; the only
204
- change React sees is the new custom properties on its root and the dot's duration read from
202
+ the node glow are gated on markup only `@smwb/ui-solid` writes (`data-animate-running` and `data-animate-flow` on
203
+ the root, the flowing classes on the edge paths), so the shared CSS is inert for `@smwb/ui-react` until its own
204
+ issue lands; the only change React sees is the new custom properties on its root and the dot's duration read from
205
205
  `--smwb-dag-view-node-pulse-duration`, whose default is the 1.4 s of before. Motion is CSS only: with
206
206
  `prefers-reduced-motion: reduce` the pulses stay hidden, the flowing edge stays lit in the full flow colour, and a
207
207
  running node keeps a still glow; `animateRunning={false}` stops a running node's glow and dot pulse without reduced
208
- motion.
208
+ motion. `animateFlow={false}` (`data-animate-flow="false"` on the root) asks for that same still state on demand and
209
+ keeps the light: the pulses are hidden, a running node's dot and frame hold still, the flowing edge stays lit in the
210
+ full flow colour with its static glow, and the running node keeps its still glow. Those rules sit after the motion
211
+ media query, which is what makes them win at equal specificity.
209
212
 
210
213
  The statuses are `idle`, `pending`, `running`, `success`, `warning`, `error` and `skipped`; a node with any other
211
214
  status is drawn as `idle`. Each colour variable has a `…Dark` twin (e.g. `@dagViewStatusSuccessDark`), `false` by
@@ -336,6 +339,27 @@ holds the tab stop (`menuitemcheckbox`, `menuitemradio`, `treeitem`, `spinbutton
336
339
  `scrollbar`) are listed next to the focusable elements. A control the generic list cannot see opts out with
337
340
  `.smwb-appbar__no-drag` or `data-no-drag`.
338
341
 
342
+ #### Overlay layers
343
+
344
+ The surfaces the components portal to `<body>` sit in a z-index scale of Less variables, so an app puts them over its
345
+ own header, sheets and windows from its theme, with no rule on the `.smwb-*` classes:
346
+
347
+ | Variable | Default | Layer |
348
+ | ----------- | ------- | -------------------------------------------------------------------------------------- |
349
+ | `@menuZ` | 1300 | the floating `Menu` (`OverflowMenu`, `SelectField` options, submenus), above the modal |
350
+ | `@tooltipZ` | 1400 | the `Tooltip` tip, above the menu and the dialogs it is raised from |
351
+
352
+ The tip stays above the menu: a hint on a menu item, on a dialog's button or on a docked window's control must not hide
353
+ under them. Keep that order if you change one value. The modal overlay (1001), the chat shell (1002), the floating
354
+ window (`@floatingWindowZ`, 150) and the sheet (100) stay below both. `npm run lint` of this package renders the
355
+ stylesheet and checks the order and that each variable reaches its rule.
356
+
357
+ ```less
358
+ // theme.config: the host's own layers go up to 2000, the menus and tips stay over them
359
+ @menuZ: 2100;
360
+ @tooltipZ: 2200;
361
+ ```
362
+
339
363
  ## License
340
364
 
341
365
  [MIT](./LICENSE)
@@ -388,6 +388,25 @@
388
388
  }
389
389
  }
390
390
 
391
+ // animateFlow={false}: the same still state reduced motion shows — the flow
392
+ // stays lit in the full flow colour and the glows stay, nothing moves. The
393
+ // block sits after the motion rules so its frame rule, of equal specificity
394
+ // to theirs, wins.
395
+ .smwb-dag-view[data-animate-flow="false"] {
396
+ .smwb-dag-view__edge--flowing {
397
+ stroke: var(--smwb-dag-view-edge-flow-color);
398
+ }
399
+ .smwb-dag-view__edge-pulse {
400
+ display: none;
401
+ }
402
+ .smwb-dag-view__node[data-status="running"] .smwb-dag-view__dot {
403
+ animation: none;
404
+ }
405
+ .smwb-dag-view__node[data-status="running"]::before {
406
+ animation: none;
407
+ }
408
+ }
409
+
391
410
  @keyframes smwb-dag-view-pulse {
392
411
  50% {
393
412
  opacity: 0.35;
@@ -4,7 +4,7 @@
4
4
 
5
5
  &--floating {
6
6
  box-shadow: @menuBoxShadow;
7
- z-index: 1300;
7
+ z-index: @menuZ;
8
8
  min-width: 112px;
9
9
  cursor: default;
10
10
  }
@@ -2,7 +2,7 @@
2
2
  border-radius: 4px;
3
3
  background-color: var(--smui-tooltipBg);
4
4
  color: var(--smui-tooltipTextColor);
5
- z-index: 5;
5
+ z-index: @tooltipZ;
6
6
  font-size: 12px;
7
7
  padding: 0 @tooltipPaddingX;
8
8
  height: 24px;
@@ -559,6 +559,19 @@
559
559
  // stack. Hosts add their stacking index on top, leaving headroom before 200.
560
560
  @floatingWindowZ: 150;
561
561
 
562
+ /*-------------------
563
+ Overlay layers
564
+ --------------------*/
565
+ // z-index of the surfaces the components portal to <body>. A theme overrides them by setting
566
+ // the variable, with no rule on the `.smwb-*` classes; each must stay above whatever the host
567
+ // app stacks under it (its header, sheets, windows, dialogs).
568
+ // A floating Menu (OverflowMenu, SelectField options, submenus) sits above the modal (1001),
569
+ // the chat shell (1002) and every surface that opens it. Off-grid.
570
+ @menuZ: 1300;
571
+ // A Tooltip sits above the menu and the dialogs it is raised from: a hint on a menu item,
572
+ // a dialog's button or a docked window's control must not hide under them. Off-grid.
573
+ @tooltipZ: 1400;
574
+
562
575
  /*-------------------
563
576
  Tooltip
564
577
  --------------------*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smwb/ui-styles",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Framework-agnostic LESS design tokens and component styles (smwb-*) shared by the @smwb UI libraries. Prebuilt aggregate CSS lives in @smwb/ui-css.",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -19,7 +19,7 @@
19
19
  "./package.json": "./package.json"
20
20
  },
21
21
  "scripts": {
22
- "lint": "node scripts/check-aggregate.mjs && node scripts/check-tokens.mjs && node scripts/check-control-heights.mjs && node scripts/check-typography-case.mjs && node scripts/check-chart-series.mjs && node scripts/check-normalize-specificity.mjs"
22
+ "lint": "node scripts/check-aggregate.mjs && node scripts/check-tokens.mjs && node scripts/check-control-heights.mjs && node scripts/check-typography-case.mjs && node scripts/check-overlay-layers.mjs && node scripts/check-chart-series.mjs && node scripts/check-normalize-specificity.mjs"
23
23
  },
24
24
  "homepage": "https://sourcecraft.dev/elfenmail/ui",
25
25
  "repository": {