@atom63/cli 0.0.0-stage → 0.1.0-beta.0

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.
@@ -0,0 +1,497 @@
1
+ /**
2
+ * Words people use for a component that differ from its name. Search expands
3
+ * a query term with these before scoring, so "modal" finds `dialog`. Values
4
+ * are catalog slugs, or token CSS variables (`--a63-…`) that then join the
5
+ * results of any search, most fitting first: the first gets the largest boost.
6
+ * The golden queries in core.test.mjs cover them.
7
+ */
8
+ export const synonyms = {
9
+ bar: ['progress'],
10
+ bubble: ['chat-message'],
11
+ chatbot: ['chat-message', 'chat-composer'],
12
+ checkmark: ['animated-check', 'checkbox'],
13
+ chip: ['toggle-group', 'toggle', 'button', 'badge'],
14
+ choice: ['radio', 'field'],
15
+ combobox: ['autocomplete', 'select'],
16
+ compact: ['table', 'item'],
17
+ composer: ['chat-composer'],
18
+ counter: ['button', 'badge'],
19
+ date: ['calendar'],
20
+ dense: ['table', 'item'],
21
+ density: ['table', 'item'],
22
+ disclosure: ['collapsible', 'accordion'],
23
+ divider: ['separator'],
24
+ dots: ['carousel'],
25
+ dropdown: ['dropdown-menu', 'select'],
26
+ expand: ['collapsible', 'accordion'],
27
+ fold: ['sidebar-nav-tree', 'collapsible', 'accordion'],
28
+ folding: ['sidebar-nav-tree', 'collapsible', 'accordion'],
29
+ gradient: [
30
+ '--a63-gradient-brand-fade',
31
+ '--a63-gradient-brand',
32
+ '--a63-gradient-scrim',
33
+ '--a63-gradient-brand-subtle',
34
+ ],
35
+ grid: ['table'],
36
+ hero: ['--a63-gradient-brand-fade', '--a63-gradient-brand'],
37
+ hint: ['tooltip', 'kbd'],
38
+ keyboard: ['kbd'],
39
+ label: ['label', 'badge'],
40
+ loader: ['spinner', 'skeleton', 'progress'],
41
+ loading: ['spinner', 'skeleton', 'progress'],
42
+ modal: ['dialog', 'alert-dialog', 'drawer', 'sheet'],
43
+ nav: ['sidebar-nav-tree', 'navigation-menu', 'sidebar'],
44
+ notification: ['toaster', 'alert'],
45
+ otp: ['input-otp'],
46
+ pager: ['pagination'],
47
+ palette: ['command'],
48
+ panel: ['sheet', 'drawer', 'card'],
49
+ picker: ['select', 'calendar', 'segmented-control'],
50
+ pill: ['toggle-group', 'badge'],
51
+ popup: ['popover', 'hover-card', 'tooltip'],
52
+ profile: ['avatar'],
53
+ range: ['slider'],
54
+ review: ['rating'],
55
+ row: ['item', 'table'],
56
+ selectable: ['radio', 'toggle-group'],
57
+ sheet: ['drawer', 'sheet'],
58
+ shortcut: ['kbd'],
59
+ slideshow: ['carousel'],
60
+ snackbar: ['toaster'],
61
+ spinner: ['spinner'],
62
+ star: ['rating'],
63
+ stars: ['rating'],
64
+ stepper: ['progress'],
65
+ switcher: ['segmented-control', 'tabs', 'toggle-group'],
66
+ tag: ['badge'],
67
+ textbox: ['input', 'textarea'],
68
+ tile: ['radio', 'field'],
69
+ toast: ['toaster'],
70
+ toggle: ['switch', 'toggle', 'toggle-group'],
71
+ typing: ['chat-typing-indicator'],
72
+ tree: ['sidebar-nav-tree'],
73
+ unread: ['button', 'badge'],
74
+ }
75
+
76
+ /*
77
+ * Entries other than components that a word or phrase should surface:
78
+ * tokens, docs pages, story examples and templates, as `kind:id`. Search adds
79
+ * each one for a query that contains the key (as whole words), even a token
80
+ * or an example it would not list otherwise, and ranks the first highest.
81
+ * `note` replaces the entry's summary, to say what to use from it. The golden
82
+ * queries in core.test.mjs cover them.
83
+ */
84
+ const gradients = [
85
+ {
86
+ id: 'token:--a63-gradient-brand',
87
+ note: 'Brand gradient for heroes and banners: background-image, bg-(image:--a63-gradient-brand).',
88
+ },
89
+ {
90
+ id: 'token:--a63-gradient-brand-subtle',
91
+ note: 'Quiet brand gradient for illustration backgrounds and cards.',
92
+ },
93
+ {
94
+ id: 'token:--a63-gradient-scrim',
95
+ note: 'Fade to dark under text over a photo, such as a hero title.',
96
+ },
97
+ { id: 'doc:foundation-colors', note: 'Colors page, "Gradients": the four gradient tokens.' },
98
+ {
99
+ id: 'token:--a63-gradient-brand-fade',
100
+ note: 'Hero that fades from the brand into the page; keep overlay controls in its dark zone.',
101
+ },
102
+ ]
103
+
104
+ const displayType = [
105
+ {
106
+ id: 'component:amount',
107
+ note: 'Hero amounts (a balance, a price, the amount to send): <Amount value={13.25} currency="USD" /> draws text-display (size="lg" for text-display-large) with the cents in amount-fraction (fraction="baseline" keeps them on the baseline), tabular figures and one label. iOS: AtomAmountText(13.25, currencyCode: "USD").',
108
+ },
109
+ {
110
+ id: 'doc:foundation-typography',
111
+ note: 'Display roles text-display (40px) and text-display-large (56px) for balances, prices and hero numbers; wrap cents in amount-fraction. iOS: AtomAmountText(13.25, currencyCode: "USD") and .atomDisplayFont().',
112
+ },
113
+ {
114
+ id: 'token:--a63-type-display-font-size',
115
+ note: 'The display text role (10xl, 40px): Tailwind text-display or text-display-strong; iOS AtomDisplayRole.display.',
116
+ },
117
+ {
118
+ id: 'token:--a63-type-display-large-font-size',
119
+ note: 'The display-large text role (11xl, 56px): Tailwind text-display-large; iOS AtomDisplayRole.displayLarge.',
120
+ },
121
+ ]
122
+
123
+ const persistentSheet = [
124
+ {
125
+ id: 'example:drawer/PersistentSheet',
126
+ note: 'A non-modal bottom sheet over a map: <Drawer modal={false} snapPoints={…}>.',
127
+ },
128
+ { id: 'component:drawer' },
129
+ ]
130
+
131
+ const iosTabBar = {
132
+ id: 'component:tabs',
133
+ note: "iOS: the native TabView, each tab's root its ScrollView or List. The floating iOS 26 bar insets that scroll view, so the last row ends above it; no bottom padding, overlay or bottom ignoresSafeArea.",
134
+ }
135
+
136
+ const iosTabs = {
137
+ id: 'component:tabs',
138
+ note: 'iOS per variant: underline and attached render as AtomTabRow (text tabs over the content, an accent bar under the selected one, an optional SF Symbol over each label; scrolls sideways when they do not fit). default renders as Picker(.segmented), for a short second-level filter. App-level sections use TabView.',
139
+ }
140
+
141
+ const tabBar = [
142
+ { id: 'template:tab-bar' },
143
+ {
144
+ id: 'template:app-view',
145
+ note: 'App view with layout="phone": edge to edge, safe-area aware, the tab bar docked at the bottom.',
146
+ },
147
+ iosTabBar,
148
+ ]
149
+
150
+ const phoneApp = [
151
+ {
152
+ id: 'template:app-view',
153
+ note: 'App view with layout="phone": edge to edge, safe-area aware, the tab bar docked at the bottom.',
154
+ },
155
+ { id: 'template:tab-bar' },
156
+ ]
157
+
158
+ /*
159
+ * The ground (neutral family and page color) an idea suggests, for products
160
+ * whose reference look is not the default cool grey on a grey page. `build`
161
+ * adds the first ground whose key the idea contains (as whole words) to its
162
+ * kit, and search lists the colors page for the same words through `topics`.
163
+ * The golden queries in core.test.mjs cover them.
164
+ */
165
+ const warmPaper = {
166
+ surface: 'n6',
167
+ page: '--a63-surface-panel',
168
+ note: 'A warm paper product: set the warm n6 neutral (<UIProvider surface="n6">, data-a63-surface="n6") and draw the page on --a63-surface-panel (bg-card), the near-white surface, instead of the grey --a63-surface-page. Use --a63-text-tertiary for meta and timestamps.',
169
+ }
170
+
171
+ const warmPaperKeys = [
172
+ 'doc',
173
+ 'docs',
174
+ 'document',
175
+ 'documents',
176
+ 'editor',
177
+ 'journal',
178
+ 'knowledge base',
179
+ 'notebook',
180
+ 'notes',
181
+ 'note taking',
182
+ 'notion',
183
+ 'wiki',
184
+ 'writing',
185
+ ]
186
+
187
+ export const grounds = warmPaperKeys.map(key => ({ key, ...warmPaper }))
188
+
189
+ const warmPaperTopic = [
190
+ {
191
+ id: 'doc:foundation-colors',
192
+ note: 'Colors page: for a warm paper product use the n6 neutral and a near-white page (--a63-surface-panel); three text greys.',
193
+ },
194
+ ]
195
+
196
+ const chatSurfaces = [
197
+ {
198
+ id: 'template:chat-panel',
199
+ note: 'Assistant side panel beside the product: transcript, tool steps, start screen with suggestions, composer with send and stop.',
200
+ },
201
+ {
202
+ id: 'template:chat-page',
203
+ note: 'Full-page assistant with conversation history in the sidebar and a start screen with a large composer.',
204
+ },
205
+ { id: 'component:chat-message' },
206
+ { id: 'component:chat-composer' },
207
+ {
208
+ id: 'doc:pattern-agent',
209
+ note: '@atom63/agent, the headless runtime: map its messages and status onto the chat components.',
210
+ },
211
+ ]
212
+
213
+ const chatComposer = [
214
+ {
215
+ id: 'component:chat-composer',
216
+ note: 'ChatComposer: growing textarea, attach slot, send that turns into stop while streaming, Enter to send.',
217
+ },
218
+ { id: 'template:chat-panel' },
219
+ ]
220
+
221
+ const chatSteps = [
222
+ {
223
+ id: 'component:chat-steps',
224
+ note: 'ChatSteps and ChatStep: a collapsible list of tool and thinking steps with status icons.',
225
+ },
226
+ ]
227
+
228
+ const typingIndicator = [
229
+ {
230
+ id: 'component:chat-typing-indicator',
231
+ note: 'ChatTypingIndicator: three dots in place of the reply until its first text, a polite status.',
232
+ },
233
+ ]
234
+
235
+ const aiDisclaimer = [
236
+ {
237
+ id: 'example:chat-composer/Playground',
238
+ note: 'ChatComposer footnote="AI can make mistakes. Check important info." under the field.',
239
+ },
240
+ { id: 'component:chat-composer' },
241
+ ]
242
+
243
+ const mediaList = [
244
+ {
245
+ id: 'component:table',
246
+ note: 'Media and track lists: <Table variant="plain"> drops the dividers between rows.',
247
+ },
248
+ {
249
+ id: 'example:table/Plain',
250
+ note: 'A track list on <Table variant="plain">: rows without dividers.',
251
+ },
252
+ ]
253
+
254
+ const denseTable = [
255
+ {
256
+ id: 'component:table',
257
+ note: 'Dense tables (admin, payments, issues): <Table size="sm"> draws 33px rows; a row checkbox or a 24px row menu (<Button size="icon-xs" variant="ghost">) keeps its hit area without making the row taller.',
258
+ },
259
+ {
260
+ id: 'example:table/DenseRowActions',
261
+ note: 'A size="sm" table with row checkboxes and a row menu: 33px rows.',
262
+ },
263
+ ]
264
+
265
+ const denseList = [
266
+ {
267
+ id: 'component:item',
268
+ note: 'Dense lists (an inbox, a message list): <Item size="sm"> (12px block padding) or size="xs" (8px) instead of the 16px default. For one-line rows with columns, use <Table size="sm"> (33px rows). Let the size set the row height, not a fixed h-*.',
269
+ },
270
+ { id: 'component:table', note: denseTable[0].note },
271
+ ]
272
+
273
+ const darkSidebar = [
274
+ {
275
+ id: 'component:sidebar',
276
+ note: 'A dark sidebar on a light app: wrap <Sidebar> in <UIProvider mode="dark">. Every token inside resolves for dark (surface, text, active item, badges, buttons) and the rest of the app stays light. No mode checks, no literal colours.',
277
+ },
278
+ {
279
+ id: 'example:sidebar/DarkSidebar',
280
+ note: 'A mail sidebar in <UIProvider mode="dark"> beside a light inbox.',
281
+ },
282
+ ]
283
+
284
+ const darkRegion = [
285
+ {
286
+ id: 'example:sidebar/DarkSidebar',
287
+ note: 'A dark region on a light page: <UIProvider mode="dark"> around it keeps the theme, brand and density and resolves every token inside for dark.',
288
+ },
289
+ { id: 'component:sidebar', note: darkSidebar[0].note },
290
+ ]
291
+
292
+ const inverseToast = [
293
+ {
294
+ id: 'component:toaster',
295
+ note: 'A compact dark toast (macOS, iOS): <Toaster variant="inverse" position="bottom-center" /> with toast.loading("Scheduling message…") draws a pill in the inverse colours with the spinner after the message.',
296
+ },
297
+ {
298
+ id: 'example:toaster/Inverse',
299
+ note: 'The inverse pill with a loading spinner after the message.',
300
+ },
301
+ ]
302
+
303
+ const quietFilters = [
304
+ {
305
+ id: 'component:toggle-group',
306
+ note: 'Quiet toolbar filters (All / Read / Unread): <ToggleGroup variant="ghost" size="sm">, plain text items with only the selected one softly filled. variant="pills" draws filled capsules with a solid selected one, for a prominent filter row.',
307
+ },
308
+ {
309
+ id: 'example:toggle-group/Ghost',
310
+ note: 'An inbox filter row: plain items, the selected one on the soft selection fill.',
311
+ },
312
+ ]
313
+
314
+ const floatingButton = [
315
+ {
316
+ id: 'example:button/FloatingOverMap',
317
+ note: 'Round floating buttons over a map or a light photo: <Button variant="raised" shape="round" size="icon-lg">.',
318
+ },
319
+ {
320
+ id: 'component:button',
321
+ note: 'Floating button: variant="raised" with shape="round" on a light map or photo; variant="overlay" over dark media.',
322
+ },
323
+ ]
324
+
325
+ const groupedList = [
326
+ {
327
+ id: 'component:item',
328
+ note: 'Grouped inset list (settings): web <ItemGroup variant="inset">; iOS AtomListSection(header, footer:) { AtomValueRow(…, showsDisclosure: true) }. White cards on a grey page by default; for grey cards on a white page, put the page on bg-card and pass surface="muted" (iOS surface: .muted).',
329
+ },
330
+ {
331
+ id: 'example:item/InsetGroup',
332
+ note: 'An inset group of label, bold value and chevron rows (iOS: AtomValueRow(emphasizesValue:showsDisclosure:)).',
333
+ },
334
+ {
335
+ id: 'example:item/InsetGroupMuted',
336
+ note: 'Grey inset groups on a white page, with phone-sized switches, 52px rows and an 18px card corner: <ItemGroup surface="muted" variant="inset"> inside data-a63-form-factor="phone".',
337
+ },
338
+ { id: 'template:settings-page' },
339
+ ]
340
+
341
+ const valueRow = [
342
+ {
343
+ id: 'component:item',
344
+ note: 'A label with a trailing value and a chevron: web Item with ItemActions; iOS AtomValueRow(_:value:emphasizesValue:showsDisclosure:).',
345
+ },
346
+ { id: 'example:item/InsetGroup' },
347
+ ]
348
+
349
+ const pageDots = [
350
+ {
351
+ id: 'component:carousel',
352
+ note: 'Page dots: web <CarouselDots /> inside Carousel; iOS AtomPageDots(count:selection:) under a TabView with .page(indexDisplayMode: .never). Round dots by default; shape="pill" (iOS shape: .pill) stretches the current one, tone="accent" tints it and tone="on-media" (iOS .onMedia) draws white dots over photos.',
353
+ },
354
+ { id: 'example:carousel/WithDots' },
355
+ { id: 'example:carousel/DotShapes' },
356
+ { id: 'example:carousel/DotTones' },
357
+ ]
358
+
359
+ const avatarBadge = [
360
+ {
361
+ id: 'component:avatar',
362
+ note: 'A status dot or count on an avatar: web <AvatarBadge /> inside Avatar; iOS AtomAvatar(name:badge: .dot(accessibilityLabel:) or .count(_:accessibilityLabel:)).',
363
+ },
364
+ { id: 'example:avatar/WithBadge' },
365
+ ]
366
+
367
+ export const topics = {
368
+ ...Object.fromEntries(warmPaperKeys.map(key => [key, warmPaperTopic])),
369
+ amount: displayType,
370
+ balance: displayType,
371
+ 'big number': displayType,
372
+ cents: displayType,
373
+ currency: displayType,
374
+ display: displayType,
375
+ fraction: displayType,
376
+ 'large number': displayType,
377
+ price: displayType,
378
+ 'send money': displayType,
379
+ total: displayType,
380
+ fade: [gradients[4], gradients[2], gradients[0], gradients[1], gradients[3]],
381
+ gradient: [gradients[4], ...gradients.slice(0, 4)],
382
+ gradients: [gradients[4], ...gradients.slice(0, 4)],
383
+ hero: [gradients[4], gradients[0], displayType[3], gradients[2], gradients[3]],
384
+ scrim: [gradients[2], gradients[3]],
385
+ 'bottom sheet': persistentSheet,
386
+ 'non modal': persistentSheet,
387
+ 'over map': [...persistentSheet, ...floatingButton],
388
+ persistent: persistentSheet,
389
+ 'snap points': persistentSheet,
390
+ 'bottom nav': tabBar,
391
+ 'bottom navigation': tabBar,
392
+ 'bottom tabs': tabBar,
393
+ 'tab bar': tabBar,
394
+ tabbar: tabBar,
395
+ tabview: [iosTabBar],
396
+ 'ios tab bar': [iosTabBar],
397
+ 'swiftui tab bar': [iosTabBar],
398
+ 'track list': mediaList,
399
+ tracklist: mediaList,
400
+ tracks: mediaList,
401
+ playlist: mediaList,
402
+ 'media list': mediaList,
403
+ episodes: mediaList,
404
+ songs: mediaList,
405
+ 'admin table': denseTable,
406
+ 'compact table': denseTable,
407
+ 'data table': denseTable,
408
+ 'dense table': denseTable,
409
+ 'payments table': denseTable,
410
+ 'compact list': denseList,
411
+ 'dense list': denseList,
412
+ 'email list': denseList,
413
+ inbox: denseList,
414
+ 'mail list': denseList,
415
+ mailbox: denseList,
416
+ 'message list': denseList,
417
+ 'floating button': floatingButton,
418
+ 'floating buttons': floatingButton,
419
+ 'map button': floatingButton,
420
+ 'map buttons': floatingButton,
421
+ 'map controls': floatingButton,
422
+ 'locate button': floatingButton,
423
+ 'ios tabs': [iosTabs],
424
+ 'swiftui tabs': [iosTabs],
425
+ 'underline tabs': [iosTabs],
426
+ 'tabs underline': [iosTabs],
427
+ atomtabrow: [iosTabs],
428
+ 'edge to edge': phoneApp,
429
+ iphone: phoneApp,
430
+ 'mobile app': phoneApp,
431
+ 'mobile screen': phoneApp,
432
+ 'mobile web': phoneApp,
433
+ 'on a phone': phoneApp,
434
+ 'phone app': phoneApp,
435
+ 'phone screen': phoneApp,
436
+ agent: [chatSurfaces[4], chatSurfaces[0], chatSurfaces[1]],
437
+ 'chat history': [chatSurfaces[1], chatSurfaces[0]],
438
+ 'chat page': [chatSurfaces[1], chatSurfaces[0]],
439
+ 'full page chat': [chatSurfaces[1], chatSurfaces[0]],
440
+ 'ai assistant': chatSurfaces,
441
+ 'ai chat': chatSurfaces,
442
+ assistant: chatSurfaces,
443
+ chat: chatSurfaces,
444
+ chatbot: chatSurfaces,
445
+ copilot: chatSurfaces,
446
+ 'chat bubble': [{ id: 'component:chat-message' }],
447
+ 'chat message': [{ id: 'component:chat-message' }, chatSurfaces[0]],
448
+ 'chat composer': chatComposer,
449
+ 'message bubble': [{ id: 'component:chat-message' }],
450
+ 'chat input': chatComposer,
451
+ 'message composer': chatComposer,
452
+ 'prompt box': chatComposer,
453
+ 'prompt input': chatComposer,
454
+ 'send button': chatComposer,
455
+ 'stop button': chatComposer,
456
+ reasoning: chatSteps,
457
+ thinking: chatSteps,
458
+ 'tool calls': chatSteps,
459
+ 'tool steps': chatSteps,
460
+ 'typing dots': typingIndicator,
461
+ 'typing indicator': typingIndicator,
462
+ 'ai disclaimer': aiDisclaimer,
463
+ 'ai can make mistakes': aiDisclaimer,
464
+ 'grouped list': groupedList,
465
+ 'grouped section': groupedList,
466
+ 'grouped settings': groupedList,
467
+ 'inset group': groupedList,
468
+ 'inset list': groupedList,
469
+ 'list section': groupedList,
470
+ 'settings list': groupedList,
471
+ 'chevron row': valueRow,
472
+ 'disclosure row': valueRow,
473
+ 'value row': valueRow,
474
+ 'page control': pageDots,
475
+ 'page dots': pageDots,
476
+ 'page indicator': pageDots,
477
+ 'dark sidebar': darkSidebar,
478
+ 'dark nav': darkSidebar,
479
+ 'dark navigation': darkSidebar,
480
+ 'inverse sidebar': darkSidebar,
481
+ 'dark region': darkRegion,
482
+ 'dark section': darkRegion,
483
+ 'dark toast': inverseToast,
484
+ 'inverse toast': inverseToast,
485
+ 'compact toast': inverseToast,
486
+ 'toast pill': inverseToast,
487
+ 'status pill': inverseToast,
488
+ 'filter chips': quietFilters,
489
+ 'filter tabs': quietFilters,
490
+ 'inbox filters': quietFilters,
491
+ 'quiet filters': quietFilters,
492
+ 'toolbar filters': quietFilters,
493
+ 'avatar badge': avatarBadge,
494
+ 'online indicator': avatarBadge,
495
+ 'presence dot': avatarBadge,
496
+ 'status dot': avatarBadge,
497
+ }