@astryxdesign/theme-stone 0.7.0-canary.e3c1cfd → 0.7.0-canary.e48e2ef

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/source.js CHANGED
@@ -133,6 +133,17 @@ var stoneTheme = (0, import_theme.defineTheme)({
133
133
  fallbacks: '"SF Mono", Monaco, Consolas, monospace'
134
134
  }
135
135
  },
136
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
137
+ // re-derive the ratio so Display 1 keeps its desktop size:
138
+ // ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
139
+ adaptations: {
140
+ rules: [
141
+ {
142
+ when: { pointer: "coarse", width: { below: "lg" } },
143
+ value: { typography: { scale: { base: 16, ratio: 1.2225 } } }
144
+ }
145
+ ]
146
+ },
136
147
  motion: { fast: 125, medium: 300, slow: 700, ratio: 0.75 },
137
148
  syntax: stoneSyntax,
138
149
  tokens: {
package/dist/source.mjs CHANGED
@@ -135,6 +135,17 @@ var stoneTheme = defineTheme({
135
135
  fallbacks: '"SF Mono", Monaco, Consolas, monospace'
136
136
  }
137
137
  },
138
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
139
+ // re-derive the ratio so Display 1 keeps its desktop size:
140
+ // ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
141
+ adaptations: {
142
+ rules: [
143
+ {
144
+ when: { pointer: "coarse", width: { below: "lg" } },
145
+ value: { typography: { scale: { base: 16, ratio: 1.2225 } } }
146
+ }
147
+ ]
148
+ },
138
149
  motion: { fast: 125, medium: 300, slow: 700, ratio: 0.75 },
139
150
  syntax: stoneSyntax,
140
151
  tokens: {
package/dist/stone.js CHANGED
@@ -521,7 +521,24 @@ export const stoneTheme = {
521
521
  "xl": 1280,
522
522
  "2xl": 1536
523
523
  },
524
- "rules": []
524
+ "rules": [
525
+ {
526
+ "when": {
527
+ "pointer": "coarse",
528
+ "width": {
529
+ "below": "lg"
530
+ }
531
+ },
532
+ "value": {
533
+ "typography": {
534
+ "scale": {
535
+ "base": 16,
536
+ "ratio": 1.2225
537
+ }
538
+ }
539
+ }
540
+ }
541
+ ]
525
542
  },
526
543
  __axes: {
527
544
  "typography": {
@@ -1 +1 @@
1
- {"version":3,"file":"stoneTheme.d.ts","sourceRoot":"","sources":["../src/stoneTheme.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,UAAU,yDAiVrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2PhB,CAAC"}
1
+ {"version":3,"file":"stoneTheme.d.ts","sourceRoot":"","sources":["../src/stoneTheme.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,UAAU,yDA6VrB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2PhB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=stoneTheme.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stoneTheme.test.d.ts","sourceRoot":"","sources":["../src/stoneTheme.test.ts"],"names":[],"mappings":""}
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="stone"]) 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; }
@@ -708,6 +649,72 @@
708
649
  }
709
650
  }
710
651
 
652
+ @layer astryx-theme {
653
+ @media (width < 1024px) and (pointer: coarse) {
654
+ @scope ([data-astryx-theme="stone"]) to ([data-astryx-theme]) {
655
+ :scope {
656
+ --font-size-4xs: 0.375rem;
657
+ --font-size-3xs: 0.4375rem;
658
+ --font-size-2xs: 0.5625rem;
659
+ --font-size-xs: 0.6875rem;
660
+ --font-size-sm: 0.8125rem;
661
+ --font-size-base: 1rem;
662
+ --font-size-lg: 1.25rem;
663
+ --font-size-xl: 1.5rem;
664
+ --font-size-2xl: 1.8125rem;
665
+ --font-size-3xl: 2.25rem;
666
+ --font-size-4xl: 2.75rem;
667
+ --font-size-5xl: 3.3125rem;
668
+ --text-heading-1-size: var(--font-size-2xl);
669
+ --text-heading-1-weight: var(--font-weight-semibold);
670
+ --text-heading-1-leading: 1.3793;
671
+ --text-heading-2-size: var(--font-size-xl);
672
+ --text-heading-2-weight: var(--font-weight-semibold);
673
+ --text-heading-2-leading: 1.3333;
674
+ --text-heading-3-size: var(--font-size-lg);
675
+ --text-heading-3-weight: var(--font-weight-bold);
676
+ --text-heading-3-leading: 1.4;
677
+ --text-heading-4-size: var(--font-size-base);
678
+ --text-heading-4-weight: var(--font-weight-bold);
679
+ --text-heading-4-leading: 1.5;
680
+ --text-heading-5-size: var(--font-size-sm);
681
+ --text-heading-5-weight: var(--font-weight-semibold);
682
+ --text-heading-5-leading: 1.5385;
683
+ --text-heading-6-size: var(--font-size-xs);
684
+ --text-heading-6-weight: var(--font-weight-semibold);
685
+ --text-heading-6-leading: 1.4545;
686
+ --text-body-size: var(--font-size-base);
687
+ --text-body-weight: var(--font-weight-normal);
688
+ --text-body-leading: 1.5;
689
+ --text-large-size: var(--font-size-lg);
690
+ --text-large-weight: var(--font-weight-semibold);
691
+ --text-large-leading: 1.4;
692
+ --text-label-size: var(--font-size-base);
693
+ --text-label-weight: var(--font-weight-medium);
694
+ --text-label-leading: 1.5;
695
+ --text-code-size: var(--font-size-base);
696
+ --text-code-weight: var(--font-weight-normal);
697
+ --text-code-leading: 1.5;
698
+ --text-supporting-size: var(--font-size-sm);
699
+ --text-supporting-weight: var(--font-weight-normal);
700
+ --text-supporting-leading: 1.5385;
701
+ --text-display-1-size: var(--font-size-5xl);
702
+ --text-display-1-weight: var(--font-weight-normal);
703
+ --text-display-1-leading: 1.283;
704
+ --text-display-2-size: var(--font-size-4xl);
705
+ --text-display-2-weight: var(--font-weight-normal);
706
+ --text-display-2-leading: 1.2727;
707
+ --text-display-3-size: var(--font-size-3xl);
708
+ --text-display-3-weight: var(--font-weight-normal);
709
+ --text-display-3-leading: 1.2222;
710
+ --font-family-body: Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
711
+ --font-family-heading: Montserrat, "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
712
+ --font-family-code: "JetBrains Mono", "SF Mono", Monaco, Consolas, monospace;
713
+ }
714
+ }
715
+ }
716
+ }
717
+
711
718
  @layer astryx-theme {
712
719
  @scope ([data-astryx-theme="stone"]) to ([data-astryx-theme]) {
713
720
  [data-astryx-media="dark"] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/theme-stone",
3
- "version": "0.7.0-canary.e3c1cfd",
3
+ "version": "0.7.0-canary.e48e2ef",
4
4
  "displayName": "Stone Theme",
5
5
  "private": false,
6
6
  "description": "Warm stone and slate, earthy and understated, with just enough character to feel handcrafted.",
@@ -57,11 +57,11 @@
57
57
  "lucide-react": "^1.18.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "@astryxdesign/core": "0.7.0-canary.e3c1cfd",
60
+ "@astryxdesign/core": "0.7.0-canary.e48e2ef",
61
61
  "react": ">=19"
62
62
  },
63
63
  "devDependencies": {
64
- "@astryxdesign/cli": "0.7.0-canary.e3c1cfd"
64
+ "@astryxdesign/cli": "0.7.0-canary.e48e2ef"
65
65
  },
66
66
  "module": "./dist/source.mjs",
67
67
  "scripts": {
@@ -0,0 +1,25 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ import {describe, expect, it} from 'vitest';
4
+ import {generateThemeCSS} from '@astryxdesign/core/theme';
5
+ import {stoneTheme} from './stoneTheme';
6
+
7
+ describe('stone touch + narrow type pin', () => {
8
+ it('floors body to 16px and holds Display 1 at its desktop size', () => {
9
+ const rule = stoneTheme.__adaptationRules?.[0];
10
+
11
+ expect(stoneTheme.__adaptations.rules).toHaveLength(1);
12
+ expect(rule?.when).toEqual({pointer: 'coarse', width: {below: 'lg'}});
13
+ expect(rule?.query).toBe('(width < 1024px) and (pointer: coarse)');
14
+ // Pinned ladder: base 16 (was 14), ratio 1.25 -> 1.2225, Display 1 pinned.
15
+ expect(rule?.tokens['--font-size-base']).toBe('1rem');
16
+ expect(rule?.tokens['--font-size-lg']).toBe('1.25rem');
17
+ expect(rule?.tokens['--font-size-5xl']).toBe('3.3125rem');
18
+ // Desktop scale is untouched.
19
+ expect(stoneTheme.tokens['--font-size-base']).toBe('0.875rem');
20
+ expect(stoneTheme.tokens['--font-size-5xl']).toBe('3.3125rem');
21
+ expect(generateThemeCSS(stoneTheme).component).toContain(
22
+ '@media (width < 1024px) and (pointer: coarse)',
23
+ );
24
+ });
25
+ });
package/src/stoneTheme.ts CHANGED
@@ -81,6 +81,18 @@ export const stoneTheme = defineTheme({
81
81
  },
82
82
  },
83
83
 
84
+ // Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
85
+ // re-derive the ratio so Display 1 keeps its desktop size:
86
+ // ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
87
+ adaptations: {
88
+ rules: [
89
+ {
90
+ when: {pointer: 'coarse', width: {below: 'lg'}},
91
+ value: {typography: {scale: {base: 16, ratio: 1.2225}}},
92
+ },
93
+ ],
94
+ },
95
+
84
96
  motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
85
97
 
86
98
  syntax: stoneSyntax,