ada-ui 7.0.0 → 7.1.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.
@@ -0,0 +1,14 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ # Everything here is dev-only tooling (sass, dev server, changesets);
8
+ # nothing ships in the published package, which is pure CSS. Group all
9
+ # dev-dependency updates into a single weekly PR to cut the noise.
10
+ groups:
11
+ dev-dependencies:
12
+ dependency-type: development
13
+ patterns:
14
+ - "*"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # ada-ui
2
2
 
3
+ ## 7.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b2ac13a: Added thin variant of Command
8
+
9
+ ## 7.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 1cd7847: Automated the version pinned in the README's jsDelivr CDN links. The release
14
+ step now rewrites them to the version being cut, so the docs no longer carry a
15
+ manual `@version` placeholder for users to swap by hand. Snapshots are
16
+ unaffected — they don't run the release `version` script.
17
+ - 4d6e15c: Fixed the `npx ada-ui <theme>` bundle generator concatenating the theme before
18
+ the base stylesheet. A theme is now appended after `ada.css` so its `:root`
19
+ overrides win the cascade — curated themes (e.g. jupiter-2) that override
20
+ engine-output variables (`--950`, `--panel-bg`, …) were previously clobbered by
21
+ the engine defaults and rendered with the wrong palette. Ramp themes (blue,
22
+ green) were unaffected.
23
+
24
+ Updated the README theming section to match the current pure-CSS engine: load a
25
+ theme after `ada.css`, the available ready-made themes, and how to author a
26
+ ramp, per-slot, or fully curated theme (all three of `--base-hue`, `--lightness`
27
+ and `--chroma` are required for a ramp).
28
+
3
29
  ## 7.0.0
4
30
 
5
31
  ### Major Changes
package/README.md CHANGED
@@ -6,10 +6,10 @@ My sci-fi inspired UI components library. Still growing...
6
6
 
7
7
  ## CDN
8
8
 
9
- https://cdn.jsdelivr.net/gh/tklepzig/Ada@version/css/ada.css
9
+ https://cdn.jsdelivr.net/gh/tklepzig/Ada@7.1.0/css/ada.css
10
10
 
11
- Replace `version` with the version of your desired release, see
12
- https://github.com/tklepzig/Ada/releases (e.g. `5.0.0`)
11
+ The link points at the latest release. To pin a different one, swap the version
12
+ — see https://github.com/tklepzig/Ada/releases.
13
13
 
14
14
  ## Install
15
15
 
@@ -19,13 +19,78 @@ https://github.com/tklepzig/Ada/releases (e.g. `5.0.0`)
19
19
  # Using yarn
20
20
  yarn add ada-ui
21
21
 
22
- ## Select a Theme
22
+ ## Theming
23
23
 
24
- Beginning with version 3.0.0, you can choose between different themes. When
25
- using the CSS, ensure to include the correct theme file before the main one,
26
- e.g.:
24
+ `ada.css` ships the colour engine but no palette of its own, so it always needs
25
+ a theme alongside it. A theme is just a handful of custom properties on `:root`
26
+ — load it **after** `ada.css` so its values win the cascade:
27
27
 
28
- https://cdn.jsdelivr.net/gh/tklepzig/Ada@5.0.0/css/ada.blue.css
28
+ <link rel="stylesheet" href="css/ada.css" />
29
+ <link rel="stylesheet" href="css/ada.blue.css" />
30
+
31
+ Or via the CDN:
32
+
33
+ https://cdn.jsdelivr.net/gh/tklepzig/Ada@7.1.0/css/ada.css
34
+ https://cdn.jsdelivr.net/gh/tklepzig/Ada@7.1.0/css/ada.blue.css
35
+
36
+ With npm, import the base entry first and the theme second (same cascade rule
37
+ through your bundler):
38
+
39
+ import "ada-ui";
40
+ import "ada-ui/jupiter-2";
41
+
42
+ ### Ready-made themes
43
+
44
+ | Import | Theme |
45
+ | ------------------ | -------------------------------------------------- |
46
+ | `ada-ui/blue` | Blue (the default ramp theme) |
47
+ | `ada-ui/green` | Green |
48
+ | `ada-ui/jupiter-2` | Deep-space navy + warning-orange + cream (curated) |
49
+
50
+ ### The colour slots
51
+
52
+ The palette is five independent slots, each applied via a class: `primary` (the
53
+ no-class default), `tone-1`, `tone-2`, `tone-3`, and `warn`. They are treated as
54
+ distinct colours, not shades of one. Within a slot, a light→dark `--color100` …
55
+ `--color950` ladder is derived for you.
56
+
57
+ For a light variant of any theme, add the `.light-theme` class to your root
58
+ element (e.g. `<html class="light-theme">`).
59
+
60
+ ### Rolling your own theme
61
+
62
+ A custom theme is a small CSS file that sets `:root` properties. There are three
63
+ levels, from least to most control:
64
+
65
+ 1. **Hue ramp** — set `--base-hue`, `--lightness` and `--chroma`. The four tones
66
+ derive from the base hue by a fixed per-slot offset; `warn` stays at its
67
+ fixed red. The blue theme lands exactly on the default offsets, so it is
68
+ just:
69
+
70
+ ```css
71
+ :root {
72
+ --base-hue: 246;
73
+ --lightness: 0.3;
74
+ --chroma: 0.1;
75
+ --lightness-light-shift: 0.1; /* lift lightness in .light-theme */
76
+ }
77
+ ```
78
+
79
+ 2. **Per-slot overrides** — override `--hue` / `--lightness` / `--chroma` on an
80
+ individual slot class to break it off the ramp:
81
+
82
+ ```css
83
+ .tone-3 {
84
+ --hue: 258;
85
+ --chroma: 0.06;
86
+ }
87
+ ```
88
+
89
+ 3. **Fully curated** — additionally override the ladder ends (`--100` / `--950`)
90
+ to decouple background and text from the hue ramp, and the surface/label
91
+ knobs (`--panel-bg`, `--command-fg`, `--tile-fg`). The **jupiter-2** theme
92
+ (`scss/ada.jupiter-2.scss`) is authored this way and is the reference
93
+ example.
29
94
 
30
95
  ## Versioning and Publishing
31
96
 
package/css/ada.css CHANGED
@@ -1 +1 @@
1
- :root,.primary{--hue: var(--base-hue)}.tone-1{--hue: calc(var(--base-hue) - 26)}.tone-2{--hue: calc(var(--base-hue) - 51)}.tone-3{--hue: calc(var(--base-hue) - 76)}.warn{--hue: 29}:root,.primary,.tone-1,.tone-2,.tone-3,.warn{--lightness-resolved: var(--lightness);--chroma-resolved: var(--chroma);--bg-body: var(--color950);--fg-body: var(--color100);--bg-body-light: var(--color100);--fg-body-light: var(--color800);--panel-bg: oklch(var(--500) / 0.1);--100: 0.91 0.05 var(--hue);--500: calc(var(--lightness-resolved) + 0.15) calc(var(--chroma-resolved) + 0.06) var(--hue);--600: calc(var(--lightness-resolved) + 0.1) calc(var(--chroma-resolved) + 0.04) var(--hue);--700: calc(var(--lightness-resolved) + 0.05) calc(var(--chroma-resolved) + 0.02) var(--hue);--800: var(--lightness-resolved) var(--chroma-resolved) var(--hue);--950: 0.18 0.03 var(--hue);--color100: oklch(var(--100));--color500: oklch(var(--500));--color600: oklch(var(--600));--color700: oklch(var(--700));--color800: oklch(var(--800));--color950: oklch(var(--950))}.light-theme:root,.light-theme.primary,.light-theme.tone-1,.light-theme.tone-2,.light-theme.tone-3,.light-theme.warn,:root.light-theme :root,:root.light-theme .primary,:root.light-theme .tone-1,:root.light-theme .tone-2,:root.light-theme .tone-3,:root.light-theme .warn{--lightness-resolved: calc(var(--lightness) + var(--lightness-light-shift, 0));--chroma-resolved: calc(var(--chroma) + var(--chroma-light-shift, 0));--bg-body: var(--bg-body-light);--fg-body: var(--fg-body-light)}*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}body{margin:0}h1,h2,h3,h4,h5,h6,p,pre{font-size:inherit;font-weight:inherit;margin:0}a{color:inherit;text-decoration:inherit}button,input,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}button,[role=button]{cursor:pointer}:disabled{cursor:default}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}ol,ul,menu{list-style:none;margin:0;padding:0}:root{--font-family: "Open Sans", sans-serif;--font-size: 16px;--spacing-xs: 2px;--spacing-sm: 6px;--spacing: 10px;--spacing-lg: 14px;--border-width-sm: 1px;--border-width: 2px;--box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4)}@media screen and (min-width: 640px){:root{--font-size: 14px}}:root.light-theme{--box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.4)}.scaled,:root{--text-xs: calc(0.75rem * var(--scale, 1));--text-sm: calc(0.85rem * var(--scale, 1));--text-base: calc(1rem * var(--scale, 1));--text-lg: calc(1.2rem * var(--scale, 1));--text-xl: calc(1.4rem * var(--scale, 1));--text-2xl: calc(1.6rem * var(--scale, 1));--text-3xl: calc(1.8rem * var(--scale, 1));--padding-xs: calc(0.15rem * var(--scale, 1));--padding-sm: calc(0.4rem * var(--scale, 1));--padding: calc(0.75rem * var(--scale, 1));--padding-lg: calc(1rem * var(--scale, 1));--border-radius: calc(0.3rem * var(--scale, 1));--command-min-size: calc(3rem * var(--scale, 1));--compound-spacer-min-size: calc(1rem * var(--scale, 1));--corner-size: calc(1rem * var(--scale, 1));--corner-small-size: calc(0.75rem * var(--scale, 1))}.panel>article::-webkit-scrollbar,.tile>article::-webkit-scrollbar,body::-webkit-scrollbar{width:var(--spacing-sm);background:transparent}.panel>article::-webkit-scrollbar-thumb,.tile>article::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb{min-width:1rem;border-style:solid;border-color:transparent;border-width:var(--spacing-sm);background:var(--color700);box-sizing:border-box;background-clip:border-box}html{font-family:var(--font-family);font-weight:400;font-size:var(--font-size)}body{font-size:var(--text-base);padding:var(--padding);background:var(--bg-body);color:var(--fg-body);transition:background-color .15s ease-in-out}h1,h2,h3,h4,.panel>header,.tile>header{font-weight:300;text-shadow:0 0 4px oklch(var(--400)/0.5);color:var(--fg-body)}h1{font-size:var(--text-3xl)}h2{font-size:var(--text-2xl)}h3{font-size:var(--text-xl)}h4{font-size:var(--text-lg)}.command{background-color:var(--color800);box-shadow:var(--box-shadow);display:grid;align-items:end;justify-items:end;text-align:end;border-style:solid;border-color:transparent;border-width:var(--border-width);padding:var(--padding-xs) var(--padding-sm);min-height:var(--command-min-size);min-width:var(--command-min-size);border-radius:var(--border-radius);overflow:hidden;outline:none;color:var(--command-fg, var(--color100));font-family:inherit;font-size:var(--text-base);cursor:pointer;user-select:none;vertical-align:middle;transition:border-color .15s ease-in-out,background-color .15s ease-in-out}.command.flash{animation:flash-background 1s ease-in-out infinite}.command[data-label][data-abbr]::after{content:attr(data-abbr)}@media(min-width: 640px){.command[data-label][data-abbr]::after{content:attr(data-label)}}.command:disabled{opacity:.7;cursor:default;pointer-events:none;background:#6d6d6d;color:#ededed}.command.outline{background-color:transparent;border-color:var(--color700);color:var(--fg-body)}.command.outline.flash{animation-name:flash-border}.command.outline:disabled{background:transparent;border-color:#6d6d6d;color:#6d6d6d}.command.outline:active{color:var(--command-fg, var(--color100))}.command:focus{border-color:var(--color500)}.command:active{border-color:var(--color500);background-color:var(--color500);animation-play-state:paused}.compound-commands{display:inline-flex;gap:var(--spacing-sm)}.compound-commands>.flex{flex:1}.compound-commands>.spacer{background-color:var(--color800);box-shadow:var(--box-shadow);min-width:var(--compound-spacer-min-size);min-height:var(--compound-spacer-min-size)}.compound-commands>.spacer.outline{background-color:transparent;border:var(--border-width) solid var(--color700)}.compound-commands>.text{font-size:var(--text-3xl);line-height:var(--text-3xl);align-self:center;padding:var(--padding-xs)}.compound-commands>.command:first-child,.compound-commands .spacer:first-child{border-radius:var(--border-radius) 0 0 var(--border-radius)}.compound-commands>.command:not(:first-child):not(:last-child),.compound-commands .spacer:not(:first-child):not(:last-child){border-radius:0}.compound-commands>.command:last-child,.compound-commands .spacer:last-child{border-radius:0 var(--border-radius) var(--border-radius) 0}.compound-commands.vertical{flex-direction:column}.compound-commands.vertical>.text{justify-self:center}.compound-commands.vertical>.command:first-child,.compound-commands.vertical .spacer:first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.compound-commands.vertical>.command:last-child,.compound-commands.vertical .spacer:last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}@keyframes flash-background{50%{background-color:var(--color600)}}@keyframes flash-border{50%{border-color:var(--color500)}}.input{border-radius:var(--border-radius);box-shadow:var(--box-shadow);outline:none;border:var(--border-width) solid var(--color600);color:var(--fg-body);font-family:inherit;background-color:transparent;transition:border-color .15s ease-in-out;padding:var(--padding);font-size:var(--text-base)}.input:focus{border:var(--border-width) solid var(--color500)}.input:disabled{opacity:.4;filter:saturate(0.6);cursor:default;pointer-events:none}.panel>footer::after,.tile>footer::after,.panel>footer::before,.tile>footer::before,.panel>header::after,.tile>header::after,.panel>header::before,.tile>header::before{content:"";border-style:solid;border-color:var(--color700);position:absolute;height:var(--corner-size);width:var(--corner-size);z-index:2;--thickness: var(--border-width)}.tile>footer::after,.tile>footer::before,.tile>header::after,.tile>header::before{height:var(--corner-small-size);width:var(--corner-small-size);border-color:var(--color600);--thickness: var(--border-width-sm)}.panel,.tile{background:var(--panel-bg);box-shadow:var(--box-shadow);border-radius:var(--border-radius);display:grid;grid-template-rows:auto 1fr auto;overflow:auto}.panel>header,.tile>header{position:relative;font-size:var(--text-2xl);padding:var(--padding-sm) var(--padding)}.panel>header:empty,.tile>header:empty{padding:0}.panel>header::before,.tile>header::before{border-width:var(--thickness) 0 0 var(--thickness);border-radius:var(--border-radius) 0 0 0;left:0;top:0}.panel>header::after,.tile>header::after{border-width:var(--thickness) var(--thickness) 0 0;border-radius:0 var(--border-radius) 0 0;right:0;top:0}.panel>article,.tile>article{z-index:1;padding:var(--padding);overflow:auto;font-size:var(--text-base)}.panel>footer,.tile>footer{position:relative;padding:var(--padding-sm) var(--padding);font-size:var(--text-sm);text-align:right}.panel>footer:empty,.tile>footer:empty{padding:0}.panel>footer::before,.tile>footer::before{border-width:0 0 var(--thickness) var(--thickness);border-radius:0 0 0 var(--border-radius);left:0;bottom:0}.panel>footer::after,.tile>footer::after{border-width:0 var(--thickness) var(--thickness) 0;border-radius:0 0 var(--border-radius) 0;right:0;bottom:0}.tile{background:oklch(var(--800)/0.75);color:var(--tile-fg, var(--fg-body))}.tile>header{font-size:var(--text-lg)}.tile>footer{font-size:var(--text-xs)}.spinner{display:inline-grid;justify-items:center;align-items:center;width:1em;height:1em;position:relative;box-sizing:border-box;animation:6s .5s rotate ease-in-out alternate infinite}.spinner::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-style:solid;border-width:.05em;border-radius:50%;border-color:var(--color700) transparent;animation:4s .5s inset1 ease-in-out infinite;box-shadow:0px 12px 10px -12px rgba(0,0,0,.4),0px -12px 10px -12px rgba(0,0,0,.4)}.spinner::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-style:solid;border-width:.05em;border-radius:50%;border-color:transparent var(--color500);animation:4s .5s inset2 ease-in-out infinite;box-shadow:12px 0px 10px -12px rgba(0,0,0,.4),-12px 0px 10px -12px rgba(0,0,0,.4)}@keyframes rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes inset1{0%{top:0;left:0;right:0;bottom:0;transform:rotate(0)}12.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(0)}37.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(180deg)}50%{top:0;left:0;right:0;bottom:0;transform:rotate(180deg)}100%{top:0;left:0;right:0;bottom:0;transform:rotate(180deg)}}@keyframes inset2{0%{top:0;left:0;right:0;bottom:0;transform:rotate(0)}50%{top:0;left:0;right:0;bottom:0;transform:rotate(0)}62.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(0)}87.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(180deg)}100%{top:0;left:0;right:0;bottom:0;transform:rotate(180deg)}}
1
+ :root,.primary{--hue: var(--base-hue)}.tone-1{--hue: calc(var(--base-hue) - 26)}.tone-2{--hue: calc(var(--base-hue) - 51)}.tone-3{--hue: calc(var(--base-hue) - 76)}.warn{--hue: 29}:root,.primary,.tone-1,.tone-2,.tone-3,.warn{--lightness-resolved: var(--lightness);--chroma-resolved: var(--chroma);--bg-body: var(--color950);--fg-body: var(--color100);--bg-body-light: var(--color100);--fg-body-light: var(--color800)}.light-theme:root,.light-theme.primary,.light-theme.tone-1,.light-theme.tone-2,.light-theme.tone-3,.light-theme.warn,:root.light-theme :root,:root.light-theme .primary,:root.light-theme .tone-1,:root.light-theme .tone-2,:root.light-theme .tone-3,:root.light-theme .warn{--lightness-resolved: calc(var(--lightness) + var(--lightness-light-shift, 0));--chroma-resolved: calc(var(--chroma) + var(--chroma-light-shift, 0));--bg-body: var(--bg-body-light);--fg-body: var(--fg-body-light)}:root,.primary,.tone-1,.tone-2,.tone-3,.warn{--panel-bg: oklch(var(--500) / 0.1);--100: 0.91 0.05 var(--hue);--500: calc(var(--lightness-resolved) + 0.15) calc(var(--chroma-resolved) + 0.06) var(--hue);--600: calc(var(--lightness-resolved) + 0.1) calc(var(--chroma-resolved) + 0.04) var(--hue);--700: calc(var(--lightness-resolved) + 0.05) calc(var(--chroma-resolved) + 0.02) var(--hue);--800: var(--lightness-resolved) var(--chroma-resolved) var(--hue);--950: 0.18 0.03 var(--hue);--color100: oklch(var(--100));--color500: oklch(var(--500));--color600: oklch(var(--600));--color700: oklch(var(--700));--color800: oklch(var(--800));--color950: oklch(var(--950))}*,::before,::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}html{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{margin:0}h1,h2,h3,h4,h5,h6,p,pre{font-size:inherit;font-weight:inherit;margin:0}a{color:inherit;text-decoration:inherit}button,input,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:rgba(0,0,0,0);background-image:none}button,[role=button]{cursor:pointer}:disabled{cursor:default}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}ol,ul,menu{list-style:none;margin:0;padding:0}:root{--font-family: "Open Sans", sans-serif;--font-size: 16px;--spacing-xs: 2px;--spacing-sm: 6px;--spacing: 10px;--spacing-lg: 14px;--border-width-sm: 1px;--border-width: 2px;--box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.4)}@media screen and (min-width: 640px){:root{--font-size: 14px}}:root.light-theme{--box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.4)}.scaled,:root{--text-xs: calc(0.75rem * var(--scale, 1));--text-sm: calc(0.85rem * var(--scale, 1));--text-base: calc(1rem * var(--scale, 1));--text-lg: calc(1.2rem * var(--scale, 1));--text-xl: calc(1.4rem * var(--scale, 1));--text-2xl: calc(1.6rem * var(--scale, 1));--text-3xl: calc(1.8rem * var(--scale, 1));--padding-xs: calc(0.15rem * var(--scale, 1));--padding-sm: calc(0.4rem * var(--scale, 1));--padding: calc(0.75rem * var(--scale, 1));--padding-lg: calc(1rem * var(--scale, 1));--border-radius: calc(0.3rem * var(--scale, 1));--command-min-size: calc(3rem * var(--scale, 1));--command-min-size-thin: calc(2rem * var(--scale, 1));--compound-spacer-min-size: calc(1rem * var(--scale, 1));--corner-size: calc(1rem * var(--scale, 1));--corner-small-size: calc(0.75rem * var(--scale, 1))}.panel>article::-webkit-scrollbar,.tile>article::-webkit-scrollbar,body::-webkit-scrollbar{width:var(--spacing-sm);background:rgba(0,0,0,0)}.panel>article::-webkit-scrollbar-thumb,.tile>article::-webkit-scrollbar-thumb,body::-webkit-scrollbar-thumb{min-width:1rem;border-style:solid;border-color:rgba(0,0,0,0);border-width:var(--spacing-sm);background:var(--color700);box-sizing:border-box;background-clip:border-box}html{font-family:var(--font-family);font-weight:400;font-size:var(--font-size)}body{font-size:var(--text-base);padding:var(--padding);background:var(--bg-body);color:var(--fg-body);transition:background-color .15s ease-in-out}h1,h2,h3,h4,.panel>header,.tile>header{font-weight:300;text-shadow:0 0 4px oklch(var(--400)/0.5);color:var(--fg-body)}h1{font-size:var(--text-3xl)}h2{font-size:var(--text-2xl)}h3{font-size:var(--text-xl)}h4{font-size:var(--text-lg)}.command{background-color:var(--color800);box-shadow:var(--box-shadow);display:grid;align-items:end;justify-items:end;text-align:end;border-style:solid;border-color:rgba(0,0,0,0);border-width:var(--border-width);padding:var(--padding-xs) var(--padding-sm);min-height:var(--command-min-size);min-width:var(--command-min-size);border-radius:var(--border-radius);overflow:hidden;outline:none;color:var(--command-fg, var(--color100));font-family:inherit;font-size:var(--text-base);cursor:pointer;user-select:none;vertical-align:middle;transition:border-color .15s ease-in-out,background-color .15s ease-in-out}.command.thin{min-height:var(--command-min-size-thin);min-width:var(--command-min-size-thin)}.command.flash{animation:flash-background 1s ease-in-out infinite}.command[data-label][data-abbr]::after{content:attr(data-abbr)}@media(min-width: 640px){.command[data-label][data-abbr]::after{content:attr(data-label)}}.command:disabled{opacity:.7;cursor:default;pointer-events:none;background:#6d6d6d;color:#ededed}.command.outline{background-color:rgba(0,0,0,0);border-color:var(--color700);color:var(--fg-body)}.command.outline.flash{animation-name:flash-border}.command.outline:disabled{background:rgba(0,0,0,0);border-color:#6d6d6d;color:#6d6d6d}.command.outline:active{color:var(--command-fg, var(--color100))}.command:focus{border-color:var(--color500)}.command:active{border-color:var(--color500);background-color:var(--color500);animation-play-state:paused}.compound-commands{display:inline-flex;gap:var(--spacing-sm)}.compound-commands>.flex{flex:1}.compound-commands>.spacer{background-color:var(--color800);box-shadow:var(--box-shadow);min-width:var(--compound-spacer-min-size);min-height:var(--compound-spacer-min-size)}.compound-commands>.spacer.outline{background-color:rgba(0,0,0,0);border:var(--border-width) solid var(--color700)}.compound-commands>.text{font-size:var(--text-3xl);line-height:var(--text-3xl);align-self:center;padding:var(--padding-xs)}.compound-commands>.command:first-child,.compound-commands .spacer:first-child{border-radius:var(--border-radius) 0 0 var(--border-radius)}.compound-commands>.command:not(:first-child):not(:last-child),.compound-commands .spacer:not(:first-child):not(:last-child){border-radius:0}.compound-commands>.command:last-child,.compound-commands .spacer:last-child{border-radius:0 var(--border-radius) var(--border-radius) 0}.compound-commands.thin>.command{min-height:var(--command-min-size-thin);min-width:var(--command-min-size-thin)}.compound-commands.vertical{flex-direction:column}.compound-commands.vertical>.text{justify-self:center}.compound-commands.vertical>.command:first-child,.compound-commands.vertical .spacer:first-child{border-radius:var(--border-radius) var(--border-radius) 0 0}.compound-commands.vertical>.command:last-child,.compound-commands.vertical .spacer:last-child{border-radius:0 0 var(--border-radius) var(--border-radius)}@keyframes flash-background{50%{background-color:var(--color600)}}@keyframes flash-border{50%{border-color:var(--color500)}}.input{border-radius:var(--border-radius);box-shadow:var(--box-shadow);outline:none;border:var(--border-width) solid var(--color600);color:var(--fg-body);font-family:inherit;background-color:rgba(0,0,0,0);transition:border-color .15s ease-in-out;padding:var(--padding);font-size:var(--text-base)}.input:focus{border:var(--border-width) solid var(--color500)}.input:disabled{opacity:.4;filter:saturate(0.6);cursor:default;pointer-events:none}.panel>footer::after,.tile>footer::after,.panel>footer::before,.tile>footer::before,.panel>header::after,.tile>header::after,.panel>header::before,.tile>header::before{content:"";border-style:solid;border-color:var(--color700);position:absolute;height:var(--corner-size);width:var(--corner-size);z-index:2;--thickness: var(--border-width)}.tile>footer::after,.tile>footer::before,.tile>header::after,.tile>header::before{height:var(--corner-small-size);width:var(--corner-small-size);border-color:var(--color600);--thickness: var(--border-width-sm)}.panel,.tile{background:var(--panel-bg);box-shadow:var(--box-shadow);border-radius:var(--border-radius);display:grid;grid-template-rows:auto 1fr auto;overflow:auto}.panel>header,.tile>header{position:relative;font-size:var(--text-2xl);padding:var(--padding-sm) var(--padding)}.panel>header:empty,.tile>header:empty{padding:0}.panel>header::before,.tile>header::before{border-width:var(--thickness) 0 0 var(--thickness);border-radius:var(--border-radius) 0 0 0;left:0;top:0}.panel>header::after,.tile>header::after{border-width:var(--thickness) var(--thickness) 0 0;border-radius:0 var(--border-radius) 0 0;right:0;top:0}.panel>article,.tile>article{z-index:1;padding:var(--padding);overflow:auto;font-size:var(--text-base)}.panel>footer,.tile>footer{position:relative;padding:var(--padding-sm) var(--padding);font-size:var(--text-sm);text-align:right}.panel>footer:empty,.tile>footer:empty{padding:0}.panel>footer::before,.tile>footer::before{border-width:0 0 var(--thickness) var(--thickness);border-radius:0 0 0 var(--border-radius);left:0;bottom:0}.panel>footer::after,.tile>footer::after{border-width:0 var(--thickness) var(--thickness) 0;border-radius:0 0 var(--border-radius) 0;right:0;bottom:0}.tile{background:oklch(var(--800)/0.75);color:var(--tile-fg, var(--fg-body))}.tile>header{font-size:var(--text-lg)}.tile>footer{font-size:var(--text-xs)}.spinner{display:inline-grid;justify-items:center;align-items:center;width:1em;height:1em;position:relative;box-sizing:border-box;animation:6s .5s rotate ease-in-out alternate infinite}.spinner::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-style:solid;border-width:.05em;border-radius:50%;border-color:var(--color700) rgba(0,0,0,0);animation:4s .5s inset1 ease-in-out infinite;box-shadow:0px 12px 10px -12px rgba(0,0,0,.4),0px -12px 10px -12px rgba(0,0,0,.4)}.spinner::after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-style:solid;border-width:.05em;border-radius:50%;border-color:rgba(0,0,0,0) var(--color500);animation:4s .5s inset2 ease-in-out infinite;box-shadow:12px 0px 10px -12px rgba(0,0,0,.4),-12px 0px 10px -12px rgba(0,0,0,.4)}@keyframes rotate{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes inset1{0%{top:0;left:0;right:0;bottom:0;transform:rotate(0)}12.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(0)}37.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(180deg)}50%{top:0;left:0;right:0;bottom:0;transform:rotate(180deg)}100%{top:0;left:0;right:0;bottom:0;transform:rotate(180deg)}}@keyframes inset2{0%{top:0;left:0;right:0;bottom:0;transform:rotate(0)}50%{top:0;left:0;right:0;bottom:0;transform:rotate(0)}62.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(0)}87.5%{top:.2em;left:.2em;right:.2em;bottom:.2em;transform:rotate(180deg)}100%{top:0;left:0;right:0;bottom:0;transform:rotate(180deg)}}
package/index.html CHANGED
@@ -274,6 +274,14 @@
274
274
  <button class="command tone-3">Command</button>
275
275
  <button class="command warn">Command</button>
276
276
  </div>
277
+ <h3>Thin</h3>
278
+ <div class="row">
279
+ <button class="command thin">Command</button>
280
+ <button class="command thin tone-1">Command</button>
281
+ <button class="command thin tone-2">Command</button>
282
+ <button class="command thin tone-3">Command</button>
283
+ <button class="command thin warn">Command</button>
284
+ </div>
277
285
  <h3>Outline</h3>
278
286
  <div class="row">
279
287
  <button class="command outline">Command</button>
@@ -355,6 +363,12 @@
355
363
  <button class="command"></button>
356
364
  <div class="spacer"></div>
357
365
  </div>
366
+ <h4>Thin</h4>
367
+ <div class="compound-commands thin">
368
+ <button class="command">Command</button>
369
+ <button class="command"></button>
370
+ <div class="spacer"></div>
371
+ </div>
358
372
  <h4>With Text</h4>
359
373
  <div class="compound-commands">
360
374
  <button class="command">Command</button>
@@ -489,7 +503,7 @@
489
503
  <footer></footer>
490
504
  </div>
491
505
  </article>
492
- <footer>Ada Version 5</footer>
506
+ <footer></footer>
493
507
  </div>
494
508
  <script>
495
509
  const themes = [
@@ -501,7 +515,8 @@
501
515
 
502
516
  function cycleTheme() {
503
517
  themeIndex = (themeIndex + 1) % themes.length;
504
- document.getElementById("theme-override").href = themes[themeIndex].href;
518
+ document.getElementById("theme-override").href =
519
+ themes[themeIndex].href;
505
520
  const nextLabel = themes[(themeIndex + 1) % themes.length].label;
506
521
  document.getElementById("theme-toggle").textContent = nextLabel;
507
522
  }
package/install.js CHANGED
@@ -15,8 +15,11 @@ const run = async (theme) => {
15
15
  );
16
16
  const baseFile = await readFile(resolve(__dirname, "css", "ada.css"), "utf8");
17
17
 
18
+ // Base engine first, theme second: a theme is just `:root` custom properties,
19
+ // and a curated theme overrides engine-output vars (--950, --panel-bg, …) at
20
+ // equal specificity — so it has to come after to win the cascade.
18
21
  const themeSuffix = theme === "blue" ? "" : `-${theme}`;
19
- writeFile(`ada${themeSuffix}.css`, themeFile.trim() + baseFile.trim());
22
+ await writeFile(`ada${themeSuffix}.css`, `${baseFile.trim()}\n${themeFile.trim()}`);
20
23
  };
21
24
 
22
25
  const theme = process.argv[2] ?? "blue";
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "ada-ui",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "scripts": {
5
5
  "dev": "concurrently -n scss,serve 'sass scss:css --watch --embed-source-map' 'alive-server .'",
6
6
  "postdev": "git checkout css/*",
7
7
  "build": "rm -rf css && sass scss:css -s compressed --no-source-map",
8
8
  "changeset": "changeset",
9
9
  "remove-snapshot": "f(){ if [ -z \"$1\" ]; then echo \"Error: No tag name specified, exiting.\"; exit 1; fi; npm dist-tag rm ada-ui $1; }; f",
10
- "version": "npm run build && changeset version"
10
+ "version": "npm run build && changeset version && ./update-readme-cdn-version.js && npm install --package-lock-only"
11
11
  },
12
12
  "bin": "install.js",
13
13
  "type": "module",
@@ -26,10 +26,14 @@
26
26
  "bugs": {
27
27
  "url": "https://github.com/tklepzig/Ada/issues"
28
28
  },
29
+ "overrides": {
30
+ "send": "^0.19.0",
31
+ "uuid": "^11.1.1"
32
+ },
29
33
  "devDependencies": {
30
- "@changesets/cli": "^2.27.1",
31
- "alive-server": "^1.2.9",
34
+ "@changesets/cli": "^2.31.0",
35
+ "alive-server": "^1.3.0",
32
36
  "concurrently": "^8.2.2",
33
- "sass": "^1.42.1"
37
+ "sass": "^1.101.0"
34
38
  }
35
39
  }
@@ -25,6 +25,11 @@
25
25
  vertical-align: middle;
26
26
  transition: border-color 0.15s ease-in-out, background-color 0.15s ease-in-out;
27
27
 
28
+ &.thin {
29
+ min-height: var(--command-min-size-thin);
30
+ min-width: var(--command-min-size-thin);
31
+ }
32
+
28
33
  &.flash {
29
34
  animation: flash-background 1s ease-in-out infinite;
30
35
  }
@@ -121,6 +126,11 @@
121
126
  }
122
127
  }
123
128
 
129
+ &.thin > .command {
130
+ min-height: var(--command-min-size-thin);
131
+ min-width: var(--command-min-size-thin);
132
+ }
133
+
124
134
  &.vertical {
125
135
  flex-direction: column;
126
136
 
package/scss/_global.scss CHANGED
@@ -44,6 +44,7 @@
44
44
  --border-radius: #{scalable(0.3rem)};
45
45
 
46
46
  --command-min-size: #{scalable(3rem)};
47
+ --command-min-size-thin: #{scalable(2rem)};
47
48
  --compound-spacer-min-size: #{scalable(1rem)};
48
49
 
49
50
  --corner-size: #{scalable(1rem)};
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ import { readFile, writeFile } from "fs/promises";
6
+ import { fileURLToPath } from "url";
7
+ import { resolve, dirname } from "path";
8
+
9
+ // Run as part of `npm run version` (the Changesets release step), right after
10
+ // `changeset version` has bumped package.json. It rewrites the version pinned in
11
+ // the README's CDN links so the docs always point at the release being cut — no
12
+ // manual edit needed. The Changesets action then commits the updated README into
13
+ // the Release PR alongside package.json and the lockfile.
14
+ //
15
+ // Snapshots don't run `npm run version`, so snapshot versions never leak in here.
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+
19
+ // Match the version segment in any jsDelivr GitHub URL for this repo, e.g.
20
+ // `cdn.jsdelivr.net/gh/tklepzig/Ada@7.0.0/css/...`. Anchored on the repo so it
21
+ // also catches the literal `@version` placeholder on first run. jsDelivr
22
+ // normalises the `v`-prefixed git tags, so the plain package.json version works.
23
+ const cdnVersionPattern =
24
+ /(cdn\.jsdelivr\.net\/gh\/tklepzig\/Ada@)[^/\s]+(\/)/g;
25
+
26
+ const run = async () => {
27
+ const { version } = JSON.parse(
28
+ await readFile(resolve(__dirname, "package.json"), "utf8"),
29
+ );
30
+
31
+ const readmePath = resolve(__dirname, "README.md");
32
+ const readme = await readFile(readmePath, "utf8");
33
+ const updated = readme.replace(cdnVersionPattern, `$1${version}$2`);
34
+
35
+ if (updated === readme) {
36
+ console.warn("update-readme-cdn-version: no CDN links found to update.");
37
+ return;
38
+ }
39
+
40
+ await writeFile(readmePath, updated);
41
+ console.log(`update-readme-cdn-version: pinned CDN links to ${version}.`);
42
+ };
43
+
44
+ run();