@instruments/materia-ui 0.3.0 → 0.3.1

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.
@@ -34,7 +34,8 @@ declare const getBaseSize: (size: ButtonSize) => ComponentSize;
34
34
  * - neutral + outline → the bordered button (old `outline` variant)
35
35
  * - neutral + ghost → the transparent button (old `ghost` variant)
36
36
  * - neutral + link → the inline link button (old `link` variant)
37
- * - neutral + transparent → the blurred translucent button
37
+ * - neutral + transparent → the blurred translucent button, for content
38
+ * over images only (see `tokens/emphasis`)
38
39
  */
39
40
  declare const buttonVariants: (props?: ({
40
41
  tone?: "brand" | "danger" | "neutral" | null | undefined;
@@ -156,7 +156,8 @@ const BRAND_TRANSPARENT = "transform-gpu border-transparent bg-brand/50 backdrop
156
156
  * - neutral + outline → the bordered button (old `outline` variant)
157
157
  * - neutral + ghost → the transparent button (old `ghost` variant)
158
158
  * - neutral + link → the inline link button (old `link` variant)
159
- * - neutral + transparent → the blurred translucent button
159
+ * - neutral + transparent → the blurred translucent button, for content
160
+ * over images only (see `tokens/emphasis`)
160
161
  */
161
162
  const buttonVariants = cva([
162
163
  "duration-quick text-paragraph-sm isolate inline-flex shrink-0 cursor-pointer items-center gap-2 border font-medium whitespace-nowrap transition ease-out",
@@ -22,6 +22,9 @@ export declare const DEFAULT_PILL_SIZE: ComponentSize;
22
22
  * - `neutral` + `solid` → the dark primary pill (old default/solid)
23
23
  * - `neutral` + `soft` → the grey secondary pill (old secondary/solid)
24
24
  * - `neutral` + `outline` → the bordered transparent pill (old `outline` variant)
25
+ *
26
+ * `neutral` + `transparent` is glass for content over images only (see
27
+ * `tokens/emphasis`).
25
28
  */
26
29
  export declare const pillVariants: (props?: ({
27
30
  tone?: "brand" | "danger" | "info" | "neutral" | "success" | "warning" | null | undefined;
@@ -30,8 +30,15 @@ export const DEFAULT_PILL_SIZE = "base";
30
30
  * - `neutral` + `solid` → the dark primary pill (old default/solid)
31
31
  * - `neutral` + `soft` → the grey secondary pill (old secondary/solid)
32
32
  * - `neutral` + `outline` → the bordered transparent pill (old `outline` variant)
33
+ *
34
+ * `neutral` + `transparent` is glass for content over images only (see
35
+ * `tokens/emphasis`).
33
36
  */
34
- export const pillVariants = cva(cn("inline-flex items-center justify-center border border-transparent font-normal whitespace-nowrap [&_svg]:-ms-px [&_svg]:shrink-0", focusRing(), "data-[hovered=true]:opacity-90"), {
37
+ export const pillVariants = cva(cn("inline-flex items-center justify-center border border-transparent font-normal whitespace-nowrap [&_svg]:-ms-px [&_svg]:shrink-0", focusRing(),
38
+ // Hover tints the fill with a 4% foreground wash laid over it as an image,
39
+ // so the text keeps its colour. 4% is the most every tone and emphasis takes
40
+ // and still reaches AA (styles/tone-contrast.test.ts, PILL_HOVER_WASH).
41
+ "data-[hovered=true]:from-foreground/4 data-[hovered=true]:to-foreground/4 data-[hovered=true]:bg-linear-to-b"), {
35
42
  compoundVariants: [
36
43
  /* ── Focus ring colours by tone ────────────────────────── */
37
44
  {
@@ -65,7 +65,7 @@ export const SEMANTIC_COLORS = [
65
65
  class: "bg-brand-soft",
66
66
  key: "brand-soft",
67
67
  name: "Brand Soft",
68
- value: "#fffef5",
68
+ value: "#fffbd9",
69
69
  },
70
70
  {
71
71
  class: "bg-brand-accent",
@@ -233,7 +233,13 @@
233
233
  --color-info-foreground: #1e3a5f; /* blue-900 */
234
234
 
235
235
  --color-brand: #ffe600; /* Brand yellow, per the Figma base/brand token */
236
- --color-brand-soft: #fffef5; /* very soft brand yellow (code-only) */
236
+ /* Pale brand yellow (code-only), mixed from --color-brand so a re-brand
237
+ carries its soft fill with it: #fffbd9 for the default yellow. */
238
+ --color-brand-soft: color-mix(
239
+ in srgb,
240
+ var(--color-brand) 15%,
241
+ var(--color-white)
242
+ );
237
243
  --color-brand-accent: #dda600; /* per Figma base/brand accent - consumed at /40 for borders/accents */
238
244
  --color-brand-foreground: var(--color-gray-800); /* #1F2937 - per Figma */
239
245
  /* Brand-hued text on the page background, for brand buttons without a fill.
@@ -10,6 +10,11 @@
10
10
  * cva-backed components anchor their variant map `satisfies Record<Emphasis, …>`
11
11
  * so the fill vocabulary stays in lockstep with the canon.
12
12
  *
13
+ * `transparent` is a blurred half fill of the tone. Its brand and status tones
14
+ * are tuned to read on the page. Neutral transparent is glass for
15
+ * content over images: its white text reaches AA over a mid-to-dark photo or a
16
+ * Scrim, but not on the page or a pale image, so keep it to media.
17
+ *
13
18
  * `link` is deliberately NOT a member: it is a Button-only extension expressed
14
19
  * as `ButtonEmphasis = Emphasis | "link"`, so no other component inherits an
15
20
  * inline-link treatment it has no styling for.
@@ -10,6 +10,11 @@
10
10
  * cva-backed components anchor their variant map `satisfies Record<Emphasis, …>`
11
11
  * so the fill vocabulary stays in lockstep with the canon.
12
12
  *
13
+ * `transparent` is a blurred half fill of the tone. Its brand and status tones
14
+ * are tuned to read on the page. Neutral transparent is glass for
15
+ * content over images: its white text reaches AA over a mid-to-dark photo or a
16
+ * Scrim, but not on the page or a pale image, so keep it to media.
17
+ *
13
18
  * `link` is deliberately NOT a member: it is a Button-only extension expressed
14
19
  * as `ButtonEmphasis = Emphasis | "link"`, so no other component inherits an
15
20
  * inline-link treatment it has no styling for.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instruments/materia-ui",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Materia design system: React components, tokens and Tailwind v4 styles.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {