@astryxdesign/cli 0.7.8-canary.b35fe83 → 0.7.8-canary.b87922f
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.
|
@@ -0,0 +1,14 @@
|
|
|
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: 'useClipboard',
|
|
7
|
+
name: 'useClipboard — Share Link',
|
|
8
|
+
displayName: 'useClipboard — Share Link',
|
|
9
|
+
description:
|
|
10
|
+
'A share card that copies its invite link with useClipboard: the Copy button reads "Copied" while isCopied is true, a screen reader hears "Link copied", and a second press restarts the reset timer.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['Card', 'Button', 'TextInput', 'Text', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
6
|
+
import {Card} from '@astryxdesign/core/Card';
|
|
7
|
+
import {useClipboard} from '@astryxdesign/core/hooks';
|
|
8
|
+
import {HStack, StackItem, VStack} from '@astryxdesign/core/Layout';
|
|
9
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
10
|
+
import {TextInput} from '@astryxdesign/core/TextInput';
|
|
11
|
+
|
|
12
|
+
const INVITE_LINK = 'https://example.com/invite/q7x2k9';
|
|
13
|
+
|
|
14
|
+
export default function UseClipboardHookUsage() {
|
|
15
|
+
const {copy, isCopied} = useClipboard({announce: 'Link copied'});
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Card width={420} padding={4}>
|
|
19
|
+
<VStack gap={3}>
|
|
20
|
+
<Text type="body" weight="bold">
|
|
21
|
+
Share
|
|
22
|
+
</Text>
|
|
23
|
+
<HStack gap={2} vAlign="end">
|
|
24
|
+
<StackItem size="fill">
|
|
25
|
+
<TextInput label="Invite link" value={INVITE_LINK} isReadOnly />
|
|
26
|
+
</StackItem>
|
|
27
|
+
<Button
|
|
28
|
+
label={isCopied ? 'Copied' : 'Copy'}
|
|
29
|
+
onClick={() => void copy(INVITE_LINK)}
|
|
30
|
+
/>
|
|
31
|
+
</HStack>
|
|
32
|
+
</VStack>
|
|
33
|
+
</Card>
|
|
34
|
+
);
|
|
35
|
+
}
|
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.b87922f",
|
|
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.b87922f",
|
|
128
|
+
"@astryxdesign/core": "0.7.8-canary.b87922f",
|
|
129
|
+
"@astryxdesign/lab": "0.7.8-canary.b87922f",
|
|
130
|
+
"@astryxdesign/theme-neutral": "0.7.8-canary.b87922f"
|
|
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.b87922f",
|
|
148
|
+
"@astryxdesign/core": "0.7.8-canary.b87922f",
|
|
149
|
+
"@astryxdesign/lab": "0.7.8-canary.b87922f",
|
|
150
|
+
"@astryxdesign/theme-neutral": "0.7.8-canary.b87922f",
|
|
151
151
|
"@heroicons/react": "^2.2.0",
|
|
152
152
|
"@stylexjs/stylex": "^0.19.0",
|
|
153
153
|
"@types/babel__core": "^7.20.5",
|