@astryxdesign/cli 0.5.2-canary.c9c8564 → 0.5.2-canary.e4f7677
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/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.doc.mjs +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBasic.tsx +2 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.doc.mjs +14 -0
- package/assets/templates/blocks/components/ContextMenu/ContextMenuBottomSheet.tsx +59 -0
- package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/ContextMenu/ContextMenuShowcase.tsx +2 -1
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.doc.mjs +15 -0
- package/assets/templates/blocks/components/DropdownMenu/DropdownMenuBottomSheet.tsx +49 -0
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.doc.mjs +14 -0
- package/assets/templates/blocks/components/MoreMenu/MoreMenuBottomSheet.tsx +63 -0
- package/assets/templates/blocks/components/MultiSelector/MultiSelectorBottomSheet.doc.mjs +15 -0
- package/assets/templates/blocks/components/MultiSelector/MultiSelectorBottomSheet.tsx +26 -0
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.doc.mjs +22 -0
- package/assets/templates/blocks/components/Popover/PopoverBottomSheetAlternative.tsx +71 -0
- package/assets/templates/blocks/components/Selector/SelectorBottomSheet.doc.mjs +15 -0
- package/assets/templates/blocks/components/Selector/SelectorBottomSheet.tsx +30 -0
- package/package.json +9 -9
|
@@ -7,7 +7,7 @@ export const doc = {
|
|
|
7
7
|
name: 'ContextMenu — Basic',
|
|
8
8
|
displayName: 'ContextMenu — Basic',
|
|
9
9
|
description:
|
|
10
|
-
'
|
|
10
|
+
'An adaptive context area: long-press opens a BottomSheet on compact touch screens, while right-click opens a cursor-positioned menu elsewhere.',
|
|
11
11
|
isReady: true,
|
|
12
12
|
aspectRatio: 16 / 9,
|
|
13
13
|
componentsUsed: ['ContextMenu'],
|
|
@@ -7,6 +7,7 @@ import {ContextMenu} from '@astryxdesign/core/ContextMenu';
|
|
|
7
7
|
export default function ContextMenuBasic() {
|
|
8
8
|
return (
|
|
9
9
|
<ContextMenu
|
|
10
|
+
presentation="adaptive"
|
|
10
11
|
items={[
|
|
11
12
|
{label: 'Cut', onClick: () => {}},
|
|
12
13
|
{label: 'Copy', onClick: () => {}},
|
|
@@ -25,7 +26,7 @@ export default function ContextMenuBasic() {
|
|
|
25
26
|
color: '#6b7280',
|
|
26
27
|
userSelect: 'none',
|
|
27
28
|
}}>
|
|
28
|
-
|
|
29
|
+
Long-press or right-click this area
|
|
29
30
|
</div>
|
|
30
31
|
</ContextMenu>
|
|
31
32
|
);
|
|
@@ -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: 'ContextMenu',
|
|
7
|
+
name: 'ContextMenu — Bottom Sheet',
|
|
8
|
+
displayName: 'ContextMenu — Bottom Sheet',
|
|
9
|
+
description:
|
|
10
|
+
'A ContextMenu using the explicit BottomSheet presentation. Long-press the target on touch devices or right-click it with a pointer. Keep a visible menu trigger for important mobile actions.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['ContextMenu'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
DocumentDuplicateIcon,
|
|
7
|
+
PencilIcon,
|
|
8
|
+
ShareIcon,
|
|
9
|
+
TrashIcon,
|
|
10
|
+
} from '@heroicons/react/24/outline';
|
|
11
|
+
import {ContextMenu} from '@astryxdesign/core/ContextMenu';
|
|
12
|
+
|
|
13
|
+
export default function ContextMenuBottomSheet() {
|
|
14
|
+
return (
|
|
15
|
+
<ContextMenu
|
|
16
|
+
presentation="bottom-sheet"
|
|
17
|
+
label="Document actions"
|
|
18
|
+
items={[
|
|
19
|
+
{
|
|
20
|
+
label: 'Rename document',
|
|
21
|
+
description: 'Change the title shown to collaborators.',
|
|
22
|
+
icon: PencilIcon,
|
|
23
|
+
onClick: () => {},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: 'Duplicate document',
|
|
27
|
+
description: 'Create a copy in the same workspace.',
|
|
28
|
+
icon: DocumentDuplicateIcon,
|
|
29
|
+
onClick: () => {},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Share document',
|
|
33
|
+
description: 'Invite people or copy a share link.',
|
|
34
|
+
icon: ShareIcon,
|
|
35
|
+
onClick: () => {},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'Delete document',
|
|
39
|
+
description: 'Move this document to the trash.',
|
|
40
|
+
icon: TrashIcon,
|
|
41
|
+
variant: 'destructive',
|
|
42
|
+
onClick: () => {},
|
|
43
|
+
},
|
|
44
|
+
]}>
|
|
45
|
+
<div
|
|
46
|
+
style={{
|
|
47
|
+
display: 'flex',
|
|
48
|
+
flexDirection: 'column',
|
|
49
|
+
gap: '8px',
|
|
50
|
+
padding: '32px',
|
|
51
|
+
border: '1px solid #d1d5db',
|
|
52
|
+
borderRadius: '12px',
|
|
53
|
+
}}>
|
|
54
|
+
<strong>Quarterly plan</strong>
|
|
55
|
+
<span>Long-press on touch or right-click for document actions.</span>
|
|
56
|
+
</div>
|
|
57
|
+
</ContextMenu>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -6,7 +6,7 @@ export const doc = {
|
|
|
6
6
|
name: 'ContextMenu',
|
|
7
7
|
displayName: 'Context Menu',
|
|
8
8
|
description:
|
|
9
|
-
'
|
|
9
|
+
'An adaptive context area that supports long-press on compact touch screens and right-click elsewhere.',
|
|
10
10
|
isReady: true,
|
|
11
11
|
isShowcase: true,
|
|
12
12
|
aspectRatio: 1,
|
|
@@ -6,6 +6,7 @@ import {ContextMenu} from '@astryxdesign/core/ContextMenu';
|
|
|
6
6
|
export default function ContextMenuShowcase() {
|
|
7
7
|
return (
|
|
8
8
|
<ContextMenu
|
|
9
|
+
presentation="adaptive"
|
|
9
10
|
items={[
|
|
10
11
|
{label: 'Cut', onClick: () => {}},
|
|
11
12
|
{label: 'Copy', onClick: () => {}},
|
|
@@ -22,7 +23,7 @@ export default function ContextMenuShowcase() {
|
|
|
22
23
|
color: '#6b7280',
|
|
23
24
|
userSelect: 'none',
|
|
24
25
|
}}>
|
|
25
|
-
|
|
26
|
+
Long-press or right-click this area
|
|
26
27
|
</div>
|
|
27
28
|
</ContextMenu>
|
|
28
29
|
);
|
|
@@ -0,0 +1,15 @@
|
|
|
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: 'DropdownMenu',
|
|
7
|
+
alsoExampleFor: ['BottomSheet', 'useMediaQuery'],
|
|
8
|
+
name: 'DropdownMenu — Adaptive presentation',
|
|
9
|
+
displayName: 'DropdownMenu — Adaptive presentation',
|
|
10
|
+
description:
|
|
11
|
+
'Chooses a bottom sheet for compact touch surfaces and an anchored popover otherwise. The media query is product policy, while DropdownMenu owns both presentations.',
|
|
12
|
+
isReady: true,
|
|
13
|
+
aspectRatio: 3 / 4,
|
|
14
|
+
componentsUsed: ['DropdownMenu', 'Stack', 'Text', 'useMediaQuery'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {
|
|
7
|
+
ArchiveBoxIcon,
|
|
8
|
+
DocumentDuplicateIcon,
|
|
9
|
+
PencilIcon,
|
|
10
|
+
ShareIcon,
|
|
11
|
+
} from '@heroicons/react/24/outline';
|
|
12
|
+
import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';
|
|
13
|
+
import {VStack} from '@astryxdesign/core/Stack';
|
|
14
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
15
|
+
import {useMediaQuery} from '@astryxdesign/core/hooks';
|
|
16
|
+
|
|
17
|
+
const COMPACT_TOUCH_QUERY =
|
|
18
|
+
'(max-width: 639px) and (pointer: coarse) and (hover: none)';
|
|
19
|
+
|
|
20
|
+
const ACTIONS = [
|
|
21
|
+
{label: 'Edit project', icon: PencilIcon},
|
|
22
|
+
{label: 'Duplicate project', icon: DocumentDuplicateIcon},
|
|
23
|
+
{label: 'Share project', icon: ShareIcon},
|
|
24
|
+
{label: 'Archive project', icon: ArchiveBoxIcon},
|
|
25
|
+
] as const;
|
|
26
|
+
|
|
27
|
+
export default function DropdownMenuBottomSheet() {
|
|
28
|
+
const [lastAction, setLastAction] = useState<string | null>(null);
|
|
29
|
+
const isCompactTouchSurface = useMediaQuery(COMPACT_TOUCH_QUERY);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<VStack gap={3}>
|
|
33
|
+
<DropdownMenu
|
|
34
|
+
button={{label: 'Project actions'}}
|
|
35
|
+
presentation={isCompactTouchSurface ? 'bottom-sheet' : 'popover'}
|
|
36
|
+
items={ACTIONS.map(({label, icon}) => ({
|
|
37
|
+
label,
|
|
38
|
+
icon,
|
|
39
|
+
onClick: () => setLastAction(label),
|
|
40
|
+
}))}
|
|
41
|
+
/>
|
|
42
|
+
{lastAction && (
|
|
43
|
+
<Text type="supporting" color="secondary">
|
|
44
|
+
Last action: {lastAction}
|
|
45
|
+
</Text>
|
|
46
|
+
)}
|
|
47
|
+
</VStack>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -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: 'MoreMenu',
|
|
7
|
+
name: 'MoreMenu — Bottom Sheet',
|
|
8
|
+
displayName: 'MoreMenu — Bottom Sheet',
|
|
9
|
+
description:
|
|
10
|
+
'A visible overflow trigger that opens actions in a BottomSheet. Use this presentation for short action sets on compact touch surfaces.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: ['MoreMenu'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
DocumentDuplicateIcon,
|
|
7
|
+
PencilIcon,
|
|
8
|
+
ShareIcon,
|
|
9
|
+
TrashIcon,
|
|
10
|
+
} from '@heroicons/react/24/outline';
|
|
11
|
+
import {MoreMenu} from '@astryxdesign/core/MoreMenu';
|
|
12
|
+
|
|
13
|
+
export default function MoreMenuBottomSheet() {
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
style={{
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
gap: '16px',
|
|
21
|
+
width: 'min(100%, 360px)',
|
|
22
|
+
padding: '16px',
|
|
23
|
+
border: '1px solid #d1d5db',
|
|
24
|
+
borderRadius: '12px',
|
|
25
|
+
}}>
|
|
26
|
+
<div style={{display: 'flex', flexDirection: 'column', gap: '4px'}}>
|
|
27
|
+
<strong>Quarterly plan</strong>
|
|
28
|
+
<span>Updated a few minutes ago</span>
|
|
29
|
+
</div>
|
|
30
|
+
<MoreMenu
|
|
31
|
+
presentation="bottom-sheet"
|
|
32
|
+
label="Project actions"
|
|
33
|
+
items={[
|
|
34
|
+
{
|
|
35
|
+
label: 'Rename project',
|
|
36
|
+
description: 'Update the project title.',
|
|
37
|
+
icon: PencilIcon,
|
|
38
|
+
onClick: () => {},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Duplicate project',
|
|
42
|
+
description: 'Create a copy in this workspace.',
|
|
43
|
+
icon: DocumentDuplicateIcon,
|
|
44
|
+
onClick: () => {},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Share project',
|
|
48
|
+
description: 'Invite people to collaborate.',
|
|
49
|
+
icon: ShareIcon,
|
|
50
|
+
onClick: () => {},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: 'Delete project',
|
|
54
|
+
description: 'Move this project to the trash.',
|
|
55
|
+
icon: TrashIcon,
|
|
56
|
+
variant: 'destructive',
|
|
57
|
+
onClick: () => {},
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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: 'MultiSelector',
|
|
7
|
+
alsoExampleFor: ['BottomSheet'],
|
|
8
|
+
name: 'MultiSelector — Bottom Sheet',
|
|
9
|
+
displayName: 'MultiSelector — Bottom Sheet',
|
|
10
|
+
description:
|
|
11
|
+
'Keeps a multi-selection list open in a bottom sheet while choices are toggled.',
|
|
12
|
+
isReady: true,
|
|
13
|
+
aspectRatio: 3 / 4,
|
|
14
|
+
componentsUsed: ['MultiSelector'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {MultiSelector} from '@astryxdesign/core/MultiSelector';
|
|
7
|
+
|
|
8
|
+
const OPTIONS = ['Design', 'Engineering', 'Marketing', 'Operations'];
|
|
9
|
+
|
|
10
|
+
export default function MultiSelectorBottomSheet() {
|
|
11
|
+
const [value, setValue] = useState<string[]>([]);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div style={{width: 320, maxWidth: '100%'}}>
|
|
15
|
+
<MultiSelector
|
|
16
|
+
label="Teams"
|
|
17
|
+
options={OPTIONS}
|
|
18
|
+
value={value}
|
|
19
|
+
onChange={setValue}
|
|
20
|
+
placeholder="Choose teams"
|
|
21
|
+
hasSelectAll
|
|
22
|
+
presentation="bottom-sheet"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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: 'Popover',
|
|
7
|
+
name: 'Popover — Bottom Sheet Alternative',
|
|
8
|
+
displayName: 'Popover — Bottom Sheet Alternative',
|
|
9
|
+
description:
|
|
10
|
+
'Opt-in BottomSheet alternative for compact touch surfaces where actions should use a modal presentation anchored to the bottom edge.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 4 / 3,
|
|
13
|
+
componentsUsed: [
|
|
14
|
+
'BottomSheet',
|
|
15
|
+
'Button',
|
|
16
|
+
'Icon',
|
|
17
|
+
'Section',
|
|
18
|
+
'Layout',
|
|
19
|
+
'Text',
|
|
20
|
+
'List',
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import * as stylex from '@stylexjs/stylex';
|
|
7
|
+
import {CalendarIcon, TagIcon, UserIcon} from '@heroicons/react/24/outline';
|
|
8
|
+
import {BottomSheet} from '@astryxdesign/core/BottomSheet';
|
|
9
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
10
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
11
|
+
import {List, ListItem} from '@astryxdesign/core/List';
|
|
12
|
+
import {VStack} from '@astryxdesign/core/Layout';
|
|
13
|
+
import {Section} from '@astryxdesign/core/Section';
|
|
14
|
+
import {Heading, Text} from '@astryxdesign/core/Text';
|
|
15
|
+
import {spacingVars} from '@astryxdesign/core/theme/tokens.stylex';
|
|
16
|
+
|
|
17
|
+
const styles = stylex.create({
|
|
18
|
+
header: {
|
|
19
|
+
// Match the unchanged spacious ListItem inset so the title and description
|
|
20
|
+
// align with the action icons.
|
|
21
|
+
marginInlineStart: spacingVars['--spacing-3'],
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const PROJECT_ACTIONS = [
|
|
26
|
+
[UserIcon, 'Assign owner', 'Route follow-up to a teammate.'],
|
|
27
|
+
[TagIcon, 'Add label', 'Group this item with related work.'],
|
|
28
|
+
[CalendarIcon, 'Set due date', 'Pick a reminder for review.'],
|
|
29
|
+
] as const;
|
|
30
|
+
|
|
31
|
+
export default function PopoverBottomSheetAlternative() {
|
|
32
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<Button label="Open project actions" onClick={() => setIsOpen(true)}>
|
|
37
|
+
Open project actions
|
|
38
|
+
</Button>
|
|
39
|
+
<BottomSheet
|
|
40
|
+
isOpen={isOpen}
|
|
41
|
+
onOpenChange={setIsOpen}
|
|
42
|
+
label="Project actions"
|
|
43
|
+
height="hug">
|
|
44
|
+
<Section paddingBlock={4} paddingInline={1}>
|
|
45
|
+
<VStack gap={3}>
|
|
46
|
+
<VStack gap={1} xstyle={styles.header}>
|
|
47
|
+
<Heading level={3}>Project actions</Heading>
|
|
48
|
+
<Text type="supporting" color="secondary">
|
|
49
|
+
Use this modal touch surface when the task should move away from
|
|
50
|
+
its trigger and stay close to the bottom edge.
|
|
51
|
+
</Text>
|
|
52
|
+
</VStack>
|
|
53
|
+
<List density="spacious">
|
|
54
|
+
{PROJECT_ACTIONS.map(([icon, label, description]) => (
|
|
55
|
+
<ListItem
|
|
56
|
+
key={label}
|
|
57
|
+
label={label}
|
|
58
|
+
description={description}
|
|
59
|
+
startContent={
|
|
60
|
+
<Icon icon={icon} size="md" color="secondary" />
|
|
61
|
+
}
|
|
62
|
+
onClick={() => setIsOpen(false)}
|
|
63
|
+
/>
|
|
64
|
+
))}
|
|
65
|
+
</List>
|
|
66
|
+
</VStack>
|
|
67
|
+
</Section>
|
|
68
|
+
</BottomSheet>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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: 'Selector',
|
|
7
|
+
alsoExampleFor: ['BottomSheet'],
|
|
8
|
+
name: 'Selector — Bottom Sheet',
|
|
9
|
+
displayName: 'Selector — Bottom Sheet',
|
|
10
|
+
description:
|
|
11
|
+
'Presents a single-selection list in a bottom sheet for compact touch interfaces.',
|
|
12
|
+
isReady: true,
|
|
13
|
+
aspectRatio: 3 / 4,
|
|
14
|
+
componentsUsed: ['Selector'],
|
|
15
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Selector} from '@astryxdesign/core/Selector';
|
|
7
|
+
|
|
8
|
+
const OPTIONS = [
|
|
9
|
+
{value: 'design', label: 'Design'},
|
|
10
|
+
{value: 'engineering', label: 'Engineering'},
|
|
11
|
+
{value: 'marketing', label: 'Marketing'},
|
|
12
|
+
{value: 'operations', label: 'Operations'},
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export default function SelectorBottomSheet() {
|
|
16
|
+
const [value, setValue] = useState<string | undefined>();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div style={{width: 320, maxWidth: '100%'}}>
|
|
20
|
+
<Selector
|
|
21
|
+
label="Team"
|
|
22
|
+
options={OPTIONS}
|
|
23
|
+
value={value}
|
|
24
|
+
onChange={setValue}
|
|
25
|
+
placeholder="Choose a team"
|
|
26
|
+
presentation="bottom-sheet"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.5.2-canary.
|
|
3
|
+
"version": "0.5.2-canary.e4f7677",
|
|
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",
|
|
@@ -87,10 +87,10 @@
|
|
|
87
87
|
"zod": "^4.4.3"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@astryxdesign/charts": "0.5.2-canary.
|
|
91
|
-
"@astryxdesign/core": "0.5.2-canary.
|
|
92
|
-
"@astryxdesign/lab": "0.5.2-canary.
|
|
93
|
-
"@astryxdesign/theme-neutral": "0.5.2-canary.
|
|
90
|
+
"@astryxdesign/charts": "0.5.2-canary.e4f7677",
|
|
91
|
+
"@astryxdesign/core": "0.5.2-canary.e4f7677",
|
|
92
|
+
"@astryxdesign/lab": "0.5.2-canary.e4f7677",
|
|
93
|
+
"@astryxdesign/theme-neutral": "0.5.2-canary.e4f7677",
|
|
94
94
|
"gpt-tokenizer": "^3.4.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependenciesMeta": {
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@astryxdesign/charts": "0.5.2-canary.
|
|
112
|
-
"@astryxdesign/core": "0.5.2-canary.
|
|
113
|
-
"@astryxdesign/lab": "0.5.2-canary.
|
|
114
|
-
"@astryxdesign/theme-neutral": "0.5.2-canary.
|
|
111
|
+
"@astryxdesign/charts": "0.5.2-canary.e4f7677",
|
|
112
|
+
"@astryxdesign/core": "0.5.2-canary.e4f7677",
|
|
113
|
+
"@astryxdesign/lab": "0.5.2-canary.e4f7677",
|
|
114
|
+
"@astryxdesign/theme-neutral": "0.5.2-canary.e4f7677",
|
|
115
115
|
"gpt-tokenizer": "^3.4.0"
|
|
116
116
|
},
|
|
117
117
|
"scripts": {
|