@astryxdesign/cli 0.7.8-canary.96066d7 → 0.7.8-canary.aaacae9
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.8-canary.
|
|
3
|
+
"version": "0.7.8-canary.aaacae9",
|
|
4
4
|
"displayName": "CLI",
|
|
5
5
|
"description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"zod": "^4.4.3"
|
|
125
125
|
},
|
|
126
126
|
"peerDependencies": {
|
|
127
|
-
"@astryxdesign/charts": "0.7.8-canary.
|
|
128
|
-
"@astryxdesign/core": "0.7.8-canary.
|
|
129
|
-
"@astryxdesign/lab": "0.7.8-canary.
|
|
130
|
-
"@astryxdesign/theme-neutral": "0.7.8-canary.
|
|
127
|
+
"@astryxdesign/charts": "0.7.8-canary.aaacae9",
|
|
128
|
+
"@astryxdesign/core": "0.7.8-canary.aaacae9",
|
|
129
|
+
"@astryxdesign/lab": "0.7.8-canary.aaacae9",
|
|
130
|
+
"@astryxdesign/theme-neutral": "0.7.8-canary.aaacae9"
|
|
131
131
|
},
|
|
132
132
|
"peerDependenciesMeta": {
|
|
133
133
|
"@astryxdesign/charts": {
|
|
@@ -144,10 +144,10 @@
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
"devDependencies": {
|
|
147
|
-
"@astryxdesign/charts": "0.7.8-canary.
|
|
148
|
-
"@astryxdesign/core": "0.7.8-canary.
|
|
149
|
-
"@astryxdesign/lab": "0.7.8-canary.
|
|
150
|
-
"@astryxdesign/theme-neutral": "0.7.8-canary.
|
|
147
|
+
"@astryxdesign/charts": "0.7.8-canary.aaacae9",
|
|
148
|
+
"@astryxdesign/core": "0.7.8-canary.aaacae9",
|
|
149
|
+
"@astryxdesign/lab": "0.7.8-canary.aaacae9",
|
|
150
|
+
"@astryxdesign/theme-neutral": "0.7.8-canary.aaacae9",
|
|
151
151
|
"@heroicons/react": "^2.2.0",
|
|
152
152
|
"@stylexjs/stylex": "^0.19.0",
|
|
153
153
|
"@types/babel__core": "^7.20.5",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('@astryxdesign/cli/authoring').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'useLocale',
|
|
7
|
-
name: 'useLocale — Invoice Summary',
|
|
8
|
-
displayName: 'useLocale — Invoice Summary',
|
|
9
|
-
description:
|
|
10
|
-
'An invoice summary that formats its date and amount with Intl using the locale from useLocale, so switching the provider from English to German changes "Nov 2, 2026" and "$1,234.50" to "2. Nov. 2026" and "1.234,50 $" with no second locale source.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
aspectRatio: 4 / 3,
|
|
13
|
-
componentsUsed: [
|
|
14
|
-
'InternationalizationProvider',
|
|
15
|
-
'Card',
|
|
16
|
-
'SegmentedControl',
|
|
17
|
-
'Text',
|
|
18
|
-
'Layout',
|
|
19
|
-
],
|
|
20
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {useState} from 'react';
|
|
6
|
-
import {Card} from '@astryxdesign/core/Card';
|
|
7
|
-
import {InternationalizationProvider, useLocale} from '@astryxdesign/core/i18n';
|
|
8
|
-
import {HStack, VStack} from '@astryxdesign/core/Layout';
|
|
9
|
-
import {
|
|
10
|
-
SegmentedControl,
|
|
11
|
-
SegmentedControlItem,
|
|
12
|
-
} from '@astryxdesign/core/SegmentedControl';
|
|
13
|
-
import {Text} from '@astryxdesign/core/Text';
|
|
14
|
-
|
|
15
|
-
type Locale = 'en' | 'de-DE';
|
|
16
|
-
|
|
17
|
-
const ISSUED_ON = new Date(2026, 10, 2);
|
|
18
|
-
const AMOUNT_DUE = 1234.5;
|
|
19
|
-
|
|
20
|
-
function InvoiceSummary() {
|
|
21
|
-
const locale = useLocale();
|
|
22
|
-
const issuedOn = new Intl.DateTimeFormat(locale, {
|
|
23
|
-
day: 'numeric',
|
|
24
|
-
month: 'short',
|
|
25
|
-
year: 'numeric',
|
|
26
|
-
}).format(ISSUED_ON);
|
|
27
|
-
const amountDue = new Intl.NumberFormat(locale, {
|
|
28
|
-
style: 'currency',
|
|
29
|
-
currency: 'USD',
|
|
30
|
-
}).format(AMOUNT_DUE);
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<VStack gap={1}>
|
|
34
|
-
<HStack justify="between">
|
|
35
|
-
<Text type="body" color="secondary">
|
|
36
|
-
Issued
|
|
37
|
-
</Text>
|
|
38
|
-
<Text type="body">{issuedOn}</Text>
|
|
39
|
-
</HStack>
|
|
40
|
-
<HStack justify="between">
|
|
41
|
-
<Text type="body" color="secondary">
|
|
42
|
-
Amount due
|
|
43
|
-
</Text>
|
|
44
|
-
<Text type="body" weight="bold">
|
|
45
|
-
{amountDue}
|
|
46
|
-
</Text>
|
|
47
|
-
</HStack>
|
|
48
|
-
</VStack>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default function UseLocaleHookUsage() {
|
|
53
|
-
const [locale, setLocale] = useState<Locale>('en');
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<InternationalizationProvider locale={locale}>
|
|
57
|
-
<Card width={320} padding={4}>
|
|
58
|
-
<VStack gap={3}>
|
|
59
|
-
<SegmentedControl
|
|
60
|
-
label="Language"
|
|
61
|
-
value={locale}
|
|
62
|
-
onChange={nextLocale => setLocale(nextLocale as Locale)}
|
|
63
|
-
size="sm">
|
|
64
|
-
<SegmentedControlItem value="en" label="English" />
|
|
65
|
-
<SegmentedControlItem value="de-DE" label="German" />
|
|
66
|
-
</SegmentedControl>
|
|
67
|
-
<InvoiceSummary />
|
|
68
|
-
</VStack>
|
|
69
|
-
</Card>
|
|
70
|
-
</InternationalizationProvider>
|
|
71
|
-
);
|
|
72
|
-
}
|