@astryxdesign/cli 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/README.md +61 -61
- package/api/integration/pack-check.test.mjs +8 -0
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.type.mjs +1 -1
- package/api/theme/build/build.d.mts +0 -1
- package/api/theme/build/build.mjs +4 -29
- package/api/theme/build/family.mjs +1 -1
- package/assets/codemods/transforms/next/__tests__/migrate-field-input-styling.test.mjs +108 -0
- package/assets/codemods/transforms/next/__tests__/preserve-bottom-sheet-content-padding.test.mjs +178 -0
- package/assets/codemods/transforms/next/__tests__/validate-data-token-ownership.test.mjs +84 -0
- package/assets/codemods/transforms/next/index.mjs +24 -0
- package/assets/codemods/transforms/next/migrate-field-input-styling.mjs +198 -0
- package/assets/codemods/transforms/next/preserve-bottom-sheet-content-padding.mjs +242 -0
- package/assets/codemods/transforms/next/validate-data-token-ownership.mjs +102 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/spacing.doc.mjs +2 -2
- package/assets/docs/tree/tokens-data.doc.mjs +2 -2
- package/assets/docs/tree/tokens-spacing.doc.mjs +15 -15
- package/assets/docs/tree/tokens-usage.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorDeadlinePicker.tsx +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorTreeSearch.tsx +1 -1
- package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorClearable.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +2 -2
- package/assets/templates/blocks/components/Selector/SelectorShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorWithSections.tsx +1 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionBasic.tsx +1 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderFormattedValue.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderRangeSlider.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderWithMarks.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -2
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -2
- package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -4
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -1
- package/assets/templates/pages/canvas-editor/page.tsx +2 -2
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +11 -6
- package/assets/templates/pages/table-inbox/page.tsx +3 -1
- package/assets/templates/pages/theme-showcase/page.tsx +2 -2
- package/assets/templates/themes/butter/butterTheme.ts +12 -0
- package/assets/templates/themes/chocolate/chocolateTheme.ts +12 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +14 -14
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +10 -9
- package/assets/templates/themes/neutral/neutralTheme.ts +12 -0
- package/assets/templates/themes/stone/stoneTheme.ts +12 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +10 -10
- package/assets/theme.template.ts +1 -1
- package/clients/cli/commands/build-theme.color-scheme.test.mjs +10 -6
- package/clients/cli/commands/build-theme.data-tokens.test.mjs +23 -75
- package/foundation/discovery/template-needs.mjs +93 -11
- package/foundation/discovery/template-needs.test.mjs +106 -3
- package/foundation/env/package-manager.d.mts +13 -0
- package/foundation/env/package-manager.mjs +106 -63
- package/foundation/response/response-types.doc.mjs +1 -2
- package/package.json +9 -9
|
@@ -44,7 +44,7 @@ export default function TokenizerCreatable() {
|
|
|
44
44
|
onChange={items => setTags(items)}
|
|
45
45
|
hasCreate
|
|
46
46
|
placeholder="Type a tag and press Enter..."
|
|
47
|
-
|
|
47
|
+
containerStyle={{width: 400}}
|
|
48
48
|
/>
|
|
49
49
|
</Stack>
|
|
50
50
|
<Stack direction="vertical" gap={1}>
|
|
@@ -59,7 +59,7 @@ export default function TokenizerCreatable() {
|
|
|
59
59
|
hasCreate
|
|
60
60
|
hasEntriesOnFocus
|
|
61
61
|
placeholder="Search or type a new name..."
|
|
62
|
-
|
|
62
|
+
containerStyle={{width: 400}}
|
|
63
63
|
/>
|
|
64
64
|
</Stack>
|
|
65
65
|
</Stack>
|
|
@@ -40,7 +40,7 @@ export default function TokenizerOverflow() {
|
|
|
40
40
|
value={inlineValue}
|
|
41
41
|
onChange={items => setInlineValue(items)}
|
|
42
42
|
tokenOverflowBehavior="unfocusedInline"
|
|
43
|
-
|
|
43
|
+
containerStyle={{width: 400, maxWidth: 400}}
|
|
44
44
|
/>
|
|
45
45
|
</Stack>
|
|
46
46
|
<Stack direction="vertical" gap={1}>
|
|
@@ -54,7 +54,7 @@ export default function TokenizerOverflow() {
|
|
|
54
54
|
value={layerValue}
|
|
55
55
|
onChange={items => setLayerValue(items)}
|
|
56
56
|
tokenOverflowBehavior="unfocusedLayer"
|
|
57
|
-
|
|
57
|
+
containerStyle={{width: 400, maxWidth: 400}}
|
|
58
58
|
/>
|
|
59
59
|
</Stack>
|
|
60
60
|
</Stack>
|
|
@@ -39,7 +39,7 @@ export default function TokenizerStates() {
|
|
|
39
39
|
value={[users[0], users[2]]}
|
|
40
40
|
onChange={() => {}}
|
|
41
41
|
isDisabled
|
|
42
|
-
|
|
42
|
+
containerStyle={{width: 400}}
|
|
43
43
|
/>
|
|
44
44
|
<Tokenizer
|
|
45
45
|
label="Error message"
|
|
@@ -49,7 +49,7 @@ export default function TokenizerStates() {
|
|
|
49
49
|
onChange={items => setErrorValue(items)}
|
|
50
50
|
isRequired
|
|
51
51
|
status={{type: 'error', message: 'At least one reviewer is required'}}
|
|
52
|
-
|
|
52
|
+
containerStyle={{width: 400}}
|
|
53
53
|
/>
|
|
54
54
|
<Tokenizer
|
|
55
55
|
label="Warning message"
|
|
@@ -61,7 +61,7 @@ export default function TokenizerStates() {
|
|
|
61
61
|
type: 'warning',
|
|
62
62
|
message: 'Consider adding at least 2 approvers',
|
|
63
63
|
}}
|
|
64
|
-
|
|
64
|
+
containerStyle={{width: 400}}
|
|
65
65
|
/>
|
|
66
66
|
<Tokenizer
|
|
67
67
|
label="Success message"
|
|
@@ -70,7 +70,7 @@ export default function TokenizerStates() {
|
|
|
70
70
|
value={successValue}
|
|
71
71
|
onChange={items => setSuccessValue(items)}
|
|
72
72
|
status={{type: 'success', message: 'All required reviewers added'}}
|
|
73
|
-
|
|
73
|
+
containerStyle={{width: 400}}
|
|
74
74
|
/>
|
|
75
75
|
</Stack>
|
|
76
76
|
);
|
|
@@ -231,7 +231,7 @@ export default function ToolbarTableFilter() {
|
|
|
231
231
|
hasClear
|
|
232
232
|
options={field.options}
|
|
233
233
|
value={clauses[field.key] ?? null}
|
|
234
|
-
|
|
234
|
+
controlXstyle={clauses[field.key] != null ? styles.filterFill : undefined}
|
|
235
235
|
onChange={value => setClauses(prev => ({...prev, [field.key]: value}))}
|
|
236
236
|
renderValue={option =>
|
|
237
237
|
`${field.label} is ${option.label ?? option.value}`
|
|
@@ -1153,7 +1153,7 @@ function FilterRow({
|
|
|
1153
1153
|
value={value}
|
|
1154
1154
|
onChange={onChange}
|
|
1155
1155
|
isWheelEnabled={false}
|
|
1156
|
-
|
|
1156
|
+
controlXstyle={styles.filterValue}
|
|
1157
1157
|
/>
|
|
1158
1158
|
</InspectorRow>
|
|
1159
1159
|
);
|
|
@@ -2329,7 +2329,7 @@ export default function CanvasEditor() {
|
|
|
2329
2329
|
// enough for the longest option
|
|
2330
2330
|
// ("100%") to avoid truncation.
|
|
2331
2331
|
width={92}
|
|
2332
|
-
|
|
2332
|
+
controlXstyle={[
|
|
2333
2333
|
styles.toolBarControl,
|
|
2334
2334
|
styles.toolBarTrailing,
|
|
2335
2335
|
]}
|
|
@@ -871,7 +871,7 @@ export default function FormWizardVerticalPage() {
|
|
|
871
871
|
ref={fieldRefs.cover}
|
|
872
872
|
label="Cover image"
|
|
873
873
|
isLabelHidden
|
|
874
|
-
|
|
874
|
+
controlStyle={hasCover ? dropzoneFill : undefined}
|
|
875
875
|
mode="dropzone"
|
|
876
876
|
accept="image/png,image/jpeg"
|
|
877
877
|
maxSize={5 * 1024 * 1024}
|
|
@@ -2084,7 +2084,8 @@ function FilterOverflow({
|
|
|
2084
2084
|
isOpen={isOpen}
|
|
2085
2085
|
onOpenChange={setIsOpen}
|
|
2086
2086
|
label={label}
|
|
2087
|
-
height="hug"
|
|
2087
|
+
height="hug"
|
|
2088
|
+
padding={0}>
|
|
2088
2089
|
{body}
|
|
2089
2090
|
</BottomSheet>
|
|
2090
2091
|
</>
|
|
@@ -3249,7 +3250,7 @@ export default function TableFilterTemplate() {
|
|
|
3249
3250
|
renderValue={option =>
|
|
3250
3251
|
`${field.label} ${field.operatorLabel} ${option.label ?? option.value}`
|
|
3251
3252
|
}
|
|
3252
|
-
|
|
3253
|
+
controlXstyle={active ? styles.filterFill : undefined}
|
|
3253
3254
|
onChange={next =>
|
|
3254
3255
|
setFieldFilter(
|
|
3255
3256
|
field.key,
|
|
@@ -3318,7 +3319,7 @@ export default function TableFilterTemplate() {
|
|
|
3318
3319
|
}
|
|
3319
3320
|
options={[...field.options]}
|
|
3320
3321
|
value={multiValues[field.key]}
|
|
3321
|
-
|
|
3322
|
+
controlXstyle={
|
|
3322
3323
|
multiValues[field.key].length > 0 ? styles.filterFill : undefined
|
|
3323
3324
|
}
|
|
3324
3325
|
onChange={next => setMultiValues(field.key, next)}
|
|
@@ -3341,7 +3342,7 @@ export default function TableFilterTemplate() {
|
|
|
3341
3342
|
value={quoteDraft}
|
|
3342
3343
|
onChange={commitQuote}
|
|
3343
3344
|
contentXstyle={styles.quotePopover}
|
|
3344
|
-
|
|
3345
|
+
controlXstyle={hasQuoteFilter ? styles.filterFill : undefined}>
|
|
3345
3346
|
{(range, onChange, close) => (
|
|
3346
3347
|
<VStack gap={4}>
|
|
3347
3348
|
<VStack gap={0}>
|
|
@@ -4087,7 +4088,10 @@ export default function TableFilterTemplate() {
|
|
|
4087
4088
|
isOpen={isCompactSurface && isViewOpen}
|
|
4088
4089
|
onOpenChange={setIsViewOpen}
|
|
4089
4090
|
label="View options"
|
|
4090
|
-
height="tall"
|
|
4091
|
+
height="tall"
|
|
4092
|
+
// The tab strip compensates against a container inset, so the sheet
|
|
4093
|
+
// publishes none and the wrapper below owns the top band.
|
|
4094
|
+
padding={0}>
|
|
4091
4095
|
{/* The inset is the wrapper's, so the strip's own box starts at the tab
|
|
4092
4096
|
row and its scroll arrow lands on the tabs rather than above them. */}
|
|
4093
4097
|
<VStack gap={0} paddingBlockStart={SHEET_TOP_INSET}>
|
|
@@ -4313,7 +4317,8 @@ export default function TableFilterTemplate() {
|
|
|
4313
4317
|
isOpen={isCompactSurface && activeJob != null}
|
|
4314
4318
|
onOpenChange={open => !open && setActiveJobId(null)}
|
|
4315
4319
|
label="Job details"
|
|
4316
|
-
height="tall"
|
|
4320
|
+
height="tall"
|
|
4321
|
+
padding={0}>
|
|
4317
4322
|
{detailBody}
|
|
4318
4323
|
</BottomSheet>
|
|
4319
4324
|
);
|
|
@@ -1773,7 +1773,9 @@ function ComposeWindow({
|
|
|
1773
1773
|
// cheaper answer to the same problem: there is not much to drag out of
|
|
1774
1774
|
// the way in the first place.
|
|
1775
1775
|
height="hug"
|
|
1776
|
-
hasScrim={false}
|
|
1776
|
+
hasScrim={false}
|
|
1777
|
+
// The Layout below owns the inset; the sheet adds none of its own.
|
|
1778
|
+
padding={0}>
|
|
1777
1779
|
{/* The grab handle floats over the top edge, out of flow, about 12px
|
|
1778
1780
|
down. The Layout's own padding is not quite enough to clear it — the
|
|
1779
1781
|
heading came up level with the pill, four pixels under it — so the
|
|
@@ -500,7 +500,7 @@ function StorePreview({
|
|
|
500
500
|
max={99}
|
|
501
501
|
size="sm"
|
|
502
502
|
width={72}
|
|
503
|
-
|
|
503
|
+
controlStyle={styles.quantityInput}
|
|
504
504
|
/>
|
|
505
505
|
<Button
|
|
506
506
|
label="Add to cart"
|
|
@@ -1143,7 +1143,7 @@ function InventoryCard({
|
|
|
1143
1143
|
value=""
|
|
1144
1144
|
onChange={() => {}}
|
|
1145
1145
|
startIcon={<Search size={16} />}
|
|
1146
|
-
|
|
1146
|
+
controlStyle={styles.searchInput}
|
|
1147
1147
|
/>
|
|
1148
1148
|
<OverflowList
|
|
1149
1149
|
gap={2}
|
|
@@ -65,6 +65,18 @@ export const butterTheme = defineTheme({
|
|
|
65
65
|
},
|
|
66
66
|
},
|
|
67
67
|
|
|
68
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
69
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
70
|
+
// ratio' = 1.25 * (14/16)^(1/6) ~= 1.2225. Body 14 -> 16px, display-1 stays 53px.
|
|
71
|
+
adaptations: {
|
|
72
|
+
rules: [
|
|
73
|
+
{
|
|
74
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
75
|
+
value: {typography: {scale: {base: 16, ratio: 1.2225}}},
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
|
|
68
80
|
motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
|
|
69
81
|
|
|
70
82
|
syntax: butterSyntax,
|
|
@@ -55,6 +55,18 @@ export const chocolateTheme = defineTheme({
|
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
+
// Touch + narrow (Mobile Type, Pin): floor base to the 16px floor and
|
|
59
|
+
// re-derive the ratio so Display 1 keeps its desktop size:
|
|
60
|
+
// ratio' = 1.2 * (14/16)^(1/6) ~= 1.1736. Body 14 -> 16px, display-1 stays 42px.
|
|
61
|
+
adaptations: {
|
|
62
|
+
rules: [
|
|
63
|
+
{
|
|
64
|
+
when: {pointer: 'coarse', width: {below: 'lg'}},
|
|
65
|
+
value: {typography: {scale: {base: 16, ratio: 1.1736}}},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
|
|
58
70
|
motion: {fast: 125, medium: 300, slow: 700, ratio: 0.75},
|
|
59
71
|
|
|
60
72
|
syntax: chocolateSyntax,
|
|
@@ -180,20 +180,20 @@ export const matchaTheme = defineTheme({
|
|
|
180
180
|
// =========================================================================
|
|
181
181
|
// Spacing
|
|
182
182
|
// =========================================================================
|
|
183
|
-
'--spacing-0-5': '
|
|
184
|
-
'--spacing-1': '
|
|
185
|
-
'--spacing-1-5': '
|
|
186
|
-
'--spacing-2': '
|
|
187
|
-
'--spacing-3': '
|
|
188
|
-
'--spacing-4': '
|
|
189
|
-
'--spacing-5': '
|
|
190
|
-
'--spacing-6': '
|
|
191
|
-
'--spacing-7': '
|
|
192
|
-
'--spacing-8': '
|
|
193
|
-
'--spacing-9': '
|
|
194
|
-
'--spacing-10': '
|
|
195
|
-
'--spacing-11': '
|
|
196
|
-
'--spacing-12': '
|
|
183
|
+
'--spacing-0-5': '0.1875rem',
|
|
184
|
+
'--spacing-1': '0.375rem',
|
|
185
|
+
'--spacing-1-5': '0.5625rem',
|
|
186
|
+
'--spacing-2': '0.75rem',
|
|
187
|
+
'--spacing-3': '1.125rem',
|
|
188
|
+
'--spacing-4': '1.5rem',
|
|
189
|
+
'--spacing-5': '1.875rem',
|
|
190
|
+
'--spacing-6': '2.25rem',
|
|
191
|
+
'--spacing-7': '2.625rem',
|
|
192
|
+
'--spacing-8': '3rem',
|
|
193
|
+
'--spacing-9': '3.375rem',
|
|
194
|
+
'--spacing-10': '3.75rem',
|
|
195
|
+
'--spacing-11': '4.125rem',
|
|
196
|
+
'--spacing-12': '4.5rem',
|
|
197
197
|
|
|
198
198
|
// =========================================================================
|
|
199
199
|
// Radius — soft and rounded
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
-
// Generated from
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Generated from the committed full palette for the stops used by Neutral's
|
|
4
|
+
// theme source. Regenerate with `pnpm generate:neutral-palette-refs`.
|
|
5
|
+
// Keep the complete palette available for authoring and audits without
|
|
6
|
+
// making consumers pay for unused palette stops.
|
|
6
7
|
// prettier-ignore
|
|
7
8
|
export const neutralPaletteRefs = {
|
|
8
9
|
purple: {
|
|
@@ -10,11 +11,11 @@ export const neutralPaletteRefs = {
|
|
|
10
11
|
dark: {25: '#4a2f51', 80: '#eaacf8'},
|
|
11
12
|
},
|
|
12
13
|
green: {
|
|
13
|
-
light: {25: '#00490b', 30: '#0b5615',
|
|
14
|
+
light: {25: '#00490b', 30: '#0b5615', 45: '#2f7d33', 65: '#6ab26b', 75: '#90ca90', 80: '#a4d6a3'},
|
|
14
15
|
dark: {25: '#2b422b', 80: '#aad4a9', 85: '#bce0bb'},
|
|
15
16
|
},
|
|
16
17
|
neutral: {
|
|
17
|
-
light: {0: '#000000', 5: '#111111', 10: '#1b1b1b',
|
|
18
|
+
light: {0: '#000000', 5: '#111111', 10: '#1b1b1b', 30: '#474747', 45: '#6a6a6a', 60: '#919191', 85: '#d4d4d4', 90: '#e2e2e2', 95: '#f1f1f1', 100: '#ffffff'},
|
|
18
19
|
dark: {0: '#000000', 5: '#111111', 10: '#1b1b1b', 15: '#262626', 20: '#303030', 35: '#525252', 65: '#9e9e9e', 85: '#d4d4d4', 90: '#e2e2e2', 95: '#f1f1f1', 100: '#ffffff'},
|
|
19
20
|
},
|
|
20
21
|
orange: {
|
|
@@ -26,11 +27,11 @@ export const neutralPaletteRefs = {
|
|
|
26
27
|
dark: {25: '#253c5a', 65: '#5aa0f8', 75: '#88bcff', 80: '#a1caff'},
|
|
27
28
|
},
|
|
28
29
|
red: {
|
|
29
|
-
light: {25: '#76000c', 30: '#8a0011',
|
|
30
|
+
light: {25: '#76000c', 30: '#8a0011', 55: '#de4745', 65: '#fa6762', 70: '#ff7f77', 80: '#ffaea7', 85: '#ffc4be'},
|
|
30
31
|
dark: {25: '#5b2b28', 65: '#ee736c', 75: '#ff9890', 80: '#ffaea7', 85: '#ffc4be'},
|
|
31
32
|
},
|
|
32
33
|
yellow: {
|
|
33
|
-
light: {25: '#4b3900', 30: '#584400',
|
|
34
|
+
light: {25: '#4b3900', 30: '#584400', 65: '#c29900', 75: '#e2b623', 80: '#eec448', 85: '#f8d36a'},
|
|
34
35
|
dark: {25: '#453a1c', 80: '#e3c36c', 90: '#fae19e'},
|
|
35
36
|
},
|
|
36
37
|
teal: {
|
|
@@ -39,10 +40,10 @@ export const neutralPaletteRefs = {
|
|
|
39
40
|
},
|
|
40
41
|
cyan: {
|
|
41
42
|
dark: {25: '#274046', 65: '#49adc4', 75: '#71c7dd', 80: '#85d5e9', 85: '#9ae2f4'},
|
|
42
|
-
light: {25: '#004351'
|
|
43
|
+
light: {25: '#004351'},
|
|
43
44
|
},
|
|
44
45
|
pink: {
|
|
45
|
-
light: {25: '#70003f',
|
|
46
|
+
light: {25: '#70003f', 70: '#fc78b1', 85: '#ffc0d7'},
|
|
46
47
|
dark: {25: '#572b3d', 75: '#fd92bd', 80: '#ffa9ca'},
|
|
47
48
|
},
|
|
48
49
|
} as const;
|
|
@@ -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.
|
|
@@ -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,
|
|
@@ -63,16 +63,16 @@ export const y2kTheme = defineTheme({
|
|
|
63
63
|
// =========================================================================
|
|
64
64
|
// Spacing — comfortable preset (base=6)
|
|
65
65
|
// =========================================================================
|
|
66
|
-
'--spacing-0-5': '
|
|
67
|
-
'--spacing-1': '
|
|
68
|
-
'--spacing-1-5': '
|
|
69
|
-
'--spacing-2': '
|
|
70
|
-
'--spacing-3': '
|
|
71
|
-
'--spacing-4': '
|
|
72
|
-
'--spacing-5': '
|
|
73
|
-
'--spacing-6': '
|
|
74
|
-
'--spacing-7': '
|
|
75
|
-
'--spacing-8': '
|
|
66
|
+
'--spacing-0-5': '0.1875rem',
|
|
67
|
+
'--spacing-1': '0.375rem',
|
|
68
|
+
'--spacing-1-5': '0.5625rem',
|
|
69
|
+
'--spacing-2': '0.75rem',
|
|
70
|
+
'--spacing-3': '1.125rem',
|
|
71
|
+
'--spacing-4': '1.5rem',
|
|
72
|
+
'--spacing-5': '1.875rem',
|
|
73
|
+
'--spacing-6': '2.25rem',
|
|
74
|
+
'--spacing-7': '2.625rem',
|
|
75
|
+
'--spacing-8': '3rem',
|
|
76
76
|
|
|
77
77
|
// Size — comfortable preset
|
|
78
78
|
'--size-element-sm': '32px',
|
package/assets/theme.template.ts
CHANGED
|
@@ -373,7 +373,7 @@ export const myTheme = defineTheme({
|
|
|
373
373
|
// {
|
|
374
374
|
// // Narrow at every pointer precision.
|
|
375
375
|
// when: {width: {below: 'md'}},
|
|
376
|
-
// value: {tokens: {'--spacing-4': '
|
|
376
|
+
// value: {tokens: {'--spacing-4': '0.75rem'}},
|
|
377
377
|
// },
|
|
378
378
|
// {
|
|
379
379
|
// // Taller controls under a finger or stylus at every width.
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* html[data-theme="dark"] { color-scheme: dark; }
|
|
18
18
|
*
|
|
19
19
|
* Themes that never use `light-dark()` have no `color-scheme` ambiguity to
|
|
20
|
-
* resolve, so none of the three rules should be emitted for them
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* resolve, so none of the three rules should be emitted for them. Canonical data
|
|
21
|
+
* defaults come from StyleX rather than theme output, so this decision continues
|
|
22
|
+
* to read only the theme's authored values.
|
|
23
23
|
*
|
|
24
24
|
* Building `astryx theme build` requires a compiled @astryxdesign/core (there is no in-CLI
|
|
25
25
|
* fallback generator), so this suite builds core once in beforeAll via the
|
|
@@ -35,8 +35,10 @@ import {ensureCoreBuilt} from './ensure-core-built.mjs';
|
|
|
35
35
|
import {runCli} from '../../../test-utils/run-cli.mjs';
|
|
36
36
|
|
|
37
37
|
const COLOR_SCHEME_ROOT_DECL = ':root { color-scheme: light dark; }';
|
|
38
|
-
const COLOR_SCHEME_LIGHT_DECL =
|
|
39
|
-
|
|
38
|
+
const COLOR_SCHEME_LIGHT_DECL =
|
|
39
|
+
'html[data-theme="light"] { color-scheme: light; }';
|
|
40
|
+
const COLOR_SCHEME_DARK_DECL =
|
|
41
|
+
'html[data-theme="dark"] { color-scheme: dark; }';
|
|
40
42
|
|
|
41
43
|
function writeTheme(dir, name, tokens) {
|
|
42
44
|
fs.mkdirSync(dir, {recursive: true});
|
|
@@ -58,7 +60,9 @@ beforeAll(() => {
|
|
|
58
60
|
|
|
59
61
|
let tmpDir;
|
|
60
62
|
beforeEach(() => {
|
|
61
|
-
tmpDir = fs.mkdtempSync(
|
|
63
|
+
tmpDir = fs.mkdtempSync(
|
|
64
|
+
path.join(os.tmpdir(), 'astryx-build-theme-color-scheme-'),
|
|
65
|
+
);
|
|
62
66
|
});
|
|
63
67
|
afterEach(() => {
|
|
64
68
|
fs.rmSync(tmpDir, {recursive: true, force: true});
|