@alis-build/design-system 0.63.0 → 0.64.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/alisx.css CHANGED
@@ -975,13 +975,22 @@ span.app-account__avatar{display:flex;align-items:center;justify-content:center;
975
975
  .app-switch-row{position:relative;display:flex;align-items:center;gap:var(--space-16);min-height:max(48px,var(--touch-target));color:var(--on-surface);cursor:pointer}
976
976
  .app-switch-row__text{display:flex;flex-direction:column;flex:1;min-width:0}
977
977
  .app-switch-row__text .text-supporting{color:var(--on-surface-variant)}
978
- .app-switch{position:relative;flex:none;width:52px;height:32px;margin:0;border:2px solid var(--outline);border-radius:var(--radius-pill);background:var(--surface-container-highest);appearance:none;-webkit-appearance:none;cursor:pointer;transition:background-color var(--spring-fast-effects),border-color var(--spring-fast-effects)}
979
- .app-switch::before{content:"";position:absolute;top:50%;left:6px;width:16px;height:16px;border-radius:var(--radius-pill);background:var(--outline);transform:translateY(-50%);transition:left var(--spring-fast-spatial),width var(--spring-fast-spatial),height var(--spring-fast-spatial),background-color var(--spring-fast-effects)}
980
- .app-switch:checked{border-color:var(--primary);background:var(--primary)}
981
- .app-switch:checked::before{left:22px;width:24px;height:24px;background:var(--on-primary)}
978
+ /* The handle (::before) and its state layer (::after) share one centre, 16px in from
979
+ either end, so a size change grows from the middle. Pressed, the handle grows to
980
+ 28 where it sits; on, it is 24 and carries the check glyph, which exists only
981
+ while on (nothing to show through in forced colours) and turns in from −45°. */
982
+ .app-switch{--app-switch-x:14px;--app-switch-handle:16px;position:relative;isolation:isolate;flex:none;width:52px;height:32px;margin:0;border:2px solid var(--outline);border-radius:var(--radius-pill);background:var(--surface-container-highest);appearance:none;-webkit-appearance:none;cursor:pointer;transition:background-color var(--spring-fast-effects),border-color var(--spring-fast-effects)}
983
+ .app-switch::before,.app-switch::after{content:"";position:absolute;top:50%;left:var(--app-switch-x);border-radius:var(--radius-pill)}
984
+ .app-switch::before{display:flex;align-items:center;justify-content:center;overflow:hidden;width:var(--app-switch-handle);height:var(--app-switch-handle);background:var(--outline);color:transparent;font-family:"Material Symbols Outlined";font-size:16px;line-height:1;font-variation-settings:"FILL" 1,"wght" 500,"GRAD" 0,"opsz" 20;transform:translate(-50%,-50%) rotate(-45deg);transition:left var(--spring-fast-spatial),width var(--spring-fast-spatial),height var(--spring-fast-spatial),transform var(--spring-fast-spatial),background-color var(--spring-fast-effects),color var(--spring-fast-effects)}
985
+ .app-switch::after{z-index:-1;width:40px;height:40px;background:var(--on-surface);opacity:0;transform:translate(-50%,-50%);transition:left var(--spring-fast-spatial),opacity var(--spring-fast-effects),background-color var(--spring-fast-effects)}
986
+ .app-switch:checked{--app-switch-x:34px;--app-switch-handle:24px;border-color:var(--primary);background:var(--primary)}
987
+ .app-switch:checked::before{content:"check";background:var(--on-primary);color:var(--primary);transform:translate(-50%,-50%) rotate(0deg)}
988
+ .app-switch:checked::after{background:var(--primary)}
982
989
  .app-switch:focus-visible{outline:2px solid var(--primary);outline-offset:1px}
983
- .app-switch-row:hover .app-switch:not(:disabled){box-shadow:0 0 0 8px color-mix(in srgb,var(--on-surface) calc(var(--state-hover) * 100%),transparent)}
984
- .app-switch-row:active .app-switch:not(:disabled){box-shadow:0 0 0 8px color-mix(in srgb,var(--on-surface) calc(var(--state-pressed) * 100%),transparent)}
990
+ .app-switch-row:hover .app-switch:not(:disabled)::after{opacity:var(--state-hover)}
991
+ :is(.app-switch-row:active .app-switch,.app-switch:active):not(:disabled){--app-switch-handle:28px}
992
+ :is(.app-switch-row:active .app-switch,.app-switch:active):not(:disabled)::after{opacity:var(--state-pressed)}
993
+ :is(.app-switch-row:hover .app-switch,.app-switch-row:active .app-switch,.app-switch:active):not(:disabled):not(:checked)::before{background:var(--on-surface-variant)}
985
994
  .app-switch:disabled{cursor:default}
986
995
  .app-switch-row.is-disabled{opacity:.38;cursor:default}
987
996
 
package/classes.json CHANGED
@@ -551,6 +551,8 @@
551
551
  "--alis-red",
552
552
  "--amber-100",
553
553
  "--amber-700",
554
+ "--app-switch-handle",
555
+ "--app-switch-x",
554
556
  "--app-trace-width",
555
557
  "--background",
556
558
  "--band-bottom",
@@ -9,7 +9,7 @@ An icon by name: a Material Symbol, or a capability mark when the name starts wi
9
9
  - `FILL 0` at weight 400. Filled, weight 500, only when selected.
10
10
  - Icons inherit `currentColor`. Never set a fill or a colour on the glyph itself.
11
11
  - Always beside a label, or with an accessible name of its own.
12
- - A name starting `alis_` is one of the six tools or the Glass view: draw a [CapabilityMark](CapabilityMark.md) in the icon box instead of the font glyph.
12
+ - A name starting `alis_` is a capability mark (a tool, a place in the console or the Glass view): draw a [CapabilityMark](CapabilityMark.md) in the icon box instead of the font glyph.
13
13
  - An icon that performs an action is an [AppIconButton](AppIconButton.md).
14
14
 
15
15
  ## Markup
@@ -4,12 +4,14 @@ An on/off setting: a label and one supporting line on the left, the switch on th
4
4
 
5
5
  ## Use / don't use
6
6
 
7
- - The M3 switch: a 52×32 track. Off: `surface-container-highest` with an `outline` border and a 16px `outline` handle. On: `primary` with a 24px `on-primary` handle, because a switch is a control you press.
7
+ - The M3 switch: a 52×32 track. Off: `surface-container-highest` with an `outline` border and a 16px `outline` handle. On: `primary` with a 24px `on-primary` handle carrying a `primary` check, because a switch is a control you press.
8
+ - **The handle answers the press.** It grows to 28px where it sits, on or off, then slides and settles when it is let go, the check turning in as it arrives. The CSS does all of it on the fast spatial spring; the check is the Material Symbols `check` glyph, so keep `check` in your self-hosted subset.
8
9
  - **On its own, a switch applies at once**, like a light switch: no Save.
9
10
  - **Inside a form with a Save button** it is one of the form's answers and applies with the rest when the user saves. That needs no extra wording.
10
11
  - **Something you agree to, or several of a list, is an [AppCheckbox](AppCheckbox.md)**: it waits for Save or Send, where a switch says it applies.
11
12
  - The label says what is on, as a statement: "Deploy on every push", not "Auto-deploy?". Never "Enable …".
12
- - Hovering the row shows the state layer as a halo round the switch (the CSS does it).
13
+ - Hovering or pressing the row shows the state layer as a 40px circle round the handle, travelling with it: `on-surface` when off, `primary` when on (the CSS does it). Off, the handle darkens to `on-surface-variant` too.
14
+ - Disabled, the row is at 0.38 and the handle never grows.
13
15
 
14
16
  ## Markup
15
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alis-build/design-system",
3
- "version": "0.63.0",
3
+ "version": "0.64.0",
4
4
  "description": "The AlisX design system for coding agents: tokens, product CSS, component markup, capability marks, words and rules.",
5
5
  "keywords": ["alisx", "design-system", "design-tokens", "css"],
6
6
  "homepage": "https://alisx.com",
package/rules/motion.md CHANGED
@@ -121,6 +121,7 @@ needs nothing from the site.
121
121
  | --- | --- | --- |
122
122
  | A press | The filled button gives and springs back ([buttons.md](buttons.md)) | Nothing |
123
123
  | A toggle turning on | The glyph gives under the press and springs back filled | Flip `aria-pressed`, as it already does |
124
+ | A switch | The handle grows under the press, then slides across and settles; on, the check turns in ([AppSwitch](../components/AppSwitch.md)) | Nothing |
124
125
  | An icon changing its meaning (Send to Stop, Copy to ✓) | `.app-icon-swap` turns one glyph away and springs the other in | Put both glyphs in it and toggle `is-swapped` ([AppIconButton](../components/AppIconButton.md)) |
125
126
  | Selection that travels | `app-tabs--travel` and `app-seg--travel` draw one indicator that travels | Set `--indicator-left` and `--indicator-width` to the selected item's `offsetLeft` and `offsetWidth`, then add the modifier, so it is drawn in place and moves only on a change ([AppTitleBar](../components/AppTitleBar.md), [AppSegmented](../components/AppSegmented.md)) |
126
127
  | Expand and collapse | A disclosure and a turn's steps open to their height, then their rows fade in | Toggle `open` or `hidden`, as already |