@astryxdesign/cli 0.7.12 → 0.7.13-canary.a5ad1f2
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/api/doctor/_adapter.d.mts +17 -0
- package/api/doctor/_adapter.mjs +40 -0
- package/api/doctor/doctor.d.mts +34 -4
- package/api/doctor/doctor.mjs +108 -21
- package/api/icon/_adapter.d.mts +6 -3
- package/api/icon/_adapter.mjs +11 -3
- package/api/icon/icon.type.d.mts +22 -1
- package/api/icon/icon.type.mjs +12 -4
- package/api/icon/iconUse.doc.mjs +27 -7
- package/api/icon/list/list.mjs +29 -3
- package/api/icon/use/use.d.mts +7 -3
- package/api/icon/use/use.mjs +68 -18
- package/api/integration/validate-integration.d.mts +4 -0
- package/api/integration/validate-integration.mjs +32 -2
- package/api/integration/validate-integration.type.d.mts +15 -0
- package/api/integration/validate-integration.type.mjs +6 -1
- package/api/template/copy/copy.mjs +4 -2
- package/api/template/template.type.d.mts +42 -4
- package/api/template/template.type.mjs +9 -6
- package/assets/discover/official-packages.json +4 -0
- package/assets/docs/tree/icon-sets.doc.mjs +91 -7
- package/assets/icons/definitions/alignBottom.doc.mjs +9 -0
- package/assets/icons/definitions/alignJustify.doc.mjs +9 -0
- package/assets/icons/definitions/alignMiddle.doc.mjs +9 -0
- package/assets/icons/definitions/alignTop.doc.mjs +9 -0
- package/assets/icons/definitions/angle.doc.mjs +9 -0
- package/assets/icons/definitions/cloud.doc.mjs +9 -0
- package/assets/icons/definitions/collection.doc.mjs +9 -0
- package/assets/icons/definitions/contrast.doc.mjs +9 -0
- package/assets/icons/definitions/cornerRadius.doc.mjs +9 -0
- package/assets/icons/definitions/cut.doc.mjs +9 -0
- package/assets/icons/definitions/fingerprint.doc.mjs +9 -0
- package/assets/icons/definitions/fire.doc.mjs +9 -0
- package/assets/icons/definitions/frame.doc.mjs +9 -0
- package/assets/icons/definitions/gift.doc.mjs +9 -0
- package/assets/icons/definitions/group.doc.mjs +9 -0
- package/assets/icons/definitions/integration.doc.mjs +9 -0
- package/assets/icons/definitions/lowercase.doc.mjs +9 -0
- package/assets/icons/definitions/paddingHorizontal.doc.mjs +9 -0
- package/assets/icons/definitions/paddingPerSide.doc.mjs +9 -0
- package/assets/icons/definitions/paddingVertical.doc.mjs +9 -0
- package/assets/icons/definitions/panelBottom.doc.mjs +9 -0
- package/assets/icons/definitions/photoEffect.doc.mjs +9 -0
- package/assets/icons/definitions/radiusPerCorner.doc.mjs +9 -0
- package/assets/icons/definitions/rotateCounterclockwise.doc.mjs +9 -0
- package/assets/icons/definitions/tablet.doc.mjs +9 -0
- package/assets/icons/definitions/text.doc.mjs +9 -0
- package/assets/icons/definitions/textRegular.doc.mjs +9 -0
- package/assets/icons/definitions/transfer.doc.mjs +9 -0
- package/assets/icons/definitions/uppercase.doc.mjs +9 -0
- package/assets/icons/definitions/userRemove.doc.mjs +9 -0
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.doc.mjs +23 -0
- package/assets/templates/blocks/components/BaseTypeahead/BaseTypeaheadMenu.tsx +199 -0
- package/assets/templates/blocks/components/ButtonGroup/ButtonGroupShowcase.doc.mjs +1 -0
- package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.doc.mjs +7 -2
- package/assets/templates/pages/canvas-editor/template.doc.mjs +20 -0
- package/assets/templates/pages/editor/template.doc.mjs +1 -0
- package/assets/templates/pages/form-wizard-vertical/template.doc.mjs +1 -0
- package/assets/templates/pages/settings-dialog/template.doc.mjs +4 -0
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +3 -0
- package/assets/templates/pages/table-collapsible/template.doc.mjs +1 -0
- package/assets/templates/pages/table-comparison/template.doc.mjs +1 -0
- package/authoring/config/config.doc.mjs +4 -4
- package/authoring/config/parse.d.mts +1 -1
- package/authoring/config/parse.mjs +3 -1
- package/authoring/config/type.ts +7 -5
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +5 -3
- package/clients/cli/commands/experimental/icon.mjs +38 -9
- package/clients/cli/commands/experimental-icon-use.doc.mjs +9 -4
- package/clients/cli/commands/template.mjs +12 -3
- package/foundation/config/config-writer.d.mts +14 -0
- package/foundation/config/config-writer.mjs +73 -17
- package/foundation/discovery/icon-set-discovery.d.mts +77 -7
- package/foundation/discovery/icon-set-discovery.mjs +128 -42
- package/foundation/discovery/template-icon-notes.d.mts +46 -0
- package/foundation/discovery/template-icon-notes.mjs +94 -16
- package/foundation/discovery/template-icons.d.mts +247 -0
- package/foundation/discovery/template-icons.mjs +591 -37
- package/foundation/integrations/cli-requirement.d.mts +13 -4
- package/foundation/integrations/cli-requirement.mjs +18 -6
- package/package.json +6 -6
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'alignTop',
|
|
7
|
+
description: 'Align items to the top edge.',
|
|
8
|
+
words: ['top align', 'align start vertical'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'angle',
|
|
7
|
+
description: 'An angle, such as the rotation of an item.',
|
|
8
|
+
words: ['rotation', 'degrees', 'triangle'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'cloud',
|
|
7
|
+
description: 'Cloud storage, a hosted service, or weather.',
|
|
8
|
+
words: ['storage', 'hosted', 'sync'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'collection',
|
|
7
|
+
description: 'A series or stack of related items.',
|
|
8
|
+
words: ['series', 'stack', 'set of items'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'contrast',
|
|
7
|
+
description: 'Contrast, or a two-tone effect on an image.',
|
|
8
|
+
words: ['duotone', 'two tone', 'half circle'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'cornerRadius',
|
|
7
|
+
description: 'How round the corners of an item are.',
|
|
8
|
+
words: ['radius', 'rounded corners', 'border radius'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'cut',
|
|
7
|
+
description: 'Cut a selection so you can paste it somewhere else.',
|
|
8
|
+
words: ['scissors', 'cut out', 'clip'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'fingerprint',
|
|
7
|
+
description: 'A passkey, biometric sign-in, or unique identity.',
|
|
8
|
+
words: ['passkey', 'biometric', 'touch id'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'fire',
|
|
7
|
+
description: 'Something popular, trending, or hot.',
|
|
8
|
+
words: ['trending', 'hot', 'popular', 'flame'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'frame',
|
|
7
|
+
description: 'A frame that holds other layers on a canvas.',
|
|
8
|
+
words: ['artboard', 'canvas frame', 'container'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'gift',
|
|
7
|
+
description: 'A gift, gift card, or reward.',
|
|
8
|
+
words: ['present', 'reward', 'gift card'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'group',
|
|
7
|
+
description: 'Group selected items together.',
|
|
8
|
+
words: ['group layers', 'combine', 'bundle'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'integration',
|
|
7
|
+
description: 'A connected app, plugin, or extension.',
|
|
8
|
+
words: ['plugin', 'extension', 'add-on', 'connected app'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'lowercase',
|
|
7
|
+
description: 'Make text all small letters.',
|
|
8
|
+
words: ['lower case', 'small letters'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'paddingHorizontal',
|
|
7
|
+
description: 'Space on the left and right sides inside an item.',
|
|
8
|
+
words: ['horizontal padding', 'inline padding'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'paddingPerSide',
|
|
7
|
+
description: 'Set the space inside an item one side at a time.',
|
|
8
|
+
words: ['padding per side', 'individual padding'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'paddingVertical',
|
|
7
|
+
description: 'Space on the top and bottom sides inside an item.',
|
|
8
|
+
words: ['vertical padding', 'block padding'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'panelBottom',
|
|
7
|
+
description: 'Show or hide a panel at the bottom edge.',
|
|
8
|
+
words: ['bottom panel', 'toolbar', 'dock'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'photoEffect',
|
|
7
|
+
description: 'An effect on a photo, such as grain or a lens look.',
|
|
8
|
+
words: ['aperture', 'lens', 'grain', 'camera effect'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'radiusPerCorner',
|
|
7
|
+
description: 'Set the roundness of each corner on its own.',
|
|
8
|
+
words: ['radius per corner', 'individual corners'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'rotateCounterclockwise',
|
|
7
|
+
description: 'Rotate to the left, against the clock.',
|
|
8
|
+
words: ['rotate left', 'counterclockwise', 'anticlockwise'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'tablet',
|
|
7
|
+
description: 'A tablet device, or a tablet-sized view.',
|
|
8
|
+
words: ['ipad', 'device', 'tablet view'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'text',
|
|
7
|
+
description: 'Text content, such as a text layer or a text field.',
|
|
8
|
+
words: ['type', 'typography', 'text layer'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'textRegular',
|
|
7
|
+
description: 'Plain upright text, the regular style beside italic.',
|
|
8
|
+
words: ['regular', 'normal text', 'not italic'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'transfer',
|
|
7
|
+
description: 'Move money or items between two places.',
|
|
8
|
+
words: ['exchange', 'swap', 'payment processor'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'uppercase',
|
|
7
|
+
description: 'Make text all capital letters.',
|
|
8
|
+
words: ['caps', 'all caps', 'upper case'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').IconDefinitionDoc} */
|
|
4
|
+
export default {
|
|
5
|
+
type: 'icon-definition',
|
|
6
|
+
name: 'userRemove',
|
|
7
|
+
description: 'Remove a person from a group, chat, or team.',
|
|
8
|
+
words: ['remove person', 'user minus', 'kick'],
|
|
9
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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: 'BaseTypeahead',
|
|
7
|
+
name: 'BaseTypeahead — Menu',
|
|
8
|
+
displayName: 'BaseTypeahead — Menu',
|
|
9
|
+
description:
|
|
10
|
+
"A filter field built on BaseTypeahead's `menu`. The listbox role puts a heading and a key hint around the result list, and keeps every action a result. Picking a field switches the same menu to a dialog role that edits the value; `handleRef.open()` reopens it from a filter button, and Escape returns focus to that button.",
|
|
11
|
+
isReady: true,
|
|
12
|
+
isShowcase: false,
|
|
13
|
+
aspectRatio: 16 / 9,
|
|
14
|
+
componentsUsed: [
|
|
15
|
+
'BaseTypeahead',
|
|
16
|
+
'Button',
|
|
17
|
+
'Icon',
|
|
18
|
+
'Layout',
|
|
19
|
+
'RadioList',
|
|
20
|
+
'Text',
|
|
21
|
+
],
|
|
22
|
+
icons: {FunnelIcon: 'funnel'},
|
|
23
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useRef, useState} from 'react';
|
|
6
|
+
import * as stylex from '@stylexjs/stylex';
|
|
7
|
+
import {BaseTypeahead, createStaticSource} from '@astryxdesign/core/Typeahead';
|
|
8
|
+
import type {
|
|
9
|
+
BaseTypeaheadHandle,
|
|
10
|
+
BaseTypeaheadMenu,
|
|
11
|
+
SearchableItem,
|
|
12
|
+
} from '@astryxdesign/core/Typeahead';
|
|
13
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
14
|
+
import {Icon} from '@astryxdesign/core/Icon';
|
|
15
|
+
import {HStack, VStack} from '@astryxdesign/core/Layout';
|
|
16
|
+
import {RadioList, RadioListItem} from '@astryxdesign/core/RadioList';
|
|
17
|
+
import {Text} from '@astryxdesign/core/Text';
|
|
18
|
+
import {
|
|
19
|
+
borderVars,
|
|
20
|
+
colorVars,
|
|
21
|
+
focusVars,
|
|
22
|
+
radiusVars,
|
|
23
|
+
spacingVars,
|
|
24
|
+
} from '@astryxdesign/core/theme/tokens.stylex';
|
|
25
|
+
import {FunnelIcon} from '@heroicons/react/24/outline';
|
|
26
|
+
|
|
27
|
+
type Field = SearchableItem & {values: string[]};
|
|
28
|
+
|
|
29
|
+
const fields: Field[] = [
|
|
30
|
+
{id: 'status', label: 'Status', values: ['Open', 'In review', 'Closed']},
|
|
31
|
+
{id: 'priority', label: 'Priority', values: ['High', 'Medium', 'Low']},
|
|
32
|
+
{id: 'owner', label: 'Owner', values: ['Me', 'My team', 'Anyone']},
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const source = createStaticSource<Field>(fields);
|
|
36
|
+
|
|
37
|
+
type Filter = {field: Field; value: string};
|
|
38
|
+
|
|
39
|
+
const styles = stylex.create({
|
|
40
|
+
root: {
|
|
41
|
+
width: '100%',
|
|
42
|
+
maxWidth: 420,
|
|
43
|
+
},
|
|
44
|
+
// The ring follows the field's own input; the menu's dialog renders inside
|
|
45
|
+
// this box and holds inputs of its own.
|
|
46
|
+
field: {
|
|
47
|
+
backgroundColor: colorVars['--color-background-surface'],
|
|
48
|
+
borderColor: colorVars['--color-border'],
|
|
49
|
+
borderRadius: radiusVars['--radius-element'],
|
|
50
|
+
borderStyle: 'solid',
|
|
51
|
+
borderWidth: borderVars['--border-width'],
|
|
52
|
+
paddingBlock: spacingVars['--spacing-1-5'],
|
|
53
|
+
paddingInline: spacingVars['--spacing-2'],
|
|
54
|
+
outlineColor: {
|
|
55
|
+
default: 'transparent',
|
|
56
|
+
':has(> input:focus-visible)': focusVars['--focus-outline-color'],
|
|
57
|
+
},
|
|
58
|
+
outlineOffset: focusVars['--focus-outline-offset'],
|
|
59
|
+
outlineStyle: 'solid',
|
|
60
|
+
outlineWidth: {
|
|
61
|
+
default: '0',
|
|
62
|
+
':has(> input:focus-visible)': focusVars['--focus-outline-width'],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
menuNote: {
|
|
66
|
+
paddingBlock: spacingVars['--spacing-1'],
|
|
67
|
+
paddingInline: spacingVars['--spacing-3'],
|
|
68
|
+
},
|
|
69
|
+
editor: {
|
|
70
|
+
padding: spacingVars['--spacing-3'],
|
|
71
|
+
minWidth: 260,
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* A filter field built on BaseTypeahead's `menu`. Typing lists the fields
|
|
77
|
+
* with a heading and a key hint around the list. Picking a field switches the
|
|
78
|
+
* same menu to a dialog that edits its value; a filter's button reopens that
|
|
79
|
+
* dialog, and Escape returns focus to the button.
|
|
80
|
+
*/
|
|
81
|
+
export default function BaseTypeaheadMenu() {
|
|
82
|
+
const fieldRef = useRef<HTMLDivElement>(null);
|
|
83
|
+
const typeahead = useRef<BaseTypeaheadHandle>(null);
|
|
84
|
+
const [filters, setFilters] = useState<Filter[]>([]);
|
|
85
|
+
const [editing, setEditing] = useState<Filter | null>(null);
|
|
86
|
+
const [draft, setDraft] = useState('');
|
|
87
|
+
|
|
88
|
+
const edit = (filter: Filter) => {
|
|
89
|
+
setEditing(filter);
|
|
90
|
+
setDraft(filter.value);
|
|
91
|
+
typeahead.current?.open();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const menu: BaseTypeaheadMenu =
|
|
95
|
+
editing == null
|
|
96
|
+
? {
|
|
97
|
+
role: 'listbox',
|
|
98
|
+
render: ({listbox, query}) => (
|
|
99
|
+
<>
|
|
100
|
+
<Text
|
|
101
|
+
type="supporting"
|
|
102
|
+
color="secondary"
|
|
103
|
+
xstyle={styles.menuNote}>
|
|
104
|
+
{query === '' ? 'Filter by' : `Fields matching “${query}”`}
|
|
105
|
+
</Text>
|
|
106
|
+
{listbox}
|
|
107
|
+
<Text
|
|
108
|
+
type="supporting"
|
|
109
|
+
color="secondary"
|
|
110
|
+
xstyle={styles.menuNote}>
|
|
111
|
+
Arrow keys move, Enter picks
|
|
112
|
+
</Text>
|
|
113
|
+
</>
|
|
114
|
+
),
|
|
115
|
+
}
|
|
116
|
+
: {
|
|
117
|
+
role: 'dialog',
|
|
118
|
+
label: `${editing.field.label} filter`,
|
|
119
|
+
render: ({close}) => (
|
|
120
|
+
<VStack gap={3} xstyle={styles.editor}>
|
|
121
|
+
<RadioList
|
|
122
|
+
label={editing.field.label}
|
|
123
|
+
value={draft}
|
|
124
|
+
onChange={setDraft}>
|
|
125
|
+
{editing.field.values.map(value => (
|
|
126
|
+
<RadioListItem key={value} label={value} value={value} />
|
|
127
|
+
))}
|
|
128
|
+
</RadioList>
|
|
129
|
+
<HStack gap={2} hAlign="end">
|
|
130
|
+
<Button label="Cancel" variant="secondary" onClick={close} />
|
|
131
|
+
<Button
|
|
132
|
+
label="Apply"
|
|
133
|
+
variant="primary"
|
|
134
|
+
onClick={() => {
|
|
135
|
+
const next = {field: editing.field, value: draft};
|
|
136
|
+
setFilters(current => [
|
|
137
|
+
...current.filter(f => f.field.id !== next.field.id),
|
|
138
|
+
next,
|
|
139
|
+
]);
|
|
140
|
+
close();
|
|
141
|
+
}}
|
|
142
|
+
/>
|
|
143
|
+
</HStack>
|
|
144
|
+
</VStack>
|
|
145
|
+
),
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<VStack gap={3} xstyle={styles.root}>
|
|
150
|
+
<HStack ref={fieldRef} gap={2} vAlign="center" xstyle={styles.field}>
|
|
151
|
+
<Icon icon={FunnelIcon} size="sm" color="secondary" />
|
|
152
|
+
<BaseTypeahead<Field>
|
|
153
|
+
aria-label="Add a filter"
|
|
154
|
+
searchSource={source}
|
|
155
|
+
value={null}
|
|
156
|
+
onChange={field => {
|
|
157
|
+
if (field != null) {
|
|
158
|
+
// A field that already has a filter opens on its applied value.
|
|
159
|
+
edit(
|
|
160
|
+
filters.find(filter => filter.field.id === field.id) ?? {
|
|
161
|
+
field,
|
|
162
|
+
value: field.values[0],
|
|
163
|
+
},
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
}}
|
|
167
|
+
onOpenChange={isOpen => {
|
|
168
|
+
if (!isOpen) {
|
|
169
|
+
setEditing(null);
|
|
170
|
+
}
|
|
171
|
+
}}
|
|
172
|
+
handleRef={typeahead}
|
|
173
|
+
menu={menu}
|
|
174
|
+
anchorRef={fieldRef}
|
|
175
|
+
placeholder="Add a filter…"
|
|
176
|
+
hasEntriesOnFocus
|
|
177
|
+
debounceMs={0}
|
|
178
|
+
/>
|
|
179
|
+
</HStack>
|
|
180
|
+
<HStack gap={2} wrap="wrap">
|
|
181
|
+
{filters.length === 0 ? (
|
|
182
|
+
<Text type="supporting" color="secondary">
|
|
183
|
+
No filters
|
|
184
|
+
</Text>
|
|
185
|
+
) : (
|
|
186
|
+
filters.map(filter => (
|
|
187
|
+
<Button
|
|
188
|
+
key={filter.field.id}
|
|
189
|
+
label={`${filter.field.label}: ${filter.value}`}
|
|
190
|
+
variant="secondary"
|
|
191
|
+
size="sm"
|
|
192
|
+
onClick={() => edit(filter)}
|
|
193
|
+
/>
|
|
194
|
+
))
|
|
195
|
+
)}
|
|
196
|
+
</HStack>
|
|
197
|
+
</VStack>
|
|
198
|
+
);
|
|
199
|
+
}
|
package/assets/templates/blocks/components/ChatSystemMessage/ChatSystemMessageStatusUpdates.doc.mjs
CHANGED
|
@@ -6,9 +6,14 @@ export const doc = {
|
|
|
6
6
|
exampleFor: 'ChatSystemMessage',
|
|
7
7
|
name: 'ChatSystemMessage — Status Updates',
|
|
8
8
|
displayName: 'ChatSystemMessage — Status Updates',
|
|
9
|
-
description:
|
|
9
|
+
description:
|
|
10
|
+
'Realistic status messages in a conversation flow showing membership changes, timestamps, and resolution notices.',
|
|
10
11
|
isReady: true,
|
|
11
12
|
aspectRatio: 4 / 3,
|
|
12
13
|
componentsUsed: ['Chat', 'Icon'],
|
|
13
|
-
icons: {
|
|
14
|
+
icons: {
|
|
15
|
+
CheckCircleIcon: 'success',
|
|
16
|
+
UserMinusIcon: 'userRemove',
|
|
17
|
+
UserPlusIcon: 'userAdd',
|
|
18
|
+
},
|
|
14
19
|
};
|
|
@@ -18,27 +18,47 @@ export const doc = {
|
|
|
18
18
|
isReady: true,
|
|
19
19
|
category: 'Tools - Canvas Editor',
|
|
20
20
|
icons: {
|
|
21
|
+
Aperture: 'photoEffect',
|
|
22
|
+
ArrowDownToLine: 'alignBottom',
|
|
23
|
+
ArrowUpToLine: 'alignTop',
|
|
24
|
+
Baseline: 'textRegular',
|
|
25
|
+
CaseLower: 'lowercase',
|
|
21
26
|
CaseSensitive: 'textCase',
|
|
27
|
+
CaseUpper: 'uppercase',
|
|
28
|
+
Contrast: 'contrast',
|
|
22
29
|
Download: 'download',
|
|
23
30
|
File: 'file',
|
|
24
31
|
FlipHorizontal2: 'flipHorizontal',
|
|
25
32
|
FlipVertical2: 'flipVertical',
|
|
33
|
+
FoldVertical: 'alignMiddle',
|
|
34
|
+
Frame: 'frame',
|
|
26
35
|
Grip: 'drag',
|
|
36
|
+
Group: 'group',
|
|
27
37
|
Image: 'image',
|
|
28
38
|
Italic: 'italic',
|
|
29
39
|
Lock: 'lock',
|
|
30
40
|
LockOpen: 'unlock',
|
|
31
41
|
Menu: 'menu',
|
|
32
42
|
Minus: 'remove',
|
|
43
|
+
PanelBottom: 'panelBottom',
|
|
33
44
|
PanelLeft: 'panelLeft',
|
|
45
|
+
PanelLeftRightDashed: 'paddingHorizontal',
|
|
34
46
|
PanelRight: 'panelRight',
|
|
47
|
+
PanelTopBottomDashed: 'paddingVertical',
|
|
35
48
|
Plus: 'add',
|
|
36
49
|
Redo2: 'redo',
|
|
50
|
+
RotateCcw: 'rotateCounterclockwise',
|
|
37
51
|
RotateCw: 'rotate',
|
|
52
|
+
Scan: 'cornerRadius',
|
|
53
|
+
SquareRoundCorner: 'radiusPerCorner',
|
|
54
|
+
SquareSquare: 'paddingPerSide',
|
|
38
55
|
Strikethrough: 'strikethrough',
|
|
39
56
|
TextAlignCenter: 'alignCenter',
|
|
40
57
|
TextAlignEnd: 'alignEnd',
|
|
58
|
+
TextAlignJustify: 'alignJustify',
|
|
41
59
|
TextAlignStart: 'alignStart',
|
|
60
|
+
TriangleRight: 'angle',
|
|
61
|
+
Type: 'text',
|
|
42
62
|
Underline: 'underline',
|
|
43
63
|
Undo2: 'undo',
|
|
44
64
|
X: 'close',
|
|
@@ -21,6 +21,7 @@ export const doc = {
|
|
|
21
21
|
ArrowDownTrayIcon: 'download',
|
|
22
22
|
ArrowUturnLeftIcon: 'undo',
|
|
23
23
|
AtSymbolIcon: 'mention',
|
|
24
|
+
Bars3BottomLeftIcon: 'panelLeft',
|
|
24
25
|
Bars3Icon: 'menu',
|
|
25
26
|
BeakerIcon: 'experiment',
|
|
26
27
|
BellIcon: 'notification',
|
|
@@ -40,6 +41,7 @@ export const doc = {
|
|
|
40
41
|
DocumentTextIcon: 'document',
|
|
41
42
|
EnvelopeIcon: 'mail',
|
|
42
43
|
EyeIcon: 'eye',
|
|
44
|
+
FingerPrintIcon: 'fingerprint',
|
|
43
45
|
FolderIcon: 'folder',
|
|
44
46
|
GlobeAltIcon: 'globe',
|
|
45
47
|
HandRaisedIcon: 'raiseHand',
|
|
@@ -50,7 +52,9 @@ export const doc = {
|
|
|
50
52
|
MagnifyingGlassIcon: 'search',
|
|
51
53
|
MapPinIcon: 'location',
|
|
52
54
|
MoonIcon: 'moon',
|
|
55
|
+
PaintBrushIcon: 'swatch',
|
|
53
56
|
PencilSquareIcon: 'compose',
|
|
57
|
+
PuzzlePieceIcon: 'integration',
|
|
54
58
|
QuestionMarkCircleIcon: 'info',
|
|
55
59
|
ReceiptPercentIcon: 'discount',
|
|
56
60
|
ShieldCheckIcon: 'shield',
|
|
@@ -20,7 +20,10 @@ export const doc = {
|
|
|
20
20
|
category: 'Shell - Top Nav',
|
|
21
21
|
icons: {
|
|
22
22
|
BoltIcon: 'bolt',
|
|
23
|
+
CloudIcon: 'cloud',
|
|
23
24
|
FaceSmileIcon: 'emoji',
|
|
25
|
+
FireIcon: 'fire',
|
|
26
|
+
GiftIcon: 'gift',
|
|
24
27
|
GlobeAltIcon: 'globe',
|
|
25
28
|
HomeModernIcon: 'home',
|
|
26
29
|
MagnifyingGlassIcon: 'search',
|