@astryxdesign/cli 0.7.12-canary.47cad74 → 0.7.12-canary.5b3e17b
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/component/__fixtures__/resolutions/modules.txt +1 -1
- package/assets/discover/official-packages.json +12 -0
- package/assets/templates/blocks/components/Hooks/useInputStatusIconHookUsage.tsx +1 -0
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +35 -0
- package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.tsx +97 -0
- package/assets/templates/pages/table-filter/page.tsx +15 -23
- package/assets/templates/pages/table-inbox/page.tsx +3 -6
- package/assets/templates/themes/butter/butterTheme.ts +1 -1
- package/package.json +6 -6
|
@@ -298,7 +298,7 @@ useSpeechRecognition useSpeechRecognition Chat/Chat.doc.mjs Chat/useSpeechRecogn
|
|
|
298
298
|
useSwipeAction useSwipeAction Item/Item.doc.mjs Item/useSwipeAction.ts
|
|
299
299
|
useSwitchTouch useSwitchTouch Switch/Switch.doc.mjs Switch/useSwitchTouch.ts
|
|
300
300
|
useTableCellStyles useTableCellStyles Table/Table.doc.mjs Table/useTableCellStyles.ts
|
|
301
|
-
useTableColumnSettingsState useTableColumnSettingsState Table/
|
|
301
|
+
useTableColumnSettingsState useTableColumnSettingsState Table/plugins/columnSettings/useTableColumnSettingsState.doc.mjs Table/plugins/columnSettings/useTableColumnSettingsState.tsx
|
|
302
302
|
useTableSortableState useTableSortableState Table/plugins/sortable/useTableSortableState.doc.mjs Table/plugins/sortable/useTableSortableState.tsx
|
|
303
303
|
useToastGesture useToastGesture Toast/Toast.doc.mjs Toast/useToastGesture.ts
|
|
304
304
|
useTouchTrigger useTouchTrigger Layer/Layer.doc.mjs Layer/useTouchTrigger.ts
|
|
@@ -128,6 +128,10 @@
|
|
|
128
128
|
"kind": "component",
|
|
129
129
|
"name": "CommentThread"
|
|
130
130
|
},
|
|
131
|
+
{
|
|
132
|
+
"kind": "component",
|
|
133
|
+
"name": "DialogHeroHeader"
|
|
134
|
+
},
|
|
131
135
|
{
|
|
132
136
|
"kind": "component",
|
|
133
137
|
"name": "DiffViewer"
|
|
@@ -136,6 +140,10 @@
|
|
|
136
140
|
"kind": "component",
|
|
137
141
|
"name": "EmojiPicker"
|
|
138
142
|
},
|
|
143
|
+
{
|
|
144
|
+
"kind": "component",
|
|
145
|
+
"name": "LineClamp"
|
|
146
|
+
},
|
|
139
147
|
{
|
|
140
148
|
"kind": "component",
|
|
141
149
|
"name": "ListInput"
|
|
@@ -252,6 +260,10 @@
|
|
|
252
260
|
"kind": "template",
|
|
253
261
|
"name": "CommentThreadShowcase"
|
|
254
262
|
},
|
|
263
|
+
{
|
|
264
|
+
"kind": "template",
|
|
265
|
+
"name": "DialogHeroHeaderShowcase"
|
|
266
|
+
},
|
|
255
267
|
{
|
|
256
268
|
"kind": "template",
|
|
257
269
|
"name": "DiffViewerShowcase"
|
|
@@ -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: 'useTableRowsVirtualization',
|
|
7
|
+
name: 'useTableRowsVirtualization - Fixed Height Rows',
|
|
8
|
+
displayName: 'useTableRowsVirtualization - Fixed Height Rows',
|
|
9
|
+
description:
|
|
10
|
+
'A Table with 1,000 product rows in a fixed-height viewport. Scroll vertically to mount the visible rows. The caller keeps all data and columns; this hook does not virtualize columns.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Table'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Table,
|
|
7
|
+
useTableRowsVirtualization,
|
|
8
|
+
type TableColumn,
|
|
9
|
+
} from '@astryxdesign/core/Table';
|
|
10
|
+
|
|
11
|
+
interface Product extends Record<string, unknown> {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const products: Product[] = Array.from({length: 1000}, (_, index) => ({
|
|
17
|
+
id: `product-${index}`,
|
|
18
|
+
name: `Product ${index + 1}`,
|
|
19
|
+
}));
|
|
20
|
+
const columns: TableColumn<Product>[] = [{key: 'name', header: 'Product'}];
|
|
21
|
+
|
|
22
|
+
export default function RowsVirtualizationHookUsage() {
|
|
23
|
+
const virtualization = useTableRowsVirtualization({
|
|
24
|
+
rowHeight: 56,
|
|
25
|
+
viewportHeight: 320,
|
|
26
|
+
});
|
|
27
|
+
return (
|
|
28
|
+
<Table
|
|
29
|
+
data={products}
|
|
30
|
+
columns={columns}
|
|
31
|
+
idKey="id"
|
|
32
|
+
virtualization={virtualization}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -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: 'useTableColumnSettingsState',
|
|
7
|
+
name: 'useTableColumnSettingsState — Column Visibility Picker',
|
|
8
|
+
displayName: 'useTableColumnSettingsState — Column Visibility Picker',
|
|
9
|
+
description:
|
|
10
|
+
'A Table toolbar with a Columns menu of checkboxes: toggling Email updates active columns, Reset restores defaults, and the config is passed directly to useTableColumnSettings.',
|
|
11
|
+
isReady: true,
|
|
12
|
+
aspectRatio: 16 / 9,
|
|
13
|
+
componentsUsed: ['Button', 'CheckboxInput', 'Popover', 'Table', 'Layout'],
|
|
14
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
import {useState} from 'react';
|
|
6
|
+
import {Button} from '@astryxdesign/core/Button';
|
|
7
|
+
import {CheckboxInput} from '@astryxdesign/core/CheckboxInput';
|
|
8
|
+
import {HStack, VStack} from '@astryxdesign/core/Layout';
|
|
9
|
+
import {Popover} from '@astryxdesign/core/Popover';
|
|
10
|
+
import {
|
|
11
|
+
Table,
|
|
12
|
+
useTableColumnSettings,
|
|
13
|
+
useTableColumnSettingsState,
|
|
14
|
+
} from '@astryxdesign/core/Table';
|
|
15
|
+
import type {TableColumn} from '@astryxdesign/core/Table';
|
|
16
|
+
|
|
17
|
+
interface Member extends Record<string, unknown> {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
email: string;
|
|
21
|
+
role: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const members: Member[] = [
|
|
25
|
+
{id: '1', name: 'Alice', email: 'alice@example.com', role: 'Engineer'},
|
|
26
|
+
{id: '2', name: 'Bob', email: 'bob@example.com', role: 'Designer'},
|
|
27
|
+
{id: '3', name: 'Charlie', email: 'charlie@example.com', role: 'Manager'},
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const allColumns: TableColumn<Member>[] = [
|
|
31
|
+
{key: 'name', header: 'Name'},
|
|
32
|
+
{key: 'email', header: 'Email'},
|
|
33
|
+
{key: 'role', header: 'Role'},
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const columnOptions = [
|
|
37
|
+
{key: 'name' as const, label: 'Name', isAlwaysVisible: true},
|
|
38
|
+
{key: 'email' as const, label: 'Email'},
|
|
39
|
+
{key: 'role' as const, label: 'Role'},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const defaultKeys = ['name', 'email', 'role'];
|
|
43
|
+
|
|
44
|
+
export default function UseTableColumnSettingsStateHookUsage() {
|
|
45
|
+
const [activeKeys, setActiveKeys] =
|
|
46
|
+
useState<ReadonlyArray<string>>(defaultKeys);
|
|
47
|
+
|
|
48
|
+
const state = useTableColumnSettingsState({
|
|
49
|
+
columns: columnOptions,
|
|
50
|
+
activeColumnKeys: activeKeys,
|
|
51
|
+
onChangeActiveColumnKeys: setActiveKeys,
|
|
52
|
+
defaultColumnKeys: defaultKeys,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const plugin = useTableColumnSettings<Member>(state.columnSettingsConfig);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<VStack gap={3}>
|
|
59
|
+
<HStack hAlign="start">
|
|
60
|
+
<Popover
|
|
61
|
+
placement="below"
|
|
62
|
+
label="Column settings"
|
|
63
|
+
width={200}
|
|
64
|
+
content={
|
|
65
|
+
<VStack gap={2}>
|
|
66
|
+
{columnOptions.map(col => (
|
|
67
|
+
<CheckboxInput
|
|
68
|
+
key={col.key}
|
|
69
|
+
label={col.label}
|
|
70
|
+
value={state.isColumnActive(col.key)}
|
|
71
|
+
isDisabled={!state.isColumnToggleable(col.key)}
|
|
72
|
+
onChange={() => state.toggleColumn(col.key)}
|
|
73
|
+
/>
|
|
74
|
+
))}
|
|
75
|
+
<Button
|
|
76
|
+
label="Reset"
|
|
77
|
+
size="sm"
|
|
78
|
+
variant="secondary"
|
|
79
|
+
onClick={state.resetToDefault}>
|
|
80
|
+
Reset
|
|
81
|
+
</Button>
|
|
82
|
+
</VStack>
|
|
83
|
+
}>
|
|
84
|
+
<Button label="Columns" size="sm">
|
|
85
|
+
Columns
|
|
86
|
+
</Button>
|
|
87
|
+
</Popover>
|
|
88
|
+
</HStack>
|
|
89
|
+
<Table
|
|
90
|
+
data={members}
|
|
91
|
+
columns={allColumns}
|
|
92
|
+
idKey="id"
|
|
93
|
+
plugins={{columnSettings: plugin}}
|
|
94
|
+
/>
|
|
95
|
+
</VStack>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
@@ -1129,18 +1129,6 @@ const INITIAL_SAVED_VIEWS: SavedView[] = [
|
|
|
1129
1129
|
const COMPACT_SURFACE_QUERY =
|
|
1130
1130
|
'(max-width: 768px), (max-width: 1024px) and (pointer: coarse) and (hover: none)';
|
|
1131
1131
|
|
|
1132
|
-
/**
|
|
1133
|
-
* Top padding for whatever opens a BottomSheet, on the spacing scale.
|
|
1134
|
-
*
|
|
1135
|
-
* The panel's grab pill floats over the content instead of reserving layout
|
|
1136
|
-
* space for itself: it is 4px centered in a 24px band, so it covers the top
|
|
1137
|
-
* 10-14px of the sheet. Content that starts at the usual 16px gutter clears it
|
|
1138
|
-
* by 2px, which does not read as a gap — it reads as the sheet being cut off.
|
|
1139
|
-
* Opening at the full 24px band puts real space under the pill, and every
|
|
1140
|
-
* sheet here uses this one value so they all start on the same line.
|
|
1141
|
-
*/
|
|
1142
|
-
const SHEET_TOP_INSET = 6;
|
|
1143
|
-
|
|
1144
1132
|
/**
|
|
1145
1133
|
* Width the filter row holds back, in px, for the readout that trails the
|
|
1146
1134
|
* clauses — the density toggle, the result count and Clear all.
|
|
@@ -1698,6 +1686,7 @@ const styles = stylex.create({
|
|
|
1698
1686
|
fontSize: typeScaleVars['--text-body-size'],
|
|
1699
1687
|
fontWeight: typeScaleVars['--text-body-weight'],
|
|
1700
1688
|
height: 'auto',
|
|
1689
|
+
minHeight: 0,
|
|
1701
1690
|
lineHeight: typeScaleVars['--text-body-leading'],
|
|
1702
1691
|
paddingBlock: 0,
|
|
1703
1692
|
paddingInline: 0,
|
|
@@ -2052,7 +2041,8 @@ function FilterOverflow({
|
|
|
2052
2041
|
<VStack
|
|
2053
2042
|
gap={2}
|
|
2054
2043
|
padding={isCompactSurface ? 4 : 0}
|
|
2055
|
-
|
|
2044
|
+
// In a sheet the sheet's band under its grab bar is the top inset.
|
|
2045
|
+
paddingBlockStart={0}>
|
|
2056
2046
|
{items.map(({child, index}) => (
|
|
2057
2047
|
<StackItem key={index} xstyle={styles.overflowItem}>
|
|
2058
2048
|
{child}
|
|
@@ -2145,7 +2135,8 @@ function AdaptiveSavedViewForm({
|
|
|
2145
2135
|
<Section
|
|
2146
2136
|
variant="transparent"
|
|
2147
2137
|
padding={4}
|
|
2148
|
-
|
|
2138
|
+
// The sheet's band under its grab bar is the top inset.
|
|
2139
|
+
paddingBlockStart={0}>
|
|
2149
2140
|
<VStack gap={4}>
|
|
2150
2141
|
<HStack gap={2}>
|
|
2151
2142
|
<StackItem size="fill">
|
|
@@ -4090,11 +4081,11 @@ export default function TableFilterTemplate() {
|
|
|
4090
4081
|
label="View options"
|
|
4091
4082
|
height="tall"
|
|
4092
4083
|
// The tab strip compensates against a container inset, so the sheet
|
|
4093
|
-
// publishes none
|
|
4084
|
+
// publishes none; its band under the grab bar is the only top inset,
|
|
4085
|
+
// so the strip's own box starts at the tab row and its scroll arrow
|
|
4086
|
+
// lands on the tabs rather than above them.
|
|
4094
4087
|
padding={0}>
|
|
4095
|
-
{
|
|
4096
|
-
row and its scroll arrow lands on the tabs rather than above them. */}
|
|
4097
|
-
<VStack gap={0} paddingBlockStart={SHEET_TOP_INSET}>
|
|
4088
|
+
<VStack gap={0}>
|
|
4098
4089
|
{/* The heading the popover puts above the pane is dropped here: it
|
|
4099
4090
|
restates the selected tab word for word, and the strip already
|
|
4100
4091
|
marks which one that is. On a phone that is a line of vertical
|
|
@@ -4148,14 +4139,15 @@ export default function TableFilterTemplate() {
|
|
|
4148
4139
|
const detailBody =
|
|
4149
4140
|
activeJob == null ? null : (
|
|
4150
4141
|
<VStack gap={0} xstyle={styles.detailPanel}>
|
|
4151
|
-
{/* The only part of the body that knows which host it is in: the
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
Layout drops the panel entirely
|
|
4142
|
+
{/* The only part of the body that knows which host it is in: in the
|
|
4143
|
+
sheet, the sheet's band under its grab bar is the top inset; the
|
|
4144
|
+
docked panel has no pill and keeps the 16px gutter of the panels
|
|
4145
|
+
beside it. The two never coexist — Layout drops the panel entirely
|
|
4146
|
+
on a compact surface. */}
|
|
4155
4147
|
<Section
|
|
4156
4148
|
variant="transparent"
|
|
4157
4149
|
padding={4}
|
|
4158
|
-
paddingBlockStart={isCompactSurface ?
|
|
4150
|
+
paddingBlockStart={isCompactSurface ? 0 : 4}>
|
|
4159
4151
|
<VStack gap={4}>
|
|
4160
4152
|
<HStack gap={2}>
|
|
4161
4153
|
<StackItem size="fill">
|
|
@@ -1785,12 +1785,9 @@ function ComposeWindow({
|
|
|
1785
1785
|
hasScrim={false}
|
|
1786
1786
|
// The Layout below owns the inset; the sheet adds none of its own.
|
|
1787
1787
|
padding={0}>
|
|
1788
|
-
{/* The
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
sheet buys the handle its own band of space before the content
|
|
1792
|
-
starts. */}
|
|
1793
|
-
<VStack paddingBlockStart={3}>
|
|
1788
|
+
{/* The sheet keeps a band under its grab handle at rest, so the Layout
|
|
1789
|
+
starts below the pill without a band of its own. */}
|
|
1790
|
+
<VStack>
|
|
1794
1791
|
<Layout
|
|
1795
1792
|
// auto, not fill: the sheet is sized by this Layout now rather than
|
|
1796
1793
|
// the other way round. `fill` would stretch it to a height that
|
|
@@ -394,8 +394,8 @@ export const butterTheme = defineTheme({
|
|
|
394
394
|
// Radius intentionally not pinned, so buttons keep core's
|
|
395
395
|
// `var(--_button-radius, --radius-element)`: standalone buttons stay 8px,
|
|
396
396
|
// while the chat composer (which sets --_button-radius) rounds them fully.
|
|
397
|
+
// Inline padding only. Button sets its own block padding and height.
|
|
397
398
|
base: {
|
|
398
|
-
paddingBlock: 'var(--spacing-3)',
|
|
399
399
|
paddingInline: 'var(--spacing-4)',
|
|
400
400
|
},
|
|
401
401
|
'variant:secondary': SECONDARY_BUTTON,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.12-canary.
|
|
3
|
+
"version": "0.7.12-canary.5b3e17b",
|
|
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",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"zod": "^4.4.3"
|
|
126
126
|
},
|
|
127
127
|
"peerDependencies": {
|
|
128
|
-
"@astryxdesign/core": "0.7.12-canary.
|
|
128
|
+
"@astryxdesign/core": "0.7.12-canary.5b3e17b"
|
|
129
129
|
},
|
|
130
130
|
"peerDependenciesMeta": {
|
|
131
131
|
"@astryxdesign/core": {
|
|
@@ -133,10 +133,10 @@
|
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@astryxdesign/charts": "0.7.12-canary.
|
|
137
|
-
"@astryxdesign/core": "0.7.12-canary.
|
|
138
|
-
"@astryxdesign/lab": "0.7.12-canary.
|
|
139
|
-
"@astryxdesign/theme-neutral": "0.7.12-canary.
|
|
136
|
+
"@astryxdesign/charts": "0.7.12-canary.5b3e17b",
|
|
137
|
+
"@astryxdesign/core": "0.7.12-canary.5b3e17b",
|
|
138
|
+
"@astryxdesign/lab": "0.7.12-canary.5b3e17b",
|
|
139
|
+
"@astryxdesign/theme-neutral": "0.7.12-canary.5b3e17b",
|
|
140
140
|
"@heroicons/react": "^2.2.0",
|
|
141
141
|
"@stylexjs/stylex": "^0.19.0",
|
|
142
142
|
"@types/babel__core": "^7.20.5",
|