@astryxdesign/cli 0.1.4-canary.ff77e1c → 0.1.4
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/CHANGELOG.md +1 -2
- package/docs/getting-started.doc.mjs +0 -4
- package/docs/migration.doc.mjs +0 -134
- package/docs/styling.doc.mjs +0 -53
- package/docs/working-with-ai.doc.mjs +1 -1
- package/package.json +10 -15
- package/src/api/component.mjs +1 -2
- package/src/api/doctor.mjs +2 -13
- package/src/api/template.mjs +3 -14
- package/src/codemods/__tests__/registry.test.mjs +0 -1
- package/src/codemods/__tests__/runner.test.mjs +0 -38
- package/src/codemods/registry.mjs +0 -1
- package/src/codemods/runner.mjs +0 -2
- package/src/commands/agent-docs.mjs +6 -9
- package/src/commands/agent-docs.test.mjs +0 -33
- package/src/commands/build-theme.mjs +14 -112
- package/src/commands/component-resolution.test.mjs +4 -4
- package/src/commands/doctor.test.mjs +0 -34
- package/src/commands/init.mjs +1 -1
- package/src/commands/swizzle.mjs +0 -34
- package/src/commands/swizzle.routing.test.mjs +0 -67
- package/src/lib/component-discovery.mjs +4 -8
- package/templates/blocks/components/AspectRatio/AspectRatioCircleImage.tsx +6 -1
- package/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +7 -2
- package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +5 -2
- package/templates/blocks/components/AspectRatio/AspectRatioSquareImage.tsx +6 -1
- package/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +6 -1
- package/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx +23 -25
- package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupShowcase.tsx +48 -27
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +54 -31
- package/templates/pages/classic-gallery/page.tsx +1 -1
- package/templates/pages/dashboard/page.tsx +1 -1
- package/templates/pages/documentation/page.tsx +1 -1
- package/templates/pages/kanban-board/page.tsx +13 -37
- package/templates/pages/mixed-gallery/page.tsx +1 -1
- package/templates/pages/payment-form/page.tsx +6 -2
- package/templates/pages/product-detail/page.tsx +11 -3
- package/templates/pages/product-gallery/page.tsx +1 -1
- package/templates/pages/settings/page.tsx +1 -1
- package/templates/pages/side-gallery/page.tsx +1 -1
- package/templates/pages/table-page/page.tsx +1 -1
- package/templates/pages/table-page-chart/page.tsx +14 -4
- package/templates/pages/table-page-heatmap-status/page.tsx +1 -1
- package/templates/pages/table-page-shoe-store-heatmap/page.tsx +19 -5
- package/src/codemods/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +0 -93
- package/src/codemods/transforms/v0.1.5/index.mjs +0 -19
- package/src/codemods/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +0 -140
- package/src/commands/build-theme.color-scheme.test.mjs +0 -153
- package/src/commands/build-theme.variants.test.mjs +0 -193
- package/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +0 -14
- package/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +0 -58
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.doc.mjs +0 -14
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +0 -24
- package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs +0 -13
- package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx +0 -33
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.tsx +0 -39
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.tsx +0 -39
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +0 -27
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.doc.mjs +0 -15
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +0 -38
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.doc.mjs +0 -14
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.tsx +0 -44
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.doc.mjs +0 -15
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.tsx +0 -107
- package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.doc.mjs +0 -15
- package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.tsx +0 -47
- package/templates/pages/incident-console/page.tsx +0 -580
- package/templates/pages/incident-console/template.doc.mjs +0 -12
- package/templates/pages/messaging-shell/page.tsx +0 -676
- package/templates/pages/messaging-shell/template.doc.mjs +0 -12
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteInput',
|
|
7
|
-
name: 'CommandPaletteInput — With End Content',
|
|
8
|
-
displayName: 'CommandPaletteInput — With End Content',
|
|
9
|
-
description:
|
|
10
|
-
'Custom placeholder and a keyboard shortcut badge in the trailing slot via endContent.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: false,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPalette', 'CommandPaletteInput', 'Kbd'],
|
|
15
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {useMemo} from 'react';
|
|
6
|
-
import {
|
|
7
|
-
CommandPalette,
|
|
8
|
-
CommandPaletteInput,
|
|
9
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
-
import {Kbd} from '@astryxdesign/core/Kbd';
|
|
11
|
-
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
12
|
-
|
|
13
|
-
export default function CommandPaletteInputBasic() {
|
|
14
|
-
const source = useMemo(
|
|
15
|
-
() =>
|
|
16
|
-
createStaticSource([
|
|
17
|
-
{id: 'home', label: 'Home'},
|
|
18
|
-
{id: 'settings', label: 'Settings'},
|
|
19
|
-
{id: 'profile', label: 'Profile'},
|
|
20
|
-
{id: 'help', label: 'Help'},
|
|
21
|
-
]),
|
|
22
|
-
[],
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<CommandPalette
|
|
27
|
-
isOpen
|
|
28
|
-
isInline
|
|
29
|
-
onOpenChange={() => {}}
|
|
30
|
-
searchSource={source}
|
|
31
|
-
input={
|
|
32
|
-
<CommandPaletteInput
|
|
33
|
-
placeholder="Search commands, files, or actions..."
|
|
34
|
-
endContent={<Kbd keys="mod+k" />}
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteInput',
|
|
7
|
-
name: 'CommandPaletteInput',
|
|
8
|
-
displayName: 'Command Palette Input',
|
|
9
|
-
description:
|
|
10
|
-
'Command palette search input with a custom placeholder and a keyboard shortcut hint in the endContent slot.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPalette', 'CommandPaletteInput', 'Kbd'],
|
|
15
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {useMemo} from 'react';
|
|
6
|
-
import {
|
|
7
|
-
CommandPalette,
|
|
8
|
-
CommandPaletteInput,
|
|
9
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
-
import {Kbd} from '@astryxdesign/core/Kbd';
|
|
11
|
-
import {createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
12
|
-
|
|
13
|
-
export default function CommandPaletteInputShowcase() {
|
|
14
|
-
const source = useMemo(
|
|
15
|
-
() =>
|
|
16
|
-
createStaticSource([
|
|
17
|
-
{id: 'home', label: 'Home'},
|
|
18
|
-
{id: 'settings', label: 'Settings'},
|
|
19
|
-
{id: 'profile', label: 'Profile'},
|
|
20
|
-
{id: 'help', label: 'Help'},
|
|
21
|
-
]),
|
|
22
|
-
[],
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<CommandPalette
|
|
27
|
-
isOpen
|
|
28
|
-
isInline
|
|
29
|
-
onOpenChange={() => {}}
|
|
30
|
-
searchSource={source}
|
|
31
|
-
input={
|
|
32
|
-
<CommandPaletteInput
|
|
33
|
-
placeholder="Search commands, files, or actions..."
|
|
34
|
-
endContent={<Kbd keys="mod+k" />}
|
|
35
|
-
/>
|
|
36
|
-
}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteList',
|
|
7
|
-
name: 'CommandPaletteList — Item States',
|
|
8
|
-
displayName: 'CommandPaletteList — Item States',
|
|
9
|
-
description:
|
|
10
|
-
'Flat list showing the highlighted, selected, and disabled item states. Use CommandPaletteGroup to add section headings.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: false,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPaletteList', 'CommandPaletteItem'],
|
|
15
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
CommandPaletteList,
|
|
7
|
-
CommandPaletteItem,
|
|
8
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
9
|
-
|
|
10
|
-
export default function CommandPaletteListBasic() {
|
|
11
|
-
return (
|
|
12
|
-
<CommandPaletteList>
|
|
13
|
-
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
14
|
-
Go Home
|
|
15
|
-
</CommandPaletteItem>
|
|
16
|
-
<CommandPaletteItem value="settings" isHighlighted onSelect={() => {}}>
|
|
17
|
-
Open Settings
|
|
18
|
-
</CommandPaletteItem>
|
|
19
|
-
<CommandPaletteItem value="profile" isSelected onSelect={() => {}}>
|
|
20
|
-
View Profile
|
|
21
|
-
</CommandPaletteItem>
|
|
22
|
-
<CommandPaletteItem value="help" isDisabled onSelect={() => {}}>
|
|
23
|
-
Help (unavailable)
|
|
24
|
-
</CommandPaletteItem>
|
|
25
|
-
</CommandPaletteList>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'CommandPaletteList',
|
|
7
|
-
name: 'CommandPaletteList',
|
|
8
|
-
displayName: 'Command Palette List',
|
|
9
|
-
description:
|
|
10
|
-
'Scrollable command palette list with grouped items, including a highlighted item, composed without a full CommandPalette.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['CommandPaletteList', 'CommandPaletteGroup', 'CommandPaletteItem'],
|
|
15
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
CommandPaletteList,
|
|
7
|
-
CommandPaletteGroup,
|
|
8
|
-
CommandPaletteItem,
|
|
9
|
-
} from '@astryxdesign/core/CommandPalette';
|
|
10
|
-
|
|
11
|
-
export default function CommandPaletteListShowcase() {
|
|
12
|
-
return (
|
|
13
|
-
<CommandPaletteList>
|
|
14
|
-
<CommandPaletteGroup heading="Navigation">
|
|
15
|
-
<CommandPaletteItem value="home" onSelect={() => {}}>
|
|
16
|
-
Go Home
|
|
17
|
-
</CommandPaletteItem>
|
|
18
|
-
<CommandPaletteItem value="settings" onSelect={() => {}}>
|
|
19
|
-
Open Settings
|
|
20
|
-
</CommandPaletteItem>
|
|
21
|
-
<CommandPaletteItem value="profile" onSelect={() => {}}>
|
|
22
|
-
View Profile
|
|
23
|
-
</CommandPaletteItem>
|
|
24
|
-
</CommandPaletteGroup>
|
|
25
|
-
<CommandPaletteGroup heading="Actions">
|
|
26
|
-
<CommandPaletteItem value="new-file" onSelect={() => {}}>
|
|
27
|
-
New File
|
|
28
|
-
</CommandPaletteItem>
|
|
29
|
-
<CommandPaletteItem value="search" isHighlighted onSelect={() => {}}>
|
|
30
|
-
Search Files
|
|
31
|
-
</CommandPaletteItem>
|
|
32
|
-
<CommandPaletteItem value="save" onSelect={() => {}}>
|
|
33
|
-
Save All
|
|
34
|
-
</CommandPaletteItem>
|
|
35
|
-
</CommandPaletteGroup>
|
|
36
|
-
</CommandPaletteList>
|
|
37
|
-
);
|
|
38
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'ContextMenuItem',
|
|
7
|
-
name: 'ContextMenuItem — Basic',
|
|
8
|
-
displayName: 'ContextMenuItem — Basic',
|
|
9
|
-
description:
|
|
10
|
-
'Context menu items with labels and secondary descriptions. Use ContextMenuItem to render custom menu entries with consistent styling.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
aspectRatio: 16 / 9,
|
|
13
|
-
componentsUsed: ['ContextMenu', 'ContextMenuItem'],
|
|
14
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {ContextMenu, ContextMenuItem} from '@astryxdesign/core/ContextMenu';
|
|
6
|
-
|
|
7
|
-
export default function ContextMenuItemBasic() {
|
|
8
|
-
return (
|
|
9
|
-
<ContextMenu
|
|
10
|
-
menuContent={
|
|
11
|
-
<>
|
|
12
|
-
<ContextMenuItem
|
|
13
|
-
label="Edit"
|
|
14
|
-
description="Modify this item"
|
|
15
|
-
onClick={() => {}}
|
|
16
|
-
/>
|
|
17
|
-
<ContextMenuItem
|
|
18
|
-
label="Duplicate"
|
|
19
|
-
description="Create a copy"
|
|
20
|
-
onClick={() => {}}
|
|
21
|
-
/>
|
|
22
|
-
<ContextMenuItem
|
|
23
|
-
label="Delete"
|
|
24
|
-
description="This action cannot be undone"
|
|
25
|
-
onClick={() => {}}
|
|
26
|
-
/>
|
|
27
|
-
</>
|
|
28
|
-
}>
|
|
29
|
-
<div
|
|
30
|
-
style={{
|
|
31
|
-
padding: '48px',
|
|
32
|
-
borderWidth: '2px',
|
|
33
|
-
borderStyle: 'dashed',
|
|
34
|
-
borderColor: 'var(--color-border)',
|
|
35
|
-
borderRadius: '8px',
|
|
36
|
-
textAlign: 'center',
|
|
37
|
-
color: 'var(--color-text-secondary)',
|
|
38
|
-
userSelect: 'none',
|
|
39
|
-
}}>
|
|
40
|
-
Right-click this area
|
|
41
|
-
</div>
|
|
42
|
-
</ContextMenu>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'ContextMenuItem',
|
|
7
|
-
name: 'ContextMenuItem',
|
|
8
|
-
displayName: 'Context Menu Item',
|
|
9
|
-
description:
|
|
10
|
-
'Context menu with custom-rendered items using ContextMenuItem for icons and descriptions.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 16 / 9,
|
|
14
|
-
componentsUsed: ['ContextMenu', 'ContextMenuItem'],
|
|
15
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {ContextMenu, ContextMenuItem} from '@astryxdesign/core/ContextMenu';
|
|
6
|
-
|
|
7
|
-
const PencilIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
8
|
-
<svg
|
|
9
|
-
viewBox="0 0 24 24"
|
|
10
|
-
fill="none"
|
|
11
|
-
stroke="currentColor"
|
|
12
|
-
strokeWidth={1.5}
|
|
13
|
-
strokeLinecap="round"
|
|
14
|
-
strokeLinejoin="round"
|
|
15
|
-
{...props}>
|
|
16
|
-
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
|
|
17
|
-
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
|
|
18
|
-
</svg>
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
const CopyIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
22
|
-
<svg
|
|
23
|
-
viewBox="0 0 24 24"
|
|
24
|
-
fill="none"
|
|
25
|
-
stroke="currentColor"
|
|
26
|
-
strokeWidth={1.5}
|
|
27
|
-
strokeLinecap="round"
|
|
28
|
-
strokeLinejoin="round"
|
|
29
|
-
{...props}>
|
|
30
|
-
<rect x="9" y="9" width="13" height="13" rx="2" />
|
|
31
|
-
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
|
|
32
|
-
</svg>
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const ShareIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
36
|
-
<svg
|
|
37
|
-
viewBox="0 0 24 24"
|
|
38
|
-
fill="none"
|
|
39
|
-
stroke="currentColor"
|
|
40
|
-
strokeWidth={1.5}
|
|
41
|
-
strokeLinecap="round"
|
|
42
|
-
strokeLinejoin="round"
|
|
43
|
-
{...props}>
|
|
44
|
-
<circle cx="18" cy="5" r="3" />
|
|
45
|
-
<circle cx="6" cy="12" r="3" />
|
|
46
|
-
<circle cx="18" cy="19" r="3" />
|
|
47
|
-
<line x1="8.59" y1="13.51" x2="15.42" y2="17.49" />
|
|
48
|
-
<line x1="15.41" y1="6.51" x2="8.59" y2="10.49" />
|
|
49
|
-
</svg>
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
const TrashIcon = (props: React.SVGProps<SVGSVGElement>) => (
|
|
53
|
-
<svg
|
|
54
|
-
viewBox="0 0 24 24"
|
|
55
|
-
fill="none"
|
|
56
|
-
stroke="currentColor"
|
|
57
|
-
strokeWidth={1.5}
|
|
58
|
-
strokeLinecap="round"
|
|
59
|
-
strokeLinejoin="round"
|
|
60
|
-
{...props}>
|
|
61
|
-
<polyline points="3 6 5 6 21 6" />
|
|
62
|
-
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />
|
|
63
|
-
</svg>
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
export default function ContextMenuItemShowcase() {
|
|
67
|
-
return (
|
|
68
|
-
<ContextMenu
|
|
69
|
-
menuContent={
|
|
70
|
-
<>
|
|
71
|
-
<ContextMenuItem
|
|
72
|
-
icon={PencilIcon}
|
|
73
|
-
label="Edit"
|
|
74
|
-
description="Modify this item"
|
|
75
|
-
onClick={() => {}}
|
|
76
|
-
/>
|
|
77
|
-
<ContextMenuItem
|
|
78
|
-
icon={CopyIcon}
|
|
79
|
-
label="Duplicate"
|
|
80
|
-
description="Create a copy"
|
|
81
|
-
onClick={() => {}}
|
|
82
|
-
/>
|
|
83
|
-
<ContextMenuItem icon={ShareIcon} label="Share" onClick={() => {}} />
|
|
84
|
-
<ContextMenuItem
|
|
85
|
-
icon={TrashIcon}
|
|
86
|
-
label="Delete"
|
|
87
|
-
description="This action cannot be undone"
|
|
88
|
-
onClick={() => {}}
|
|
89
|
-
/>
|
|
90
|
-
</>
|
|
91
|
-
}>
|
|
92
|
-
<div
|
|
93
|
-
style={{
|
|
94
|
-
padding: '48px',
|
|
95
|
-
borderWidth: '2px',
|
|
96
|
-
borderStyle: 'dashed',
|
|
97
|
-
borderColor: 'var(--color-border)',
|
|
98
|
-
borderRadius: '8px',
|
|
99
|
-
textAlign: 'center',
|
|
100
|
-
color: 'var(--color-text-secondary)',
|
|
101
|
-
userSelect: 'none',
|
|
102
|
-
}}>
|
|
103
|
-
Right-click this area
|
|
104
|
-
</div>
|
|
105
|
-
</ContextMenu>
|
|
106
|
-
);
|
|
107
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/** @type {import('../../../../../core/src/docs-types').TemplateDoc} */
|
|
4
|
-
export const doc = {
|
|
5
|
-
type: 'block',
|
|
6
|
-
exampleFor: 'NavHeadingMenu',
|
|
7
|
-
name: 'NavHeadingMenu',
|
|
8
|
-
displayName: 'Nav Heading Menu',
|
|
9
|
-
description:
|
|
10
|
-
'NavHeadingMenu passed as the menu prop of SideNavHeading, letting the heading act as a product switcher popover trigger.',
|
|
11
|
-
isReady: true,
|
|
12
|
-
isShowcase: true,
|
|
13
|
-
aspectRatio: 4 / 3,
|
|
14
|
-
componentsUsed: ['SideNav', 'SideNavHeading', 'NavHeadingMenu', 'NavHeadingMenuItem'],
|
|
15
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
'use client';
|
|
4
|
-
|
|
5
|
-
import {SideNav, SideNavHeading} from '@astryxdesign/core/SideNav';
|
|
6
|
-
import {NavHeadingMenu, NavHeadingMenuItem} from '@astryxdesign/core/NavMenu';
|
|
7
|
-
|
|
8
|
-
function AppIcon() {
|
|
9
|
-
return (
|
|
10
|
-
<svg
|
|
11
|
-
width="20"
|
|
12
|
-
height="20"
|
|
13
|
-
viewBox="0 0 24 24"
|
|
14
|
-
fill="none"
|
|
15
|
-
stroke="currentColor"
|
|
16
|
-
strokeWidth="1.5">
|
|
17
|
-
<path
|
|
18
|
-
strokeLinecap="round"
|
|
19
|
-
strokeLinejoin="round"
|
|
20
|
-
d="M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z"
|
|
21
|
-
/>
|
|
22
|
-
</svg>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default function NavHeadingMenuShowcase() {
|
|
27
|
-
return (
|
|
28
|
-
<div style={{height: 100}}>
|
|
29
|
-
<SideNav
|
|
30
|
-
header={
|
|
31
|
-
<SideNavHeading
|
|
32
|
-
heading="Acme Platform"
|
|
33
|
-
icon={<AppIcon />}
|
|
34
|
-
menu={
|
|
35
|
-
<NavHeadingMenu size="lg">
|
|
36
|
-
<NavHeadingMenuItem label="Dashboard" href="/dashboard" />
|
|
37
|
-
<NavHeadingMenuItem label="Analytics" href="/analytics" />
|
|
38
|
-
<NavHeadingMenuItem label="Settings" href="/settings" />
|
|
39
|
-
</NavHeadingMenu>
|
|
40
|
-
}
|
|
41
|
-
/>
|
|
42
|
-
}>
|
|
43
|
-
{null}
|
|
44
|
-
</SideNav>
|
|
45
|
-
</div>
|
|
46
|
-
);
|
|
47
|
-
}
|