@astryxdesign/cli 0.7.11 → 0.7.12-canary.0840fcc

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.
Files changed (160) hide show
  1. package/api/build/blocks/blocks.d.mts +41 -0
  2. package/api/build/blocks/blocks.mjs +118 -68
  3. package/api/build/kit/rank.mjs +21 -4
  4. package/api/build/kit/words.d.mts +1 -0
  5. package/api/build/kit/words.mjs +1 -1
  6. package/api/component/__fixtures__/resolutions/modules.txt +5 -5
  7. package/api/docs/_adapter.d.mts +22 -0
  8. package/api/docs/_adapter.mjs +81 -3
  9. package/api/docs/docs.doc.mjs +5 -5
  10. package/api/docs/docs.type.d.mts +21 -0
  11. package/api/docs/docs.type.mjs +11 -0
  12. package/api/docs/list/list.d.mts +5 -1
  13. package/api/docs/list/list.mjs +72 -6
  14. package/api/docs/node/node.mjs +2 -40
  15. package/api/icon/_adapter.d.mts +3 -2
  16. package/api/icon/_adapter.mjs +8 -2
  17. package/api/icon/_authoring.d.mts +1 -0
  18. package/api/icon/_authoring.mjs +594 -67
  19. package/api/icon/_default-look.d.mts +155 -0
  20. package/api/icon/_default-look.mjs +474 -0
  21. package/api/icon/_records.d.mts +1 -1
  22. package/api/icon/_records.mjs +1 -0
  23. package/api/icon/add/add.mjs +269 -43
  24. package/api/icon/icon.type.d.mts +46 -2
  25. package/api/icon/icon.type.mjs +12 -2
  26. package/api/icon/iconAdd.doc.mjs +2 -2
  27. package/api/icon/iconNewDefinition.doc.mjs +3 -2
  28. package/api/icon/iconNewSet.doc.mjs +4 -4
  29. package/api/icon/map/map.mjs +11 -4
  30. package/api/icon/search/search.mjs +10 -9
  31. package/api/index.d.mts +1 -0
  32. package/api/index.mjs +1 -0
  33. package/api/integration/add-helpers.d.mts +15 -1
  34. package/api/integration/add-helpers.mjs +5 -2
  35. package/api/integration/authoring-checks.d.mts +0 -2
  36. package/api/integration/authoring-checks.mjs +1 -6
  37. package/api/logger.mjs +2 -1
  38. package/api/render/_adapter.mjs +9 -0
  39. package/api/render/render.doc.mjs +3 -3
  40. package/api/render/render.type.d.mts +1 -1
  41. package/api/render/render.type.mjs +1 -1
  42. package/api/search/ORDERING.md +3 -0
  43. package/api/search/_adapter.d.mts +32 -3
  44. package/api/search/_adapter.mjs +50 -22
  45. package/api/search/_fit-order.d.mts +47 -0
  46. package/api/search/_fit-order.mjs +257 -0
  47. package/api/search/_main-searcher.mjs +15 -5
  48. package/api/search/exportSearchIndex.doc.d.mts +10 -0
  49. package/api/search/exportSearchIndex.doc.mjs +58 -0
  50. package/api/search/rankSearchIndex.doc.d.mts +10 -0
  51. package/api/search/rankSearchIndex.doc.mjs +79 -0
  52. package/api/search/search-index.d.mts +44 -0
  53. package/api/search/search-index.mjs +270 -0
  54. package/api/search/search.type.d.mts +28 -0
  55. package/api/search/search.type.mjs +17 -0
  56. package/api/swizzle/_adapter.d.mts +1 -0
  57. package/api/swizzle/_adapter.mjs +4 -1
  58. package/api/swizzle/_moduleGraph.d.mts +178 -0
  59. package/api/swizzle/_moduleGraph.mjs +903 -0
  60. package/api/swizzle/copy/copy.d.mts +2 -43
  61. package/api/swizzle/copy/copy.mjs +287 -315
  62. package/api/swizzle/swizzle.d.mts +0 -2
  63. package/api/swizzle/swizzle.doc.mjs +13 -4
  64. package/api/swizzle/swizzle.mjs +3 -7
  65. package/api/swizzle/swizzle.type.d.mts +7 -1
  66. package/api/swizzle/swizzle.type.mjs +4 -2
  67. package/api/template/template.mjs +1 -0
  68. package/assets/discover/official-packages.json +36 -0
  69. package/assets/docs/browser-support.doc.mjs +2 -2
  70. package/assets/docs/styling-overview.doc.mjs +6 -2
  71. package/assets/docs/tree/icon-sets.doc.mjs +13 -7
  72. package/assets/docs/tree/render-pages.doc.mjs +3 -3
  73. package/assets/docs/tree/tailwind.doc.mjs +41 -1
  74. package/assets/docs/tree/type-scale.doc.mjs +19 -2
  75. package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.doc.mjs +14 -0
  76. package/assets/templates/blocks/components/Calendar/useCalendarConstraintsHookUsage.tsx +146 -0
  77. package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.doc.mjs +14 -0
  78. package/assets/templates/blocks/components/Calendar/useCalendarNavigationHookUsage.tsx +173 -0
  79. package/assets/templates/blocks/components/Hooks/useInputStatusIconHookUsage.tsx +1 -0
  80. package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.doc.mjs +14 -0
  81. package/assets/templates/blocks/components/Hooks/useInteractiveRoleHookUsage.tsx +56 -0
  82. package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.doc.mjs +2 -2
  83. package/assets/templates/blocks/components/Hooks/useStreamingTextHookUsage.tsx +66 -10
  84. package/assets/templates/blocks/components/Link/useLinkifyHookUsage.doc.mjs +14 -0
  85. package/assets/templates/blocks/components/Link/useLinkifyHookUsage.tsx +39 -0
  86. package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.doc.mjs +14 -0
  87. package/assets/templates/blocks/components/PowerSearch/usePowerSearchConfigHookUsage.tsx +83 -0
  88. package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.doc.mjs +14 -0
  89. package/assets/templates/blocks/components/Table/RowsVirtualizationHookUsage.tsx +41 -0
  90. package/assets/templates/blocks/components/Table/TableRowIndexTable.doc.mjs +1 -1
  91. package/assets/templates/blocks/components/Table/TableRowIndexTable.tsx +2 -2
  92. package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.doc.mjs +14 -0
  93. package/assets/templates/blocks/components/Table/useTableColumnSettingsStateHookUsage.tsx +97 -0
  94. package/assets/templates/pages/course-detail/page.tsx +699 -0
  95. package/assets/templates/pages/course-detail/template.doc.mjs +37 -0
  96. package/assets/templates/pages/file-explorer/page.tsx +103 -79
  97. package/assets/templates/pages/table-filter/page.tsx +15 -23
  98. package/assets/templates/pages/table-grouped/page.tsx +160 -232
  99. package/assets/templates/pages/table-grouped/template.doc.mjs +0 -2
  100. package/assets/templates/pages/table-inbox/page.tsx +3 -6
  101. package/assets/templates/pages/theme-showcase/page.tsx +724 -792
  102. package/assets/templates/pages/theme-showcase/template.doc.mjs +4 -5
  103. package/assets/templates/themes/butter/butterTheme.ts +2 -2
  104. package/assets/templates/themes/gothic/gothicTheme.ts +16 -0
  105. package/assets/templates/themes/matcha/matchaTheme.ts +1 -1
  106. package/assets/templates/themes/neutral/neutralTheme.ts +6 -0
  107. package/assets/templates/themes/stone/stoneTheme.ts +1 -1
  108. package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +1 -1
  109. package/assets/templates/themes/y2k/y2kTheme.ts +2 -2
  110. package/authoring/doctypes/template/type.ts +1 -0
  111. package/clients/cli/commands/docs.doc.mjs +5 -1
  112. package/clients/cli/commands/docs.mjs +30 -2
  113. package/clients/cli/commands/experimental/icon.mjs +56 -14
  114. package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
  115. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +2 -1
  116. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +2 -2
  117. package/clients/cli/commands/experimental-render.doc.mjs +1 -1
  118. package/clients/cli/commands/swizzle.doc.mjs +12 -3
  119. package/clients/cli/commands/swizzle.mjs +33 -9
  120. package/clients/cli/lib/resolve-theme.mjs +16 -7
  121. package/foundation/discovery/component-loader.d.mts +1 -1
  122. package/foundation/discovery/doc-types.mjs +9 -2
  123. package/foundation/discovery/hook-discovery.mjs +31 -8
  124. package/foundation/discovery/icon-ranking.d.mts +27 -3
  125. package/foundation/discovery/icon-ranking.mjs +125 -8
  126. package/foundation/discovery/icon-set-checks.mjs +44 -35
  127. package/foundation/discovery/icon-set-discovery.d.mts +13 -0
  128. package/foundation/discovery/icon-set-discovery.mjs +25 -0
  129. package/foundation/discovery/icon-set-writer.d.mts +258 -20
  130. package/foundation/discovery/icon-set-writer.mjs +785 -87
  131. package/foundation/discovery/module-exports.d.mts +3 -2
  132. package/foundation/discovery/module-exports.mjs +167 -37
  133. package/foundation/doc-compiler/import.d.mts +5 -1
  134. package/foundation/doc-compiler/import.mjs +40 -6
  135. package/foundation/fs/import-url.d.mts +20 -0
  136. package/foundation/fs/import-url.mjs +22 -0
  137. package/foundation/fs/module-loader.d.mts +24 -3
  138. package/foundation/fs/module-loader.mjs +69 -47
  139. package/foundation/fs/paths.d.mts +2 -1
  140. package/foundation/fs/paths.mjs +3 -4
  141. package/foundation/render/charts.d.mts +59 -0
  142. package/foundation/render/charts.mjs +216 -0
  143. package/foundation/render/embedded-imports.d.mts +7 -7
  144. package/foundation/render/embedded-imports.mjs +63 -54
  145. package/foundation/render/page-host.d.mts +4 -0
  146. package/foundation/render/page-host.mjs +45 -0
  147. package/foundation/render/page-worker.mjs +350 -57
  148. package/foundation/render/render-page.d.mts +11 -6
  149. package/foundation/render/render-page.mjs +164 -54
  150. package/foundation/render/ts-paths.d.mts +63 -0
  151. package/foundation/render/ts-paths.mjs +138 -0
  152. package/foundation/response/error-codes.doc.mjs +3 -3
  153. package/foundation/response/error-codes.mjs +3 -2
  154. package/foundation/text/levenshtein.d.mts +6 -1
  155. package/foundation/text/levenshtein.mjs +25 -9
  156. package/foundation/text/shell-arg.d.mts +14 -0
  157. package/foundation/text/shell-arg.mjs +17 -0
  158. package/foundation/text/suggest-order.d.mts +8 -1
  159. package/foundation/text/suggest-order.mjs +72 -6
  160. package/package.json +7 -6
@@ -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 inside a 320px-tall parent, which bounds its scroll area. Give the Table's parent a height, fixed or relative, or a flex child, so windowing can bound the rows; with no height every row renders. 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', 'VStack'],
14
+ };
@@ -0,0 +1,41 @@
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
+ import {VStack} from '@astryxdesign/core/Layout';
11
+
12
+ interface Product extends Record<string, unknown> {
13
+ id: string;
14
+ name: string;
15
+ }
16
+
17
+ const products: Product[] = Array.from({length: 1000}, (_, index) => ({
18
+ id: `product-${index}`,
19
+ name: `Product ${index + 1}`,
20
+ }));
21
+ const columns: TableColumn<Product>[] = [{key: 'name', header: 'Product'}];
22
+
23
+ export default function RowsVirtualizationHookUsage() {
24
+ const virtualization = useTableRowsVirtualization({
25
+ rowHeight: 56,
26
+ initialViewportHeight: 320,
27
+ });
28
+ // Give the Table's parent a height, fixed or relative, or a flex child, so
29
+ // windowing can bound the rows; with no height every row renders.
30
+ // initialViewportHeight only sizes the first window.
31
+ return (
32
+ <VStack height={320}>
33
+ <Table
34
+ data={products}
35
+ columns={columns}
36
+ idKey="id"
37
+ virtualization={virtualization}
38
+ />
39
+ </VStack>
40
+ );
41
+ }
@@ -7,7 +7,7 @@ export const doc = {
7
7
  name: 'useTableRowIndex — Numbered Rows',
8
8
  displayName: 'useTableRowIndex — Numbered Rows',
9
9
  description:
10
- 'A table with a prepended row-number column via useTableRowIndex. Numbering is monospaced, right-aligned, and follows the rendered data order.',
10
+ 'A table with a prepended row-number column via useTableRowIndex. Numbering is monospaced, right-aligned, and follows the rows the table renders.',
11
11
  isReady: true,
12
12
  aspectRatio: 16 / 9,
13
13
  componentsUsed: ['Table'],
@@ -32,8 +32,8 @@ const columns: TableColumn<Track>[] = [
32
32
  ];
33
33
 
34
34
  export default function TableRowIndexTable() {
35
- // Pass the rendered data array — numbering follows its order.
36
- const rowIndex = useTableRowIndex<Track>({data: tracks});
35
+ // Table gives each row its position, so numbering follows the rendered rows.
36
+ const rowIndex = useTableRowIndex<Track>();
37
37
 
38
38
  return (
39
39
  <Table
@@ -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
+ }