@astryxdesign/theme-neutral 0.7.0-canary.e92e36f → 0.7.0-canary.eaca8eb

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/dist/neutral.js CHANGED
@@ -520,7 +520,24 @@ export const neutralTheme = {
520
520
  "xl": 1280,
521
521
  "2xl": 1536
522
522
  },
523
- "rules": []
523
+ "rules": [
524
+ {
525
+ "when": {
526
+ "pointer": "coarse",
527
+ "width": {
528
+ "below": "lg"
529
+ }
530
+ },
531
+ "value": {
532
+ "typography": {
533
+ "scale": {
534
+ "base": 16,
535
+ "ratio": 1.1736
536
+ }
537
+ }
538
+ }
539
+ }
540
+ ]
524
541
  },
525
542
  __axes: {
526
543
  "typography": {
@@ -1 +1 @@
1
- {"version":3,"file":"neutralTheme.d.ts","sourceRoot":"","sources":["../src/neutralTheme.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,YAAY,yDA2YvB,CAAC"}
1
+ {"version":3,"file":"neutralTheme.d.ts","sourceRoot":"","sources":["../src/neutralTheme.ts"],"names":[],"mappings":"AAqEA,eAAO,MAAM,YAAY,yDAuZvB,CAAC"}
package/dist/source.js CHANGED
@@ -190,6 +190,17 @@ var neutralTheme = (0, import_theme.defineTheme)({
190
190
  fallbacks: '"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
191
191
  }
192
192
  },
193
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
194
+ // re-derive the ratio so Display 1 keeps its desktop size:
195
+ // ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
196
+ adaptations: {
197
+ rules: [
198
+ {
199
+ when: { pointer: "coarse", width: { below: "lg" } },
200
+ value: { typography: { scale: { base: 16, ratio: 1.1736 } } }
201
+ }
202
+ ]
203
+ },
193
204
  // Motion: snappier than default to match shadcn/Tailwind conventions.
194
205
  // Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
195
206
  // medium-min=225ms, medium=300ms, medium-max=400ms.
package/dist/source.mjs CHANGED
@@ -195,6 +195,17 @@ var neutralTheme = defineTheme({
195
195
  fallbacks: '"SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace'
196
196
  }
197
197
  },
198
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
199
+ // re-derive the ratio so Display 1 keeps its desktop size:
200
+ // ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
201
+ adaptations: {
202
+ rules: [
203
+ {
204
+ when: { pointer: "coarse", width: { below: "lg" } },
205
+ value: { typography: { scale: { base: 16, ratio: 1.1736 } } }
206
+ }
207
+ ]
208
+ },
198
209
  // Motion: snappier than default to match shadcn/Tailwind conventions.
199
210
  // Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
200
211
  // medium-min=225ms, medium=300ms, medium-max=400ms.
package/dist/theme.css CHANGED
@@ -6,6 +6,8 @@
6
6
  * Core: @astryxdesign/core@0.7.0
7
7
  */
8
8
 
9
+ @layer reset, astryx-base, astryx-theme;
10
+
9
11
  @layer reset {
10
12
  @scope ([data-astryx-theme="neutral"]) to ([data-astryx-theme]) {
11
13
  :where(h1, h2, h3, h4, h5, h6) {
@@ -77,67 +79,6 @@
77
79
  }
78
80
  }
79
81
 
80
- @layer astryx-base {
81
- :root {
82
- --color-data-categorical-blue: light-dark(#0171E3, #0171E3);
83
- --color-data-categorical-orange: light-dark(#EB6E00, #EB6E00);
84
- --color-data-categorical-purple: light-dark(#6B1EFD, #6B1EFD);
85
- --color-data-categorical-green: light-dark(#0B991F, #0B991F);
86
- --color-data-categorical-pink: light-dark(#F351C0, #F351C0);
87
- --color-data-categorical-cyan: light-dark(#0171A4, #0171A4);
88
- --color-data-categorical-red: light-dark(#F5394F, #F5394F);
89
- --color-data-categorical-teal: light-dark(#08A3A3, #08A3A3);
90
- --color-data-categorical-brown: light-dark(#965E03, #965E03);
91
- --color-data-categorical-indigo: light-dark(#6F8AFF, #6F8AFF);
92
- --color-data-neutral: light-dark(#8494A3, #8C939B);
93
- --color-data-blue-5: light-dark(#02165E, #02165E);
94
- --color-data-blue-4: light-dark(#004CBC, #004CBC);
95
- --color-data-blue-3: light-dark(#2694FE, #2694FE);
96
- --color-data-blue-2: light-dark(#78BEFF, #78BEFF);
97
- --color-data-blue-1: light-dark(#DBECFF, #DBECFF);
98
- --color-data-shamrock-5: light-dark(#0B603D, #0B603D);
99
- --color-data-shamrock-4: light-dark(#138546, #138546);
100
- --color-data-shamrock-3: light-dark(#24BB5E, #24BB5E);
101
- --color-data-shamrock-2: light-dark(#8EF7AA, #8EF7AA);
102
- --color-data-shamrock-1: light-dark(#D6FEE4, #D6FEE4);
103
- --color-data-orange-5: light-dark(#A13F04, #A13F04);
104
- --color-data-orange-4: light-dark(#D66100, #D66100);
105
- --color-data-orange-3: light-dark(#FD9537, #FD9537);
106
- --color-data-orange-2: light-dark(#FDB876, #FDB876);
107
- --color-data-orange-1: light-dark(#FFE6CF, #FFE6CF);
108
- --color-data-pink-5: light-dark(#8E1073, #8E1073);
109
- --color-data-pink-4: light-dark(#D123A1, #D123A1);
110
- --color-data-pink-3: light-dark(#F989D3, #F989D3);
111
- --color-data-pink-2: light-dark(#FEADE3, #FEADE3);
112
- --color-data-pink-1: light-dark(#FCE3F4, #FCE3F4);
113
- --color-data-purple-5: light-dark(#3E0697, #3E0697);
114
- --color-data-purple-4: light-dark(#6B1EFD, #6B1EFD);
115
- --color-data-purple-3: light-dark(#9081FF, #9081FF);
116
- --color-data-purple-2: light-dark(#B3B0FE, #B3B0FE);
117
- --color-data-purple-1: light-dark(#E8E8FB, #E8E8FB);
118
- --color-data-red-5: light-dark(#9D0519, #9D0519);
119
- --color-data-red-4: light-dark(#D31130, #D31130);
120
- --color-data-red-3: light-dark(#FB7D87, #FB7D87);
121
- --color-data-red-2: light-dark(#FFB2B8, #FFB2B8);
122
- --color-data-red-1: light-dark(#FEE4E6, #FEE4E6);
123
- --color-data-teal-5: light-dark(#08767D, #08767D);
124
- --color-data-teal-4: light-dark(#0C9293, #0C9293);
125
- --color-data-teal-3: light-dark(#0DB7AF, #0DB7AF);
126
- --color-data-teal-2: light-dark(#6CE6D8, #6CE6D8);
127
- --color-data-teal-1: light-dark(#D7FCF8, #D7FCF8);
128
- --color-data-yellow-5: light-dark(#8A5001, #8A5001);
129
- --color-data-yellow-4: light-dark(#D69804, #D69804);
130
- --color-data-yellow-3: light-dark(#FBCE03, #FBCE03);
131
- --color-data-yellow-2: light-dark(#FCEC85, #FCEC85);
132
- --color-data-yellow-1: light-dark(#FDF6BA, #FDF6BA);
133
- --color-data-gray-5: light-dark(#25363F, #333338);
134
- --color-data-gray-4: light-dark(#5D6C7B, #666A72);
135
- --color-data-gray-3: light-dark(#AFB9C4, #B2B8BE);
136
- --color-data-gray-2: light-dark(#CCD3DB, #D0D3D6);
137
- --color-data-gray-1: light-dark(#F1F4F7, #F2F4F6);
138
- }
139
- }
140
-
141
82
  @layer astryx-theme {
142
83
  :root { color-scheme: light dark; }
143
84
  html[data-theme="light"] { color-scheme: light; }
@@ -697,6 +638,72 @@
697
638
  }
698
639
  }
699
640
 
641
+ @layer astryx-theme {
642
+ @media (width < 1024px) and (pointer: coarse) {
643
+ @scope ([data-astryx-theme="neutral"]) to ([data-astryx-theme]) {
644
+ :scope {
645
+ --font-size-4xs: 0.4375rem;
646
+ --font-size-3xs: 0.5rem;
647
+ --font-size-2xs: 0.625rem;
648
+ --font-size-xs: 0.75rem;
649
+ --font-size-sm: 0.875rem;
650
+ --font-size-base: 1rem;
651
+ --font-size-lg: 1.1875rem;
652
+ --font-size-xl: 1.375rem;
653
+ --font-size-2xl: 1.625rem;
654
+ --font-size-3xl: 1.875rem;
655
+ --font-size-4xl: 2.25rem;
656
+ --font-size-5xl: 2.625rem;
657
+ --text-heading-1-size: var(--font-size-2xl);
658
+ --text-heading-1-weight: var(--font-weight-semibold);
659
+ --text-heading-1-leading: 1.3846;
660
+ --text-heading-2-size: var(--font-size-xl);
661
+ --text-heading-2-weight: var(--font-weight-semibold);
662
+ --text-heading-2-leading: 1.4545;
663
+ --text-heading-3-size: var(--font-size-lg);
664
+ --text-heading-3-weight: var(--font-weight-bold);
665
+ --text-heading-3-leading: 1.4737;
666
+ --text-heading-4-size: var(--font-size-base);
667
+ --text-heading-4-weight: var(--font-weight-bold);
668
+ --text-heading-4-leading: 1.5;
669
+ --text-heading-5-size: var(--font-size-sm);
670
+ --text-heading-5-weight: var(--font-weight-semibold);
671
+ --text-heading-5-leading: 1.4286;
672
+ --text-heading-6-size: var(--font-size-xs);
673
+ --text-heading-6-weight: var(--font-weight-semibold);
674
+ --text-heading-6-leading: 1.6667;
675
+ --text-body-size: var(--font-size-base);
676
+ --text-body-weight: var(--font-weight-normal);
677
+ --text-body-leading: 1.5;
678
+ --text-large-size: var(--font-size-lg);
679
+ --text-large-weight: var(--font-weight-semibold);
680
+ --text-large-leading: 1.4737;
681
+ --text-label-size: var(--font-size-base);
682
+ --text-label-weight: var(--font-weight-medium);
683
+ --text-label-leading: 1.5;
684
+ --text-code-size: var(--font-size-base);
685
+ --text-code-weight: var(--font-weight-normal);
686
+ --text-code-leading: 1.5;
687
+ --text-supporting-size: var(--font-size-sm);
688
+ --text-supporting-weight: var(--font-weight-normal);
689
+ --text-supporting-leading: 1.4286;
690
+ --text-display-1-size: var(--font-size-5xl);
691
+ --text-display-1-weight: var(--font-weight-normal);
692
+ --text-display-1-leading: 1.2381;
693
+ --text-display-2-size: var(--font-size-4xl);
694
+ --text-display-2-weight: var(--font-weight-normal);
695
+ --text-display-2-leading: 1.2222;
696
+ --text-display-3-size: var(--font-size-3xl);
697
+ --text-display-3-weight: var(--font-weight-normal);
698
+ --text-display-3-leading: 1.4667;
699
+ --font-family-body: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
700
+ --font-family-heading: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
701
+ --font-family-code: ui-monospace, "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
702
+ }
703
+ }
704
+ }
705
+ }
706
+
700
707
  @layer astryx-theme {
701
708
  @scope ([data-astryx-theme="neutral"]) to ([data-astryx-theme]) {
702
709
  [data-astryx-media="dark"] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/theme-neutral",
3
- "version": "0.7.0-canary.e92e36f",
3
+ "version": "0.7.0-canary.eaca8eb",
4
4
  "displayName": "Neutral Theme",
5
5
  "private": false,
6
6
  "description": "Restrained warm grays. Minimal and quiet, so the content stays the focus.",
@@ -58,11 +58,11 @@
58
58
  "lucide-react": "^1.18.0"
59
59
  },
60
60
  "peerDependencies": {
61
- "@astryxdesign/core": "0.7.0-canary.e92e36f",
61
+ "@astryxdesign/core": "0.7.0-canary.eaca8eb",
62
62
  "react": ">=19"
63
63
  },
64
64
  "devDependencies": {
65
- "@astryxdesign/cli": "0.7.0-canary.e92e36f"
65
+ "@astryxdesign/cli": "0.7.0-canary.eaca8eb"
66
66
  },
67
67
  "module": "./dist/source.mjs",
68
68
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  import {describe, expect, it} from 'vitest';
4
+ import {generateThemeCSS} from '@astryxdesign/core/theme';
4
5
  import {neutralPalettes} from './neutralPalettes';
5
6
  import {neutralTheme} from './neutralTheme';
6
7
 
@@ -407,3 +408,23 @@ describe('neutral theme component overrides', () => {
407
408
  });
408
409
  });
409
410
  });
411
+
412
+ describe('neutral touch + narrow type pin', () => {
413
+ it('floors body to 16px and holds Display 1 at its desktop size', () => {
414
+ const rule = neutralTheme.__adaptationRules?.[0];
415
+
416
+ expect(neutralTheme.__adaptations.rules).toHaveLength(1);
417
+ expect(rule?.when).toEqual({pointer: 'coarse', width: {below: 'lg'}});
418
+ expect(rule?.query).toBe('(width < 1024px) and (pointer: coarse)');
419
+ // Pinned ladder: base 16 (was 14), ratio 1.2 -> 1.1736, Display 1 pinned.
420
+ expect(rule?.tokens['--font-size-base']).toBe('1rem');
421
+ expect(rule?.tokens['--font-size-lg']).toBe('1.1875rem');
422
+ expect(rule?.tokens['--font-size-5xl']).toBe('2.625rem');
423
+ // Desktop scale is untouched.
424
+ expect(neutralTheme.tokens['--font-size-base']).toBe('0.875rem');
425
+ expect(neutralTheme.tokens['--font-size-5xl']).toBe('2.625rem');
426
+ expect(generateThemeCSS(neutralTheme).component).toContain(
427
+ '@media (width < 1024px) and (pointer: coarse)',
428
+ );
429
+ });
430
+ });
@@ -95,6 +95,18 @@ export const neutralTheme = defineTheme({
95
95
  },
96
96
  },
97
97
 
98
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
99
+ // re-derive the ratio so Display 1 keeps its desktop size:
100
+ // ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
101
+ adaptations: {
102
+ rules: [
103
+ {
104
+ when: {pointer: 'coarse', width: {below: 'lg'}},
105
+ value: {typography: {scale: {base: 16, ratio: 1.1736}}},
106
+ },
107
+ ],
108
+ },
109
+
98
110
  // Motion: snappier than default to match shadcn/Tailwind conventions.
99
111
  // Produces: fast-min=95ms, fast=125ms, fast-max=165ms,
100
112
  // medium-min=225ms, medium=300ms, medium-max=400ms.