@astryxdesign/cli 0.7.4 → 0.7.5-canary.2a50a80

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 (161) hide show
  1. package/README.md +18 -18
  2. package/api/icon/_adapter.d.mts +3 -2
  3. package/api/icon/_adapter.mjs +16 -3
  4. package/api/icon/_authoring.d.mts +5 -1
  5. package/api/icon/_authoring.mjs +478 -63
  6. package/api/icon/_options.d.mts +11 -0
  7. package/api/icon/_options.mjs +39 -4
  8. package/api/icon/_records.d.mts +19 -0
  9. package/api/icon/_records.mjs +25 -0
  10. package/api/icon/add/add.d.mts +3 -3
  11. package/api/icon/add/add.mjs +227 -14
  12. package/api/icon/all-or-nothing.test.mjs +283 -0
  13. package/api/icon/detail/detail.mjs +2 -13
  14. package/api/icon/error-codes.test.mjs +14 -7
  15. package/api/icon/icon.d.mts +2 -2
  16. package/api/icon/icon.doc.mjs +30 -2
  17. package/api/icon/icon.mjs +57 -8
  18. package/api/icon/icon.test.mjs +133 -1
  19. package/api/icon/icon.type.d.mts +126 -1
  20. package/api/icon/icon.type.mjs +67 -3
  21. package/api/icon/iconAdd.doc.mjs +22 -6
  22. package/api/icon/iconMap.doc.mjs +24 -8
  23. package/api/icon/iconNewDefinition.doc.mjs +2 -2
  24. package/api/icon/iconNewSet.doc.mjs +30 -2
  25. package/api/icon/iconUse.doc.mjs +4 -1
  26. package/api/icon/map/map.d.mts +4 -4
  27. package/api/icon/map/map.mjs +134 -9
  28. package/api/icon/new-definition/new-definition.mjs +6 -2
  29. package/api/icon/new-set/new-set.mjs +2 -2
  30. package/api/icon/new-set/new-set.test.mjs +60 -10
  31. package/api/icon/option-pairs.test.mjs +368 -0
  32. package/api/icon/search/search.d.mts +10 -0
  33. package/api/icon/search/search.mjs +55 -14
  34. package/api/icon/use/use.mjs +2 -13
  35. package/api/integration/add-helpers.d.mts +15 -1
  36. package/api/integration/add-helpers.mjs +1 -1
  37. package/api/integration/validate-integration.type.d.mts +3 -2
  38. package/api/integration/validate-integration.type.mjs +3 -2
  39. package/api/template/template.type.d.mts +2 -1
  40. package/api/template/template.type.mjs +1 -1
  41. package/assets/discover/official-packages.json +4 -0
  42. package/assets/docs/tree/icon-definitions.doc.mjs +2 -2
  43. package/assets/docs/tree/icon-set-files.doc.mjs +1 -1
  44. package/assets/docs/tree/icon-sets.doc.mjs +50 -20
  45. package/assets/icons/definitions/activity.doc.mjs +1 -1
  46. package/assets/icons/definitions/alignCenter.doc.mjs +9 -0
  47. package/assets/icons/definitions/alignEnd.doc.mjs +10 -0
  48. package/assets/icons/definitions/alignStart.doc.mjs +10 -0
  49. package/assets/icons/definitions/archive.doc.mjs +1 -1
  50. package/assets/icons/definitions/arrowsUpDown.doc.mjs +1 -1
  51. package/assets/icons/definitions/attach.doc.mjs +1 -1
  52. package/assets/icons/definitions/audio.doc.mjs +1 -1
  53. package/assets/icons/definitions/cart.doc.mjs +1 -1
  54. package/assets/icons/definitions/checkDouble.doc.mjs +1 -1
  55. package/assets/icons/definitions/chevronsLeft.doc.mjs +1 -1
  56. package/assets/icons/definitions/chevronsRight.doc.mjs +1 -1
  57. package/assets/icons/definitions/close.doc.mjs +1 -1
  58. package/assets/icons/definitions/collapse.doc.mjs +1 -1
  59. package/assets/icons/definitions/compose.doc.mjs +1 -1
  60. package/assets/icons/definitions/conversation.doc.mjs +1 -1
  61. package/assets/icons/definitions/copy.doc.mjs +1 -1
  62. package/assets/icons/definitions/cpu.doc.mjs +9 -0
  63. package/assets/icons/definitions/database.doc.mjs +1 -1
  64. package/assets/icons/definitions/desktop.doc.mjs +1 -1
  65. package/assets/icons/definitions/discount.doc.mjs +1 -1
  66. package/assets/icons/definitions/download.doc.mjs +1 -1
  67. package/assets/icons/definitions/emoji.doc.mjs +1 -1
  68. package/assets/icons/definitions/error.doc.mjs +1 -1
  69. package/assets/icons/definitions/expand.doc.mjs +1 -1
  70. package/assets/icons/definitions/experiment.doc.mjs +1 -1
  71. package/assets/icons/definitions/externalLink.doc.mjs +7 -1
  72. package/assets/icons/definitions/eyeSlash.doc.mjs +1 -1
  73. package/assets/icons/definitions/flipHorizontal.doc.mjs +9 -0
  74. package/assets/icons/definitions/flipVertical.doc.mjs +9 -0
  75. package/assets/icons/definitions/folderAdd.doc.mjs +1 -1
  76. package/assets/icons/definitions/gitBranch.doc.mjs +9 -0
  77. package/assets/icons/definitions/gitFork.doc.mjs +9 -0
  78. package/assets/icons/definitions/info.doc.mjs +1 -1
  79. package/assets/icons/definitions/location.doc.mjs +1 -1
  80. package/assets/icons/definitions/mention.doc.mjs +1 -1
  81. package/assets/icons/definitions/menu.doc.mjs +1 -1
  82. package/assets/icons/definitions/microphone.doc.mjs +1 -1
  83. package/assets/icons/definitions/mobile.doc.mjs +1 -1
  84. package/assets/icons/definitions/money.doc.mjs +1 -1
  85. package/assets/icons/definitions/moreHorizontal.doc.mjs +1 -1
  86. package/assets/icons/definitions/notificationActive.doc.mjs +1 -1
  87. package/assets/icons/definitions/notificationOff.doc.mjs +1 -1
  88. package/assets/icons/definitions/panelLeft.doc.mjs +10 -0
  89. package/assets/icons/definitions/panelRight.doc.mjs +10 -0
  90. package/assets/icons/definitions/raiseHand.doc.mjs +1 -1
  91. package/assets/icons/definitions/redo.doc.mjs +1 -1
  92. package/assets/icons/definitions/refresh.doc.mjs +1 -1
  93. package/assets/icons/definitions/rotate.doc.mjs +9 -0
  94. package/assets/icons/definitions/scale.doc.mjs +10 -0
  95. package/assets/icons/definitions/search.doc.mjs +1 -1
  96. package/assets/icons/definitions/send.doc.mjs +1 -1
  97. package/assets/icons/definitions/settings.doc.mjs +1 -1
  98. package/assets/icons/definitions/star.doc.mjs +1 -1
  99. package/assets/icons/definitions/stop.doc.mjs +1 -1
  100. package/assets/icons/definitions/success.doc.mjs +1 -1
  101. package/assets/icons/definitions/textCase.doc.mjs +9 -0
  102. package/assets/icons/definitions/thumbsDown.doc.mjs +1 -1
  103. package/assets/icons/definitions/thumbsUp.doc.mjs +1 -1
  104. package/assets/icons/definitions/trendDown.doc.mjs +7 -1
  105. package/assets/icons/definitions/trendUp.doc.mjs +1 -1
  106. package/assets/icons/definitions/undo.doc.mjs +1 -1
  107. package/assets/icons/definitions/upload.doc.mjs +1 -1
  108. package/assets/icons/definitions/userAdd.doc.mjs +1 -1
  109. package/assets/icons/definitions/warning.doc.mjs +1 -1
  110. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +15 -14
  111. package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +30 -30
  112. package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +15 -14
  113. package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +15 -14
  114. package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +17 -16
  115. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +29 -29
  116. package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +9 -8
  117. package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +39 -41
  118. package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -0
  119. package/assets/templates/pages/form-wizard-inline/template.doc.mjs +6 -1
  120. package/assets/templates/pages/table-comparison/template.doc.mjs +1 -0
  121. package/assets/templates/pages/table-tree/template.doc.mjs +3 -0
  122. package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +4 -4
  123. package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +6 -0
  124. package/authoring/doctypes/icon-set/parse.d.mts +1 -0
  125. package/authoring/doctypes/icon-set/parse.mjs +1 -0
  126. package/authoring/doctypes/icon-set/type.ts +5 -0
  127. package/authoring/doctypes/template/template.doc.mjs +1 -1
  128. package/authoring/doctypes/template/type.ts +2 -1
  129. package/clients/cli/commands/doctor.mjs +16 -17
  130. package/clients/cli/commands/experimental/icon.mjs +167 -35
  131. package/clients/cli/commands/experimental-icon-add.doc.mjs +14 -4
  132. package/clients/cli/commands/experimental-icon-map.doc.mjs +12 -2
  133. package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +1 -1
  134. package/clients/cli/commands/experimental-icon-new-set.doc.mjs +28 -1
  135. package/clients/cli/commands/experimental-icon.doc.mjs +18 -2
  136. package/clients/cli/commands/experimental.doc.mjs +2 -1
  137. package/clients/cli/commands/icon-authoring.test.mjs +1823 -13
  138. package/clients/cli/commands/icon-options-wiring.test.mjs +158 -0
  139. package/clients/cli/commands/icon.test.mjs +1 -1
  140. package/clients/cli/commands/template.mjs +4 -1
  141. package/foundation/discovery/component-discovery.d.mts +2 -1
  142. package/foundation/discovery/component-discovery.export-names.test.mjs +41 -0
  143. package/foundation/discovery/component-discovery.mjs +13 -7
  144. package/foundation/discovery/icon-set-checks.d.mts +43 -9
  145. package/foundation/discovery/icon-set-checks.mjs +296 -21
  146. package/foundation/discovery/icon-set-checks.test.mjs +125 -12
  147. package/foundation/discovery/icon-set-writer.d.mts +192 -3
  148. package/foundation/discovery/icon-set-writer.mjs +608 -34
  149. package/foundation/discovery/icon-set-writer.test.mjs +26 -0
  150. package/foundation/discovery/module-exports.mjs +82 -25
  151. package/foundation/discovery/module-exports.test.mjs +38 -1
  152. package/foundation/discovery/package-exports.d.mts +13 -0
  153. package/foundation/discovery/package-exports.mjs +40 -1
  154. package/foundation/discovery/template-icons.d.mts +6 -0
  155. package/foundation/discovery/template-icons.mjs +98 -10
  156. package/foundation/discovery/template-icons.test.mjs +103 -0
  157. package/foundation/doc-compiler/tree.mjs +3 -1
  158. package/foundation/response/response-types.doc.mjs +25 -1
  159. package/foundation/text/string-utils.mjs +33 -0
  160. package/foundation/text/string-utils.test.mjs +17 -0
  161. package/package.json +9 -9
@@ -24,7 +24,7 @@ export const docs = {
24
24
  'integration icons',
25
25
  ],
26
26
  description:
27
- 'Experimental. Ship an icon set: register each icon against an icon definition, so apps find icons by meaning and templates use your icons.',
27
+ 'Ship an icon set: register each icon against an icon definition, so apps find icons by meaning and templates use your icons.',
28
28
  sections: [
29
29
  {
30
30
  id: 'experimental',
@@ -42,7 +42,7 @@ export const docs = {
42
42
  content: [
43
43
  {
44
44
  type: 'prose',
45
- text: 'Astryx keeps a list of icon definitions: one file per meaning, like `close` or `delete` (`astryx docs cli/experimental/icon-definitions`). An icon set registers which of its icons draws each definition, in the `map` of its data file. Templates say which definition each of their icons draws, so a project that uses your set gets your icon for every definition you map. Every set maps the built-in definitions, the names Core renders itself.',
45
+ text: 'Astryx keeps a list of icon definitions: one file per meaning, like `close` or `delete` (`astryx docs cli/experimental/icon-definitions`). An icon set registers which of its icons draws each definition, in the `map` of its data file; one icon may draw several definitions (`file` and `document` can both be your `document` icon). Templates say which definition each of their icons draws, so a project that uses your set gets your icon for every definition you map. Every set maps the built-in definitions, the names Core renders itself.',
46
46
  },
47
47
  {
48
48
  type: 'prose',
@@ -61,7 +61,11 @@ export const docs = {
61
61
  },
62
62
  {
63
63
  type: 'prose',
64
- text: "`outline.doc.mjs` is the descriptor: name, display name, description, and `license`, the SPDX license of the artwork (it starts as your package's own). `outline.icons.json` starts with no icons and an empty `map`; its `module` is your package name. `outline.generated.js` is the set's generated module, with its declaration file `outline.generated.d.ts`: the CLI writes both, and every icon and the theme map are exports of it. Every field is in {@link schema:icon-set-doc} and {@link schema:icon-set-data}.",
64
+ text: "`outline.doc.mjs` is the descriptor: name, display name and description (`--display-name`, `--description`), and `license`, the SPDX license of the artwork (it starts as your package's own). `outline.icons.json` starts with no icons and an empty `map`; its `module` is your package name. `outline.generated.js` is the set's generated module, with its declaration file `outline.generated.d.ts`: the CLI writes both, and every icon and the theme map are exports of it. Every field is in {@link schema:icon-set-doc} and {@link schema:icon-set-data}.",
65
+ },
66
+ {
67
+ type: 'prose',
68
+ text: "The set's icons import from your package by name, so your package's entry must re-export the generated module. The command writes only the set's own files: your entry, `exports`, `main`, `types`, `files`, peers, and scripts are yours, and the receipt names each change to make as text to copy. For an entry file in the package (and the declaration file package.json names) that is the line `export * from './icon-sets/outline/outline.generated.js';`, relative to it; for a package with no entry, `index.js` and `index.d.ts` with that line and the package.json `main`, `types`, and `exports` that name them; for a built or CommonJS entry, the line to add to the source it is built from. `integration check` names the same change until you make it, and the receipt also names the peers and the `typecheck` script to add. `integration check --strict` type-checks the set's doc files with your package's TypeScript; the receipt says when it is missing (`npm install -D typescript@6`).",
65
69
  },
66
70
  ],
67
71
  },
@@ -71,7 +75,7 @@ export const docs = {
71
75
  content: [
72
76
  {
73
77
  type: 'prose',
74
- text: 'Pick an icon from the library and ask which definitions fit it. Nothing is written yet:',
78
+ text: 'Pick an icon from the library and ask which definitions fit it. Nothing is written yet. To read every icon a set already has, one line each with its words and the definitions it draws, run `astryx experimental icon --set <set> --all-icons`; `astryx experimental icon <set>/<id>` reads one, or says the id does not exist:',
75
79
  },
76
80
  {
77
81
  type: 'code',
@@ -98,11 +102,11 @@ export const docs = {
98
102
  {
99
103
  type: 'code',
100
104
  lang: 'bash',
101
- code: "astryx experimental icon add RotateCw --from @acme/glyph-library --new-definition rotate --description 'Rotate an image or shape.' --words turn,spin",
105
+ code: "astryx experimental icon add Dice5 --from @acme/glyph-library --new-definition random --description 'Pick something at random.' --words dice,shuffle,chance",
102
106
  },
103
107
  {
104
108
  type: 'prose',
105
- text: '`experimental icon map <definition> <icon>` points a definition at an icon the set already has, and `--remove` drops an entry. `experimental icon new-definition <name> --description ... --words ... --icon <id>` adds your own definition for an icon you already have.',
109
+ text: '`experimental icon map <definition> <icon>` points a definition at an icon the set already has (a definition is named in camelCase, `eyeSlash`, or by the kebab id the definitions list shows, `eye-slash`; an icon by its id, its export name in any case, or another name its library exports it as, such as `trash-2`, never by one word of its id), `experimental icon map --pairs close=x-mark,search=magnifying-glass` writes many entries at once (checked together, all or none; an entry the map already has is replaced, and the receipt shows what it was), and `--remove` drops an entry. `experimental icon new-definition <name> --description ... --words ... --icon <id>` adds your own definition for an icon you already have. `experimental icon --definitions` lists every Astryx definition, built in or not, with its words (`--json` for a script).',
106
110
  },
107
111
  ],
108
112
  },
@@ -117,11 +121,29 @@ export const docs = {
117
121
  },
118
122
  {
119
123
  type: 'prose',
120
- text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, and `map` is filled only where a definition's name or one of its words is an icon's id. Run it again after a library release to refresh the icons; `map` entries whose icon still exists are kept, and the receipt names any that lost theirs.",
124
+ text: "Every component the library exports becomes an icon (an alias of one component is recorded once), named `<Name>Icon`, with an id from its name (`Squares2X2Icon` is `squares-2x2`: a dimension stays one word). `map` is filled only where a definition's name is an icon's id (`delete` → icon `delete`), and the receipt lists those entries under Mapped by name: a library can draw another meaning under the same name (one library's `delete` is a backspace key), so check each. An icon whose id is only one of a definition's words (`trash` for `delete`) may mean something else in this library, so the receipt lists it under Suggestions, with the `experimental icon map <definition> <icon>` command for each, and writes nothing for it: check the meaning, then run the ones that fit. Run it again after a library release to refresh the icons that library supplies; `map` entries whose icon still exists are kept, and the receipt names any icon the library dropped, any icon `--exclude` left out, and the `map` entries each took with it. Icons you added from your own files or another library are left as they are. An icon you already have is known by the library export it re-exports, so it keeps its export name exactly, its `map` entries, variants, and words, even when a newer CLI spells its id differently or your `--exclude` lets a library prefix come off new ids; the receipt lists each changed id under `renamed`. A refresh with `--dry-run` writes nothing and prints the Mapped by name and Suggestions lists again; `--display-name` and `--description` on a refresh rewrite the descriptor. Variants added with `add --variant … --all` are kept too; run that `add` again to pick up icons the release added. `experimental icon --list` shows how many definitions the set maps.",
125
+ },
126
+ {
127
+ type: 'prose',
128
+ text: "With a package or package subpath, it also records the installed library and version as the data file's `source`, so `integration check` warns when your dependency moves to another version; copies the library's LICENSE (and NOTICE) files into the set directory; and sets the descriptor's `license` to the library's. A set you started without `--from` gets the same the first time a refresh records its source, unless you already changed `license`: a `license` you set is kept (the receipt names the library's), and every later refresh keeps it too. Your package.json `license` is never changed. Edit `license` when the artwork's license differs from the library's package license.",
121
129
  },
122
130
  {
123
131
  type: 'prose',
124
- text: 'A library whose icons are data (objects or SVG strings) has no components to find: create the set, declare an `adapter` in its data file (see library shapes), and run the command again; every data export then becomes an icon through the adapter. When every icon export shares a leading word, such as `feather` in `featherEye` and `featherSun`, ids and export names leave it out: `featherEye` becomes id `eye`, exported as `EyeIcon`. The prefix is read over icon-like exports only: SCREAMING_CASE constants (`README`, `VERSION`), number and boolean exports, and, next to components or icon objects, plain strings are never icons. Leave out any other export that is not an icon with `--exclude meta,version`. `experimental icon add` reads the prefix the same way, and reuses the icon an export already has, so its commands need no `--id`.',
132
+ text: 'A library with a module per style supplies variants. Declare them when you create the set, then add a variant for every icon in one run:',
133
+ },
134
+ {
135
+ type: 'code',
136
+ lang: 'bash',
137
+ code: `astryx experimental icon new-set heroicons --from @heroicons/react/24/outline --variants outline,solid --default-variant outline --description 'Heroicons, outline and solid.'
138
+ astryx experimental icon add --variant solid --from @heroicons/react/24/solid --all`,
139
+ },
140
+ {
141
+ type: 'prose',
142
+ text: "A library that redraws its artwork for small sizes (Heroicons' 20px mini and 16px micro) ships each of those as its own set in its own package (their export names match the 24px ones), not as variants: a variant's size comes from CSS. `--variants` lists the variants; `--default-variant` names the one each icon's own export draws (the first variant when omitted). `--all` adds the variant for every icon whose id an export of `--from` has (`TrashIcon` in the solid module becomes `TrashSolidIcon`, the solid variant of `trash`), and the receipt lists the icons the module has no export for. Running it again changes nothing.",
143
+ },
144
+ {
145
+ type: 'prose',
146
+ text: 'A library whose icons are data (objects or SVG strings) has no components to find: create the set, declare an `adapter` in its data file (see library shapes), and run the command again; every data export then becomes an icon through the adapter. When every icon export shares a leading word, such as `feather` in `featherEye` and `featherSun`, ids and export names leave it out: `featherEye` becomes id `eye`, exported as `EyeIcon`. The prefix is read over icon-like exports only: SCREAMING_CASE constants (`README`, `VERSION`), number and boolean exports, and, next to components or icon objects, plain strings are never icons. Components named `…Provider` or `…Context` are never icons either. Leave out any other export that is not an icon with `--exclude meta,version`: the data file keeps the list in `exclude`, so a refresh leaves them out too. When a library exports one icon under several names (`Trash2` and `Trash`), the icon is recorded once and its other names become words, so `experimental icon trash-2` finds it and `experimental icon map delete trash-2` maps it. `experimental icon add` reads the prefix the same way, and reuses the icon an export already has, so its commands need no `--id`.',
125
147
  },
126
148
  ],
127
149
  },
@@ -146,7 +168,7 @@ export const docs = {
146
168
  },
147
169
  {
148
170
  type: 'prose',
149
- text: "`experimental icon add` writes the set's generated module (`generated` in the data file) and its declaration file, which re-exports each component's own types and types each adapted icon as `ComponentType<SVGProps<SVGSVGElement>>`. Add one line to the file your package's entry points at, and to its types; the receipt names it:",
171
+ text: "`experimental icon add` writes the set's generated module (`generated` in the data file) and its declaration file, which re-exports each component's own types and types each adapted icon as `ComponentType<SVGProps<SVGSVGElement>>`. Add this line to your package's entry and its types; `experimental icon new-set` names the exact line and file in its receipt (see add an icon set):",
150
172
  },
151
173
  {
152
174
  type: 'code',
@@ -155,7 +177,7 @@ export const docs = {
155
177
  },
156
178
  {
157
179
  type: 'prose',
158
- text: 'An optional render test you can copy:',
180
+ text: "An optional render test you can copy. Save it inside your package directory and run it there, since it imports your package by name through its `exports`, and install `react-dom` first (`npm install -D react-dom`). A library may add its own classes beside yours, so it checks the class list. A library that sets `width` and `height` attributes (24, say) still fills its box: CSS sizing, such as the `Icon` component's, overrides SVG size attributes.",
159
181
  },
160
182
  {
161
183
  type: 'code',
@@ -167,7 +189,7 @@ import * as icons from '@acme/icons';
167
189
  for (const [name, Icon] of Object.entries(icons)) {
168
190
  if (!name.endsWith('Icon')) continue;
169
191
  const html = renderToStaticMarkup(createElement(Icon, {className: 'x'}));
170
- if (!html.includes('class="x"')) throw new Error(\`\${name} drops className\`);
192
+ if (!/class="([^"]* )?x( [^"]*)?"/.test(html)) throw new Error(\`\${name} drops className\`);
171
193
  if (!html.includes('currentColor')) throw new Error(\`\${name} has a fixed color\`);
172
194
  }`,
173
195
  },
@@ -191,7 +213,7 @@ for (const [name, Icon] of Object.entries(icons)) {
191
213
  ],
192
214
  [
193
215
  'A subpath per style',
194
- '`experimental icon add Bin --from @acme/glyph-library/solid --id bin --variant solid` (a variant of an icon you added; the set must declare it in `variants`)',
216
+ '`experimental icon add --variant solid --from @acme/glyph-library/solid --all` for every icon at once, or `experimental icon add Bin --from @acme/glyph-library/solid --id bin --variant solid` for one (the set must declare the variant: `new-set --variants`)',
195
217
  ],
196
218
  [
197
219
  'One file per icon, default export',
@@ -207,7 +229,7 @@ for (const [name, Icon] of Object.entries(icons)) {
207
229
  ],
208
230
  [
209
231
  'Your own component files',
210
- '`experimental icon add Rocket --from ./src/icons/rocket.js --definition rocket`',
232
+ "`experimental icon add Rocket --from ./src/icons/rocket.js --definition rocket`, and `--id rocket --variant solid` for its other looks. The file exports a component named as written (no library prefix is taken off), with a declaration file beside it (`rocket.d.ts`) or written in TypeScript, since the set's types re-export its own; when package.json lists `files` and none covers it, the receipt names the `files` array that publishes its folder.",
211
233
  ],
212
234
  ],
213
235
  },
@@ -258,7 +280,7 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
258
280
  content: [
259
281
  {
260
282
  type: 'prose',
261
- text: "`astryx integration check` reads the set without running your icons. An unmapped built-in definition is an error that names the definition's description and words, so you or your agent can pick the icon; the message suggests an `experimental icon map` command only when one of your icons has the definition's name or one of its words as its whole id, and never guesses. Its icon-set codes:",
283
+ text: "`astryx integration check` reads the set without running your icons. An unmapped built-in definition is an error that names the definition's description and words and the `experimental icon map <definition> <icon id>` command that fixes it, so you or your agent can pick the icon. It names a search of your set (`experimental icon <word> --set <set>`) only when that search finds icons, and suggests one icon: the first of the suggestions `experimental icon new-set` gives for that definition. It never matches part of a word, and never writes a suggestion. Its icon-set codes:",
262
284
  },
263
285
  {
264
286
  type: 'list',
@@ -286,7 +308,7 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
286
308
  },
287
309
  {
288
310
  type: 'prose',
289
- text: 'Errors fail the check. Warnings fail only with `--strict`. A set that maps every built-in definition and every definition it declares passes `--strict`, which integrations run in their build ({@link generic:checks}). The flow, start to finish: `experimental icon new-set` → `integration check` → `experimental icon add` (or `experimental icon map`) for each definition it lists → `integration check` passes.',
311
+ text: 'Errors fail the check. Warnings fail only with `--strict`. A set that maps every built-in definition and every definition it declares passes `--strict`, which integrations run in their build ({@link generic:checks}). The flow, start to finish: `experimental icon new-set` → `npm install -D typescript@6` when the receipt asks → `integration check` → `experimental icon add` (or `experimental icon map`) for each definition it lists → `integration check` passes.',
290
312
  },
291
313
  ],
292
314
  },
@@ -299,8 +321,12 @@ export const brand = defineTheme({name: 'brand', icons: themeIcons});`,
299
321
  style: 'unordered',
300
322
  items: [
301
323
  'Run `astryx integration verify` yourself before publishing. Do not put it in `prepublishOnly`: under `npm publish --dry-run` its own `npm pack` becomes a dry run too, and it checks nothing.',
302
- "Declare `@astryxdesign/cli` as an optional peer (`peerDependenciesMeta`). A required peer an app cannot satisfy makes npm remove the app's CLI without a word. Icon sets are experimental, so no version range promises them: any CLI release that has `astryx experimental icon` reads a set, and the format may change in a patch release. A CLI without it reads `experimental` as a manifest key it does not know: `astryx doctor` there warns that your package was published against a newer Astryx CLI, other commands print a one-line nudge to run it, and your icons, icon definitions, and template icon mapping do not appear ({@link generic:versioning}).",
303
- 'Your package needs `react` (the theme map and adapter use it): declare it as a peer, as Core does.',
324
+ "Declare `@astryxdesign/cli` as an optional peer (`peerDependenciesMeta`). A required peer an app cannot satisfy makes npm remove the app's CLI without a word. Icon sets are experimental, so no version range promises them, and the format may change in a patch release. A CLI reads a set only when it knows every key the set's data file uses: a key it does not know withdraws the set, naming the key. `exclude` is read only by a CLI whose data-file reference lists it ({@link schema:icon-set-data}); a set without `exclude` is read by every CLI that has `astryx experimental icon`. A CLI without it reads `experimental` as a manifest key it does not know: `astryx doctor` there warns that your package was published against a newer Astryx CLI, other commands print a one-line nudge to run it, and your icons, icon definitions, and template icon mapping do not appear ({@link generic:versioning}).",
325
+ "Every built-in definition needs an icon, because Core renders it. When your library has no icon with that exact meaning, map the closest one, or add your own artwork as a component file in your package (`experimental icon add <Name> --from ./src/icons/<name>.js --definition <definition>`; a ./ path is named as written). Artwork you draw is yours: note its license beside the library's, for example in a NOTICE file in the set directory.",
326
+ 'The generated declaration file imports React types, so declare `@types/react` as an optional peer for TypeScript users.',
327
+ 'Keep the wrapped library in `dependencies`: your generated module re-exports its components, so apps get it with your package, and `integration check` compares its range with the version the data file records.',
328
+ "`integration check --strict` type-checks the set's doc files; it does not type-check the generated declaration file against React's types. Run `tsc` with `@types/react` installed to check those.",
329
+ 'Your package needs `react` (the theme map and adapter use it) as a peer, as Core does. The `experimental icon new-set` receipt names the peers your package.json does not declare yet, as the JSON to add: `react` (`>=18`), and `@types/react` and `@astryxdesign/cli` (from the release that wrote the set) as optional peers; and the `typecheck` script (`astryx integration check --strict`) when there is none.',
304
330
  ],
305
331
  },
306
332
  ],
@@ -329,7 +355,11 @@ astryx experimental icon use outline # make it the project's icon set`,
329
355
  },
330
356
  {
331
357
  type: 'prose',
332
- text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the set's icon for that definition. An icon the set does not map keeps its original import, and the copy reports every icon as mapped or kept. Nothing is guessed from names.",
358
+ text: "A template declares, in its descriptor's `icons`, the definition each imported icon draws (`{TrashIcon: 'delete'}`). Once the project sets `experimental.iconSet` in astryx.config (`experimental icon use` writes it), each declared icon becomes the set's icon for that definition. An icon the set does not map keeps its original import, and the copy reports every icon as mapped or kept. Nothing is guessed from names. A mapped icon loses its library's sizing props (`size`, `strokeWidth`, `absoluteStrokeWidth`), since a set's icons take their size from CSS; the report names them as `dropped`. Comments on a rewritten import line are kept.",
359
+ },
360
+ {
361
+ type: 'prose',
362
+ text: "Each `icons` key is the name the template imports from its module, not a local alias. When a template imports the same name from two modules, such as `TrashIcon` from a library's outline and solid modules, one key covers both: both draw the same definition. Each then becomes the project set's variant of the same name when its module belongs to an installed set that declares the variant (so solid stays solid), else the set's default.",
333
363
  },
334
364
  ],
335
365
  },
@@ -363,11 +393,11 @@ astryx experimental icon use outline # make it the project's icon set`,
363
393
  ],
364
394
  [
365
395
  '`astryx doctor`',
366
- 'The `icon-sets` check: fails when `experimental.iconSet` names a set that is not installed or was withdrawn (an invalid set, or one whose module does not resolve), saying why, and warns when two packages ship a set by that name or a set was withdrawn.',
396
+ 'In an app, the `icon-sets` check: fails when `experimental.iconSet` names a set that is not installed or was withdrawn (an invalid set, or one whose module does not resolve), saying why, and warns when two packages ship a set by that name or a set was withdrawn. In your icon-set package, check with `astryx integration check` instead: plain `doctor` diagnoses an app.',
367
397
  ],
368
398
  [
369
399
  'JSON types',
370
- '`icon.search`, `icon.detail`, `icon.list`, `icon.use`, `icon.map`, `icon.add`, `icon.definitionMatches`, `icon.newSet`, and `icon.newDefinition`, from the matching `astryx experimental icon` command.',
400
+ '`icon.search`, `icon.detail`, `icon.list`, `icon.setIcons`, `icon.definitions`, `icon.use`, `icon.map`, `icon.mapMany`, `icon.add`, `icon.addVariants`, `icon.definitionMatches`, `icon.newSet`, and `icon.newDefinition`, from the matching `astryx experimental icon` command.',
371
401
  ],
372
402
  ],
373
403
  },
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'activity',
7
7
  description: 'Activity or live status over time.',
8
- words: ['pulse', 'monitor', 'live'],
8
+ words: ['pulse', 'live'],
9
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: 'alignCenter',
7
+ description: 'Center text or items.',
8
+ words: ['center align', 'centre', 'text align'],
9
+ };
@@ -0,0 +1,10 @@
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: 'alignEnd',
7
+ description:
8
+ 'Align text or items to the end edge: the right in a left-to-right layout, the left in a right-to-left one.',
9
+ words: ['align end', 'right align', 'justify right', 'text align'],
10
+ };
@@ -0,0 +1,10 @@
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: 'alignStart',
7
+ description:
8
+ 'Align text or items to the start edge: the left in a left-to-right layout, the right in a right-to-left one.',
9
+ words: ['align start', 'left align', 'justify left', 'text align'],
10
+ };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'archive',
7
7
  description: 'Archive an item.',
8
- words: ['store', 'box'],
8
+ words: ['box', 'stash'],
9
9
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'arrowsUpDown',
7
7
  description: 'Show that a column can be sorted.',
8
- words: ['sort', 'sortable', 'reorder'],
8
+ words: ['sort', 'sortable', 'reorder', 'arrow up down'],
9
9
  builtIn: true,
10
10
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'attach',
7
7
  description: 'Attach a file.',
8
- words: ['attachment', 'paperclip'],
8
+ words: ['attachment', 'paperclip', 'paper clip'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'audio',
7
7
  description: 'Sound or volume.',
8
- words: ['sound', 'volume', 'speaker'],
8
+ words: ['sound', 'volume', 'speaker', 'speaker wave'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'cart',
7
7
  description: 'A shopping cart.',
8
- words: ['shop', 'buy', 'checkout'],
8
+ words: ['shop', 'buy', 'checkout', 'shopping cart'],
9
9
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'checkDouble',
7
7
  description: 'Show that something was copied or read.',
8
- words: ['copied', 'read', 'seen'],
8
+ words: ['copied', 'read', 'seen', 'double check', 'check check'],
9
9
  builtIn: true,
10
10
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'chevronsLeft',
7
7
  description: 'Jump to the first item or page.',
8
- words: ['first', 'start'],
8
+ words: ['first', 'start', 'chevron double left'],
9
9
  builtIn: true,
10
10
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'chevronsRight',
7
7
  description: 'Jump to the last item or page.',
8
- words: ['last', 'end'],
8
+ words: ['last', 'end', 'chevron double right'],
9
9
  builtIn: true,
10
10
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'close',
7
7
  description: 'Dismiss or close a dialog, panel, tag or banner.',
8
- words: ['dismiss', 'cancel', 'remove'],
8
+ words: ['dismiss', 'cancel', 'remove', 'x', 'x mark'],
9
9
  builtIn: true,
10
10
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'collapse',
7
7
  description: 'Make something smaller or exit full screen.',
8
- words: ['minimize', 'shrink'],
8
+ words: ['minimize', 'shrink', 'arrows pointing in'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'compose',
7
7
  description: 'Write something new, such as a message or post.',
8
- words: ['write', 'new message', 'draft'],
8
+ words: ['write', 'new message', 'draft', 'square pen', 'pencil square'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'conversation',
7
7
  description: 'A conversation between people.',
8
- words: ['chat', 'discussion', 'thread'],
8
+ words: ['chat', 'discussion', 'thread', 'chat bubbles', 'messages square'],
9
9
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'copy',
7
7
  description: 'Copy to the clipboard.',
8
- words: ['duplicate', 'clipboard'],
8
+ words: ['duplicate', 'clipboard', 'document duplicate'],
9
9
  builtIn: true,
10
10
  };
@@ -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: 'cpu',
7
+ description: 'A processor or compute resource.',
8
+ words: ['processor', 'chip', 'compute', 'hardware'],
9
+ };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'database',
7
7
  description: 'A database or stored data.',
8
- words: ['data', 'storage', 'table'],
8
+ words: ['data', 'storage'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'desktop',
7
7
  description: 'A desktop computer, or the desktop layout of a page.',
8
- words: ['computer', 'monitor', 'screen'],
8
+ words: ['computer', 'monitor', 'screen', 'computer desktop'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'discount',
7
7
  description: 'A discount, coupon, or percentage off.',
8
- words: ['coupon', 'sale', 'percent'],
8
+ words: ['coupon', 'sale', 'percent', 'percent badge'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'download',
7
7
  description: 'Download a file.',
8
- words: ['export', 'save file'],
8
+ words: ['export', 'save file', 'arrow down tray'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'emoji',
7
7
  description: 'Add an emoji or a reaction.',
8
- words: ['smile', 'reaction', 'face'],
8
+ words: ['smile', 'reaction', 'face', 'face smile'],
9
9
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'error',
7
7
  description: 'Show that something failed.',
8
- words: ['failed', 'invalid', 'problem'],
8
+ words: ['failed', 'invalid', 'problem', 'x circle', 'circle x'],
9
9
  builtIn: true,
10
10
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'expand',
7
7
  description: 'Make something larger or full screen.',
8
- words: ['maximize', 'fullscreen', 'enlarge'],
8
+ words: ['maximize', 'fullscreen', 'enlarge', 'arrows pointing out'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'experiment',
7
7
  description: 'An experiment, test, or lab feature.',
8
- words: ['lab', 'test', 'beta'],
8
+ words: ['lab', 'test', 'beta', 'test tube'],
9
9
  };
@@ -5,6 +5,12 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'externalLink',
7
7
  description: 'Open a link in a new tab or another site.',
8
- words: ['open', 'new tab', 'external'],
8
+ words: [
9
+ 'open',
10
+ 'new tab',
11
+ 'external',
12
+ 'arrow top right on square',
13
+ 'square arrow out up right',
14
+ ],
9
15
  builtIn: true,
10
16
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'eyeSlash',
7
7
  description: 'Hide something, or show that it is hidden.',
8
- words: ['hide', 'hidden', 'invisible'],
8
+ words: ['hide', 'hidden', 'invisible', 'eye off'],
9
9
  builtIn: true,
10
10
  };
@@ -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: 'flipHorizontal',
7
+ description: 'Mirror an image or shape left to right.',
8
+ words: ['mirror', 'flip', 'reflect'],
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: 'flipVertical',
7
+ description: 'Mirror an image or shape top to bottom.',
8
+ words: ['mirror', 'flip', 'upside down'],
9
+ };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'folderAdd',
7
7
  description: 'Create a new folder.',
8
- words: ['new folder'],
8
+ words: ['new folder', 'folder plus'],
9
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: 'gitBranch',
7
+ description: 'A branch of a code repository.',
8
+ words: ['branch', 'version control', 'repository'],
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: 'gitFork',
7
+ description: 'A fork: a copy of a repository someone develops separately.',
8
+ words: ['fork', 'repository', 'version control'],
9
+ };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'info',
7
7
  description: 'Give more information or help.',
8
- words: ['information', 'help', 'about'],
8
+ words: ['information', 'help', 'about', 'information circle'],
9
9
  builtIn: true,
10
10
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'location',
7
7
  description: 'A place or address.',
8
- words: ['place', 'address', 'map'],
8
+ words: ['place', 'address', 'map', 'map pin'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'mention',
7
7
  description: 'Mention someone or show an email address.',
8
- words: ['at', 'email', 'handle'],
8
+ words: ['at', 'email', 'handle', 'at symbol', 'at sign'],
9
9
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'menu',
7
7
  description: 'Open the main navigation menu.',
8
- words: ['hamburger', 'navigation'],
8
+ words: ['hamburger', 'navigation', 'bars'],
9
9
  builtIn: true,
10
10
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'microphone',
7
7
  description: 'Start voice input or audio recording.',
8
- words: ['voice', 'audio', 'record'],
8
+ words: ['voice', 'audio', 'record', 'mic'],
9
9
  builtIn: true,
10
10
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'mobile',
7
7
  description: 'A phone, or the mobile layout of a page.',
8
- words: ['phone', 'smartphone', 'device'],
8
+ words: ['phone', 'smartphone'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'money',
7
7
  description: 'Money, prices or payments.',
8
- words: ['price', 'payment', 'cost', 'currency'],
8
+ words: ['price', 'payment', 'cost', 'currency', 'currency dollar'],
9
9
  };
@@ -5,6 +5,6 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'moreHorizontal',
7
7
  description: 'Open more actions for an item.',
8
- words: ['more', 'overflow', 'actions'],
8
+ words: ['more', 'overflow', 'actions', 'ellipsis', 'ellipsis horizontal'],
9
9
  builtIn: true,
10
10
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'notificationActive',
7
7
  description: 'New or unread notifications.',
8
- words: ['ringing', 'unread', 'new alert'],
8
+ words: ['ringing', 'unread', 'new alert', 'bell alert', 'bell ring'],
9
9
  };
@@ -5,5 +5,5 @@ export default {
5
5
  type: 'icon-definition',
6
6
  name: 'notificationOff',
7
7
  description: 'Turn notifications off, or show that they are muted.',
8
- words: ['mute', 'silence', 'notifications off'],
8
+ words: ['mute', 'silence', 'notifications off', 'bell slash', 'bell off'],
9
9
  };