@cameronsjo/artificer 0.28.0 → 0.29.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/src/artificer.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /* ═══════════════════════════════════════════════════════════════════════════
2
- ARTIFICER · Design tokens · v0.28.0 (apothecary × deco × speakeasy)
2
+ ARTIFICER · Design tokens · v0.29.0 (apothecary × deco × speakeasy)
3
3
  AuDHD-optimized, Ghostty-rooted, with warm Jazz-Age accents.
4
4
  Default theme = dark. Add data-theme="light" on <html> for ivory paper mode.
5
5
 
@@ -225,7 +225,7 @@
225
225
  --z-toast: 3000; /* @kind other */ /* always-on-top notifications */
226
226
 
227
227
  /* Artificer v0.10.1 — baseline contract: see CLAUDE.md § Baseline contract */
228
- --art-version: "0.28.0"; /* @kind other */
228
+ --art-version: "0.29.0"; /* @kind other */
229
229
 
230
230
  color-scheme: dark;
231
231
  }
@@ -327,8 +327,17 @@
327
327
  :root { --dur-instant: 0ms; /* @kind other */ --dur-fast: 0ms; /* @kind other */ --dur-max: 0ms; /* @kind other */ }
328
328
  }
329
329
 
330
+ /* Cascade layer (#112): base and component rules live in `@layer artificer`
331
+ so consumer styles and Tailwind `@layer utilities` can override cleanly
332
+ without specificity wars. `@font-face` and `:root` custom properties stay
333
+ outside the layer. */
334
+ @layer artificer {
335
+
330
336
  /* ═══ Base ══════════════════════════════════════════════════════════════ */
331
337
  *, *::before, *::after { box-sizing: border-box; }
338
+ /* Honor the standard HTML hidden attribute even on display-setting primitives
339
+ (.btn, .cluster, .stack, etc.), which otherwise beat the UA rule (#581). */
340
+ [hidden] { display: none !important; }
332
341
 
333
342
  /* The root is NEVER overridden (#211). html stays at the browser preference
334
343
  (100% of the user's setting; 16px by default) so every rem-bound --t-*-size
@@ -565,6 +574,8 @@ a:focus-visible { outline: var(--focus-width) solid var(--accent); outline-offse
565
574
  transition: border-color var(--dur-fast) var(--ease);
566
575
  }
567
576
  .input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); }
577
+ /* Opt-in auto-growing textarea via CSS field-sizing (progressive enhancement, #586). */
578
+ .textarea--auto { field-sizing: content; }
568
579
  .input::placeholder { color: var(--fg-disabled); }
569
580
  .input[aria-invalid="true"] { border-color: var(--urgent); }
570
581
  /* Custom indicator for .select — appearance:none lets iOS WebKit honour
@@ -853,6 +864,7 @@ hr, .divider { border: none; border-top: 1px solid var(--border); margin: var(--
853
864
  width: 100%; max-width: 480px;
854
865
  box-shadow: var(--shadow-overlay);
855
866
  border: 1px solid var(--border);
867
+ overscroll-behavior: contain;
856
868
  animation: modal-in var(--dur-fast) var(--ease);
857
869
  }
858
870
  .modal--lg { max-width: 720px; }
@@ -1726,6 +1738,7 @@ select:focus-visible,
1726
1738
  padding: var(--s-md);
1727
1739
  background: var(--bg-raised); border: 1px solid var(--border);
1728
1740
  border-radius: var(--radius-md);
1741
+ overscroll-behavior: contain;
1729
1742
  }
1730
1743
  /* Group label. Hierarchy at scale (#94): a long spine of uniform 44px rows
1731
1744
  reads flat with only the active row as an anchor, so the header is made to
@@ -1904,6 +1917,8 @@ select:focus-visible,
1904
1917
  position: fixed; top: 0; bottom: 0; left: 0;
1905
1918
  z-index: calc(var(--z-modal) + 1);
1906
1919
  width: min(280px, 80vw); overflow-y: auto;
1920
+ overscroll-behavior: contain;
1921
+ scrollbar-gutter: stable;
1907
1922
  transform: translateX(-100%);
1908
1923
  transition: transform var(--dur-max) var(--ease);
1909
1924
  }
@@ -2131,6 +2146,9 @@ select:focus-visible,
2131
2146
  /* Every button is a touch target, classed or not — demo buttons, page-local
2132
2147
  buttons, and library buttons all get the floor. Both dimensions per WCAG 2.5.5. */
2133
2148
  button, .btn, .theme-toggle { min-height: 44px; min-width: 44px; }
2149
+ /* .figure__bar > .btn--icon shrinks to --s-xl (32px) on desktop with (0,2,0)
2150
+ specificity; explicitly restore the 44×44 touch floor on coarse pointers (#529). */
2151
+ .figure__bar > .btn--icon { width: 44px; height: 44px; min-width: 44px; }
2134
2152
  /* All text-like inputs (text/search/email/number/password/date/url/tel...).
2135
2153
  Width left to the layout (inputs fill their container; min-width here
2136
2154
  would fight flex/grid shrink and break compact search bars). */
@@ -2307,6 +2325,21 @@ select:focus-visible,
2307
2325
  min-width: 0; /* belt-and-suspenders with the minmax(0,1fr) main track */
2308
2326
  overflow-x: clip; /* a rogue wide child clips here, never scrolls the page */
2309
2327
  }
2328
+ /* Contained shell (#532): when .app-shell sits inside a .container (e.g. with
2329
+ .appbar/intro above it), drop the 100dvh floor so it stays content-sized. */
2330
+ .app-shell--contained { min-height: auto; }
2331
+ /* Flush content (#532): when an outer .container already supplies inline
2332
+ gutters, zero the bleed-grid's --s-lg side tracks without losing [bleed-*]
2333
+ lines, and expand the clip box by one focus ring so overflow-x: clip never
2334
+ slices focus outlines on leftmost controls. */
2335
+ .app-shell__content--flush {
2336
+ grid-template-columns:
2337
+ [bleed-start] 0
2338
+ [content-start] minmax(0, 1fr) [content-end]
2339
+ 0 [bleed-end];
2340
+ padding-inline: calc(var(--focus-width) + var(--focus-offset));
2341
+ margin-inline: calc(-1 * (var(--focus-width) + var(--focus-offset)));
2342
+ }
2310
2343
  @media (max-width: 800px) {
2311
2344
  .app-shell { grid-template-columns: [main-start] minmax(0, 1fr) [main-end]; }
2312
2345
  .app-shell > .sidenav { display: none; } /* the .nav-drawer takes over */
@@ -2671,3 +2704,91 @@ select:focus-visible,
2671
2704
  /* motion suppressed → static low-opacity full track; the copy carries meaning */
2672
2705
  .progress--indeterminate .progress__bar { animation: none; width: 100%; opacity: .4; }
2673
2706
  }
2707
+
2708
+ /* ═══ Inline alert — static in-flow notice inside a card or form ════════
2709
+ Distinct from .banner (full-width page-level) and .notif (toast). Tiered
2710
+ by action required: --urgent (uses --urgent-text for AA title), --attention,
2711
+ --info (default), --success. */
2712
+ .alert {
2713
+ display: flex; align-items: flex-start; gap: var(--s-sm);
2714
+ padding: var(--s-sm) var(--s-md);
2715
+ background: var(--bg-raised);
2716
+ border: 1px solid var(--border);
2717
+ border-left: 3px solid var(--steel);
2718
+ border-radius: var(--radius-md);
2719
+ color: var(--fg);
2720
+ font-size: var(--t-body-md-size);
2721
+ line-height: var(--t-body-md-lh);
2722
+ }
2723
+ .alert__body { flex: 1; min-width: 0; }
2724
+ .alert__title {
2725
+ margin: 0;
2726
+ font-family: var(--font-interface);
2727
+ font-weight: 600;
2728
+ font-size: var(--t-label-md-size);
2729
+ line-height: var(--t-label-md-lh);
2730
+ }
2731
+ .alert__msg { margin: var(--s-xs) 0 0; color: var(--fg-secondary); }
2732
+ .alert--urgent { border-left-color: var(--urgent); }
2733
+ .alert--urgent .alert__title { color: var(--urgent-text); }
2734
+ .alert--attention { border-left-color: var(--attention); }
2735
+ .alert--info { border-left-color: var(--steel); }
2736
+ .alert--success { border-left-color: var(--success); }
2737
+
2738
+ /* ═══ Button group — joined/segmented control row ═══════════════════════
2739
+ Collapses interior radii and shares the dividing border. Focused buttons
2740
+ lift onto --z-raised so focus rings are never clipped by siblings. */
2741
+ .btn-group { display: inline-flex; align-items: stretch; }
2742
+ .btn-group > .btn { border-radius: 0; position: relative; }
2743
+ .btn-group > .btn:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
2744
+ .btn-group > .btn:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
2745
+ .btn-group > .btn:not(:first-child) { margin-left: -1px; }
2746
+ .btn-group > .btn:hover,
2747
+ .btn-group > .btn:focus-visible,
2748
+ .btn-group > .btn[aria-pressed="true"] { z-index: var(--z-raised); }
2749
+
2750
+ /* ═══ List group — bordered vertical stack of rows ══════════════════════ */
2751
+ .list-group {
2752
+ display: flex; flex-direction: column;
2753
+ margin: 0; padding: 0; list-style: none;
2754
+ background: var(--bg-raised);
2755
+ border: 1px solid var(--border);
2756
+ border-radius: var(--radius-md);
2757
+ overflow: hidden;
2758
+ }
2759
+ .list-group__item {
2760
+ display: flex; align-items: center; justify-content: space-between; gap: var(--s-sm);
2761
+ padding: var(--s-sm) var(--s-md);
2762
+ color: var(--fg);
2763
+ text-decoration: none;
2764
+ background: transparent;
2765
+ border: 0;
2766
+ font: inherit;
2767
+ text-align: left;
2768
+ width: 100%;
2769
+ }
2770
+ .list-group__item + .list-group__item { border-top: 1px solid var(--border); }
2771
+ a.list-group__item,
2772
+ button.list-group__item {
2773
+ cursor: pointer;
2774
+ transition: background var(--dur-instant) var(--ease), color var(--dur-instant) var(--ease);
2775
+ }
2776
+ @media (hover: hover) {
2777
+ a.list-group__item:hover,
2778
+ button.list-group__item:hover { background: var(--bg-overlay); }
2779
+ }
2780
+ a.list-group__item:focus-visible,
2781
+ button.list-group__item:focus-visible {
2782
+ outline: var(--focus-width) solid var(--accent);
2783
+ outline-offset: var(--focus-offset-inset);
2784
+ }
2785
+ .list-group__item--active {
2786
+ background: var(--bg-overlay);
2787
+ box-shadow: inset 3px 0 0 var(--accent);
2788
+ }
2789
+ @media (pointer: coarse) {
2790
+ a.list-group__item,
2791
+ button.list-group__item { min-height: 44px; }
2792
+ }
2793
+
2794
+ } /* end @layer artificer */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schemaVersion": "1",
3
- "$version": "0.28.0",
3
+ "$version": "0.29.0",
4
4
  "$doc": "Primitive mint ledger (ADR 0037, #199). Provenance + adoption semantics for every shipped primitive. tokens.json owns token VALUES; scripts/css-token-set.baseline.json owns the token SET; this file owns grouping, vintage, recipes, and adoption signals. Gated by scripts/check-primitives.mjs (check:primitives). minted 'pending-backfill' marks an entry awaiting mechanical dating (all dated by #199 PR-3's backfill; the sentinel remains legal for future re-derivations); 'unreleased' marks a mint on a feature branch, swept to the release version by sync:primitives-vintage. The 'js' field names a VANILLA src/ behavior module (data- hook + window API); the 'react' field names the compiled React adapter component(s) for the primitive (@cameronsjo/artificer/react) — distinct fields because they are distinct consumption models.",
5
5
  "primitives": {
6
6
  "stack": {
@@ -1061,6 +1061,49 @@
1061
1061
  "adoption": {
1062
1062
  "supersedes": "hand-rolled --bg-raised + accent border-left note blocks"
1063
1063
  }
1064
+ },
1065
+ "alert": {
1066
+ "kind": "component",
1067
+ "minted": "0.29.0",
1068
+ "classes": [
1069
+ "alert",
1070
+ "alert__body",
1071
+ "alert__title",
1072
+ "alert__msg",
1073
+ "alert--urgent",
1074
+ "alert--attention",
1075
+ "alert--info",
1076
+ "alert--success"
1077
+ ],
1078
+ "react": [
1079
+ "Alert"
1080
+ ],
1081
+ "recipe": "Inline static alert inside a card or form"
1082
+ },
1083
+ "btn-group": {
1084
+ "kind": "component",
1085
+ "minted": "0.29.0",
1086
+ "classes": [
1087
+ "btn-group"
1088
+ ],
1089
+ "react": [
1090
+ "ButtonGroup"
1091
+ ],
1092
+ "recipe": "Joined/segmented button row"
1093
+ },
1094
+ "list-group": {
1095
+ "kind": "component",
1096
+ "minted": "0.29.0",
1097
+ "classes": [
1098
+ "list-group",
1099
+ "list-group__item",
1100
+ "list-group__item--active"
1101
+ ],
1102
+ "react": [
1103
+ "ListGroup",
1104
+ "ListGroupItem"
1105
+ ],
1106
+ "recipe": "Bordered vertical stack of rows"
1064
1107
  }
1065
1108
  },
1066
1109
  "versions": {
@@ -17,8 +17,10 @@
17
17
  var pinned = saved === 'light' || saved === 'dark';
18
18
  var prefersLight = window.matchMedia &&
19
19
  window.matchMedia('(prefers-color-scheme: light)').matches;
20
- document.documentElement.setAttribute(
21
- 'data-theme', pinned ? saved : (prefersLight ? 'light' : 'dark'));
20
+ var theme = pinned ? saved : (prefersLight ? 'light' : 'dark');
21
+ document.documentElement.setAttribute('data-theme', theme);
22
+ var meta = document.querySelector && document.querySelector('meta[name="color-scheme"]');
23
+ if (meta) meta.setAttribute('content', pinned ? theme : 'light dark');
22
24
  } catch (e) {
23
25
  document.documentElement.setAttribute('data-theme', 'dark'); /* fail-safe to brand surface, never light */
24
26
  }
package/src/tokens.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://design-tokens.org/schema.json",
3
3
  "$description": "Artificer · Cameron's personal design system. Machine-readable token export. Mirrors artificer.css. Source of truth lives in the CSS — regenerate this file if tokens change there.",
4
- "$version": "0.28.0",
4
+ "$version": "0.29.0",
5
5
 
6
6
  "color": {
7
7
  "$description": "All colors paired with their dark/light values. AAA-tuned where indicated. v0.6 palette: apothecary × deco × speakeasy.",