moi-computer 0.11.1-next.0 → 0.11.1-next.2

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 (211) hide show
  1. package/client/AGENTS.md +2 -2
  2. package/client/components/ui/button.tsx +1 -53
  3. package/client/components/ui/collapsible.tsx +1 -15
  4. package/client/components/ui/dialog.tsx +1 -58
  5. package/client/components/ui/dropdown-menu.tsx +1 -254
  6. package/client/components/ui/hover-card.tsx +1 -44
  7. package/client/components/ui/input.tsx +1 -21
  8. package/client/components/ui/popover.tsx +1 -88
  9. package/client/components/ui/resizable.tsx +1 -40
  10. package/client/components/ui/skeleton.tsx +1 -13
  11. package/client/components/ui/slider.tsx +1 -70
  12. package/client/components/ui/spinner.tsx +1 -18
  13. package/client/components/ui/switch.tsx +1 -23
  14. package/client/components/ui/tabs.tsx +1 -0
  15. package/client/components/ui/textarea.tsx +1 -18
  16. package/client/components/ui/tooltip.tsx +1 -51
  17. package/client/features/chat/ChatPanel.tsx +6 -6
  18. package/client/features/chat/ChatPopup.tsx +3 -4
  19. package/client/features/chat/TurnView.tsx +5 -4
  20. package/client/features/chat/api.ts +5 -14
  21. package/client/features/chat/chat-frames.ts +9 -7
  22. package/client/features/chat/chat-send.ts +13 -2
  23. package/client/features/chat/chat-store.ts +1 -3
  24. package/client/features/chat/composer/ChatComposer.tsx +5 -1
  25. package/client/features/chat/composer/ModelPicker.tsx +44 -44
  26. package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
  27. package/client/features/chat/composer/model-order.ts +15 -0
  28. package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
  29. package/client/features/chat/group-turns.ts +12 -0
  30. package/client/features/chat/interleave-notices.ts +7 -11
  31. package/client/features/chat/session-view.ts +53 -0
  32. package/client/features/chat/tool-group/ToolCallGroup.tsx +1 -4
  33. package/client/features/chat/tool-group/format/codex.ts +4 -1
  34. package/client/features/chat/useChat.ts +10 -9
  35. package/client/features/dev/ChatStatesPage.tsx +3 -1
  36. package/client/features/dev/DevIndexPage.tsx +5 -0
  37. package/client/features/dev/DevRoutes.tsx +2 -0
  38. package/client/features/dev/HarnessDebugPage.tsx +1 -1
  39. package/client/features/dev/UiComponentPreviews.tsx +834 -0
  40. package/client/features/dev/UiComponentsPage.tsx +60 -0
  41. package/client/features/home/WorkspacePreview.tsx +1 -1
  42. package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
  43. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
  44. package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
  45. package/client/features/settings/SettingsLayout.tsx +1 -1
  46. package/client/features/settings/WorkspaceSettings.tsx +4 -1
  47. package/client/features/views/ViewManager.tsx +14 -9
  48. package/client/features/widgets/WidgetFrame.tsx +1 -1
  49. package/client/features/widgets/Widgets.tsx +1 -3
  50. package/client/features/workspace/WorkspaceScreen.tsx +5 -1
  51. package/client/features/workspace/WorkspaceSplitLayout.tsx +6 -1
  52. package/client/features/workspace/api.ts +2 -4
  53. package/client/index.css +22 -29
  54. package/dist/chunk-245wt82v.css +1 -0
  55. package/dist/{chunk-tny85yt2.js → chunk-4s15axjs.js} +2 -2
  56. package/dist/{chunk-c9pjqx9m.js → chunk-53a7pxcz.js} +1 -1
  57. package/dist/{chunk-104m57qw.js → chunk-87thzbtw.js} +2 -2
  58. package/dist/chunk-a6jad1a6.js +1 -0
  59. package/dist/chunk-dghwstd2.js +9 -0
  60. package/dist/chunk-eg120aca.js +1 -0
  61. package/dist/{chunk-v7wr1df4.js → chunk-j3wvxjr7.js} +1 -1
  62. package/dist/chunk-j7hh2ab4.js +70 -0
  63. package/dist/chunk-w482ew2c.js +546 -0
  64. package/dist/chunk-y8eyahwx.js +1 -0
  65. package/dist/index.html +1 -1
  66. package/lib/format.ts +55 -6
  67. package/lib/themes.ts +6 -6
  68. package/lib/types.ts +10 -9
  69. package/package.json +12 -5
  70. package/registry.json +643 -0
  71. package/server/agent.ts +1 -1
  72. package/server/api.ts +26 -30
  73. package/server/applets.ts +30 -29
  74. package/server/bundler/applet-css.ts +7 -107
  75. package/server/bundler/build-applet.ts +5 -1
  76. package/server/bundler/build-worker.ts +178 -0
  77. package/server/cli-ui-components.ts +28 -33
  78. package/server/cli.ts +6 -11
  79. package/server/data-dir.ts +1 -1
  80. package/server/harness/README.md +41 -48
  81. package/server/harness/acp/NOTES.md +426 -0
  82. package/server/harness/acp/discovery.ts +27 -30
  83. package/server/harness/acp/model-state.ts +57 -0
  84. package/server/harness/acp/session.ts +18 -6
  85. package/server/harness/claude-code/NOTES.md +47 -12
  86. package/server/harness/claude-code/cli.ts +40 -0
  87. package/server/harness/claude-code/index.ts +11 -5
  88. package/server/harness/claude-code/models.ts +72 -19
  89. package/server/harness/claude-code/session.ts +408 -299
  90. package/server/harness/codex/NOTES.md +222 -350
  91. package/server/harness/codex/adapter.ts +94 -45
  92. package/server/harness/codex/auth.ts +1 -3
  93. package/server/harness/codex/client.ts +169 -249
  94. package/server/harness/codex/discovery.ts +9 -17
  95. package/server/harness/codex/index.ts +2 -1
  96. package/server/harness/codex/pagination.ts +24 -0
  97. package/server/harness/codex/permissions.ts +31 -7
  98. package/server/harness/codex/probe.ts +10 -13
  99. package/server/harness/codex/session.ts +549 -136
  100. package/server/harness/codex/transport.ts +184 -0
  101. package/server/harness/debug.ts +1 -1
  102. package/server/harness/hermes/NOTES.md +18 -0
  103. package/server/harness/hermes/discovery.ts +20 -0
  104. package/server/harness/hermes/index.ts +9 -0
  105. package/server/harness/hermes/models.ts +28 -8
  106. package/server/harness/types.ts +4 -2
  107. package/server/moi-scaffold.ts +1 -1
  108. package/server/preview.ts +3 -1
  109. package/server/registry.ts +63 -41
  110. package/server/tldraw-package.d.ts +4 -0
  111. package/server/ui-components.ts +101 -434
  112. package/server/view-builders.ts +2 -1
  113. package/server/web.ts +12 -5
  114. package/server/workspace-env.ts +3 -2
  115. package/tsconfig.json +0 -1
  116. package/ui-components/accordion.tsx +71 -0
  117. package/ui-components/alert-dialog.tsx +165 -0
  118. package/ui-components/alert.tsx +68 -0
  119. package/ui-components/attachment.tsx +195 -0
  120. package/ui-components/avatar.tsx +90 -0
  121. package/ui-components/badge.tsx +49 -0
  122. package/ui-components/button-group.tsx +78 -0
  123. package/ui-components/button.tsx +55 -0
  124. package/ui-components/calendar.tsx +180 -0
  125. package/ui-components/card.tsx +84 -0
  126. package/ui-components/carousel.tsx +235 -0
  127. package/ui-components/chart.tsx +338 -0
  128. package/ui-components/checkbox.tsx +28 -0
  129. package/ui-components/collapsible.tsx +15 -0
  130. package/ui-components/combobox.tsx +267 -0
  131. package/ui-components/context-menu.tsx +244 -0
  132. package/ui-components/dialog.tsx +138 -0
  133. package/ui-components/docs/accordion.md +463 -0
  134. package/ui-components/docs/alert-dialog.md +481 -0
  135. package/ui-components/docs/alert.md +301 -0
  136. package/ui-components/docs/attachment.md +689 -0
  137. package/ui-components/docs/avatar.md +495 -0
  138. package/ui-components/docs/badge.md +258 -0
  139. package/ui-components/docs/button-group.md +879 -0
  140. package/ui-components/docs/button.md +26 -0
  141. package/ui-components/docs/calendar.md +862 -0
  142. package/ui-components/docs/card.md +265 -0
  143. package/ui-components/docs/carousel.md +627 -0
  144. package/ui-components/docs/chart.md +1256 -0
  145. package/ui-components/docs/checkbox.md +477 -0
  146. package/ui-components/docs/collapsible.md +446 -0
  147. package/ui-components/docs/combobox.md +1003 -0
  148. package/ui-components/docs/context-menu.md +860 -0
  149. package/ui-components/docs/data-table.md +1580 -0
  150. package/ui-components/docs/date-picker.md +614 -0
  151. package/ui-components/docs/dialog.md +414 -0
  152. package/ui-components/docs/drawer.md +51 -0
  153. package/ui-components/docs/dropdown-menu.md +1000 -0
  154. package/ui-components/docs/field.md +1192 -0
  155. package/ui-components/docs/hover-card.md +275 -0
  156. package/ui-components/docs/input-group.md +866 -0
  157. package/ui-components/docs/input.md +456 -0
  158. package/ui-components/docs/label.md +295 -0
  159. package/ui-components/docs/pagination.md +416 -0
  160. package/ui-components/docs/popover.md +348 -0
  161. package/ui-components/docs/progress.md +214 -0
  162. package/ui-components/docs/radio-group.md +389 -0
  163. package/ui-components/docs/resizable.md +265 -0
  164. package/ui-components/docs/select.md +616 -0
  165. package/ui-components/docs/separator.md +216 -0
  166. package/ui-components/docs/skeleton.md +205 -0
  167. package/ui-components/docs/slider.md +226 -0
  168. package/ui-components/docs/spinner.md +332 -0
  169. package/ui-components/docs/switch.md +236 -0
  170. package/ui-components/docs/table.md +551 -0
  171. package/ui-components/docs/tabs.md +379 -0
  172. package/ui-components/docs/textarea.md +187 -0
  173. package/ui-components/docs/toggle-group.md +370 -0
  174. package/ui-components/docs/toggle.md +91 -0
  175. package/ui-components/docs/tooltip.md +290 -0
  176. package/ui-components/drawer.tsx +213 -0
  177. package/ui-components/dropdown-menu.tsx +263 -0
  178. package/ui-components/field.tsx +224 -0
  179. package/ui-components/hover-card.tsx +46 -0
  180. package/ui-components/input-group.tsx +146 -0
  181. package/ui-components/input.tsx +20 -0
  182. package/ui-components/label.tsx +17 -0
  183. package/ui-components/pagination.tsx +124 -0
  184. package/ui-components/popover.tsx +81 -0
  185. package/ui-components/progress.tsx +63 -0
  186. package/ui-components/radio-group.tsx +38 -0
  187. package/ui-components/resizable.tsx +40 -0
  188. package/ui-components/scoped-portal.tsx +31 -0
  189. package/ui-components/select.tsx +195 -0
  190. package/ui-components/separator.tsx +18 -0
  191. package/ui-components/skeleton.tsx +15 -0
  192. package/ui-components/slider.tsx +75 -0
  193. package/ui-components/spinner.tsx +20 -0
  194. package/ui-components/switch.tsx +27 -0
  195. package/ui-components/table.tsx +86 -0
  196. package/ui-components/tabs.tsx +75 -0
  197. package/ui-components/textarea.tsx +17 -0
  198. package/ui-components/toggle-group.tsx +85 -0
  199. package/ui-components/toggle.tsx +42 -0
  200. package/ui-components/tooltip.tsx +61 -0
  201. package/ui-components/utils.ts +8 -0
  202. package/workspace/.claude/skills/moi-workspace/SKILL.md +11 -20
  203. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +4 -3
  204. package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
  205. package/dist/chunk-59zf0m6n.js +0 -1
  206. package/dist/chunk-bj3akjs2.js +0 -1
  207. package/dist/chunk-j2w2vak4.js +0 -546
  208. package/dist/chunk-k2r9c95m.js +0 -10
  209. package/dist/chunk-kmbxhgwv.js +0 -1
  210. package/dist/chunk-p1yqa71k.js +0 -83
  211. package/dist/chunk-r5xrenjy.css +0 -1
@@ -1,214 +1,78 @@
1
- # UI components cheat sheet
1
+ # UI components
2
2
 
3
- `moi ui-components` installs standard controls from a selected subset of the shadcn registry,
4
- pre-tuned for moi applets: **Base UI** primitives, **Tabler** icons, workspace theme tokens,
5
- relative imports, and overlays patched so applet styling survives portalling. Components land
6
- in `.moi/ui/` as plain source files you own.
7
-
8
- This file is the catalog plus the essential usage rules (condensed from the official shadcn
9
- skill). Read it once; fetch full per-component docs with `moi ui-components docs <name>` **before
10
- composing a component you haven't used in this workspace** — the parts API is Base UI, not the
11
- Radix-era shadcn you may know.
3
+ Use bundled components for standard controls. They use Base UI, Tabler icons, and workspace
4
+ theme tokens. Follow [DESIGN.md](DESIGN.md) for visual decisions.
12
5
 
13
6
  ## Workflow
14
7
 
8
+ Run commands from the project root. Check what's available and installed, read the docs
9
+ before using or changing a component, then add all missing components in one call.
10
+
15
11
  ```sh
16
- moi ui-components # catalog + what's installed
17
- moi ui-components add select # → .moi/ui/select.tsx (+ any support files)
18
- moi ui-components add table badge tabs --install # any number of names, one call —
19
- # always prefer this over one `add` per
20
- # component; --install runs the bun install too
21
- moi ui-components docs select table # official docs as markdown
22
- moi bundle # rebuild applets
12
+ moi ui-components # catalog and installed state
13
+ moi ui-components docs select date-picker # usage and examples
14
+ moi ui-components add select date-picker --install
15
+ moi bundle # rebuild after editing applets
23
16
  ```
24
17
 
18
+ `add` copies source and support files into `.moi/ui/`. `--install` runs `bun install` in `.moi/`
19
+ and may need network access. Without it, run the dependency command printed by `add`. Rebuilding
20
+ with `moi bundle` is always a separate step.
21
+
22
+ Recipes, ready-made component compositions, use the same `add` and `docs` commands. They install
23
+ their building blocks; follow the recipe docs to compose them.
24
+
25
+ ## Imports
26
+
27
+ Use relative imports from applets and shared modules under `.moi/`:
28
+
25
29
  ```tsx
26
- // In an applet — always relative, never @/ aliases, never the host app's components:
27
30
  import { Button } from '../ui/button'
28
- import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
31
+ import { cn } from '../ui/utils'
32
+ import { IconSearch } from '@tabler/icons-react'
33
+ ```
34
+
35
+ Adapt aliases in examples to relative imports. Applets cannot use `@/` aliases or import host
36
+ components. Use `moi ui-components` for installation; no `components.json` setup is needed.
37
+
38
+ ## Composition
39
+
40
+ Use the anatomy and props in `moi ui-components docs <name>`. Inspect the installed source
41
+ when an example differs or a component has local edits; it defines the supported API.
42
+ Keep required groups, labels, and titles when composing parts.
43
+
44
+ Custom triggers and close controls use the `render` prop:
45
+
46
+ ```tsx
47
+ <DialogTrigger render={<Button variant="outline" />}>Open</DialogTrigger>
29
48
  ```
30
49
 
31
- - `add` writes source files and nothing else by default — installing the deps it prints and
32
- rebuilding is your job. Pass `--install` to have it run the `bun install` in `.moi/` for you;
33
- rebuilding (`moi bundle`) stays yours either way.
34
- - **If the build fails on a missing package** (happens in workspaces scaffolded before this
35
- feature — `.moi/package.json` may lack the deps ui components need): check
36
- `.moi/package.json` and install what's missing. Every ui component needs the baseline
37
-
38
- ```sh
39
- bun install @base-ui/react class-variance-authority clsx tailwind-merge
40
- ```
41
-
42
- (run in `.moi/`), plus whatever `add` printed for the specific component (`recharts`,
43
- `embla-carousel-react`, `react-day-picker` + `date-fns`, `react-resizable-panels`,
44
- `@tanstack/react-table`).
45
- - Files in `.moi/ui/` are yours to customize; `add` never overwrites them without `--force` —
46
- in a multi-name add, already-installed components are skipped (reported as kept) and the new
47
- ones still install.
48
- - Support files appear without being asked for (`utils.ts` with `cn`, `applet-portal.tsx`, and
49
- registry dependencies like `card` or `toggle`) — normal; use them if handy.
50
- `applet-portal.tsx` is auto-generated machinery: never edit or remove it.
51
-
52
- ## Catalog
53
-
54
- Import from `../ui/<name>` (same as the component name).
55
-
56
- **Form & input:** `button` (variants, sizes, icons) · `button-group` (segmented buttons) ·
57
- `input` · `textarea` · `input-group` (input with addons) · `field` (label + control +
58
- description + error) · `label` · `checkbox` · `radio-group` · `switch` · `slider` · `select` ·
59
- `combobox` (type-to-filter for long lists) · `toggle-group` (2–7 option sets) · `calendar` ·
60
- `date-picker` (pattern: calendar in a popover — see its docs; installs `calendar` + `popover` +
61
- `button`)
62
-
63
- **Overlays (portal-patched):** `dialog` · `alert-dialog` (destructive confirm) · `popover` ·
64
- `dropdown-menu` · `context-menu` (right-click) · `hover-card` · `tooltip`
65
-
66
- **Display & feedback:** `alert` (callouts) · `badge` · `avatar` · `skeleton` · `spinner` ·
67
- `progress` · `table` · `data-table` (pattern on `table` + `@tanstack/react-table` — see its
68
- docs) · `chart` (Recharts wired to theme tokens) · `attachment` (file/image tile) · `bubble`
69
- (chat message)
70
-
71
- **Structure & navigation:** `accordion` · `collapsible` · `tabs` · `carousel` · `pagination` ·
72
- `resizable` (split panels) · `separator` (divider line)
73
-
74
- Picking one: quick info on hover → `hover-card` or `tooltip` · contextual panel on click →
75
- `popover` · focused task needing input → `dialog` · destructive confirmation → `alert-dialog` ·
76
- option sets of 2–7 → `toggle-group` · long searchable lists → `combobox` · boolean setting →
77
- `switch`, boolean in a form → `checkbox`.
78
-
79
- ## Composition rules
80
-
81
- - **Custom triggers use the `render` prop** — this is Base UI, there is no `asChild`. Never wrap
82
- a trigger in an extra element. Applies to every Trigger and Close part (`DialogTrigger`,
83
- `PopoverTrigger`, `DropdownMenuTrigger`, `TooltipTrigger`, `CollapsibleTrigger`,
84
- `DialogClose`, …).
85
-
86
- ```tsx
87
- <DialogTrigger render={<Button variant="outline" />}>Open</DialogTrigger>
88
- ```
89
-
90
- - **`render` to a non-button element needs `nativeButton={false}`:**
91
-
92
- ```tsx
93
- <Button render={<a href="/docs" />} nativeButton={false}>Read the docs</Button>
94
- ```
95
-
96
- - **Items always live inside their Group**: `SelectItem`/`SelectLabel` → `SelectGroup`;
97
- `DropdownMenuItem`/`DropdownMenuLabel`/`DropdownMenuSub` → `DropdownMenuGroup`;
98
- `ContextMenuItem` → `ContextMenuGroup`. A Label outside its Group **crashes the component at
99
- runtime** (Base UI requires the group context); keep items grouped too.
100
- - **`Dialog` and `AlertDialog` always need a Title** (`DialogTitle` — use
101
- `className="sr-only"` to hide it visually).
102
- - **`TabsTrigger` must be inside `TabsList`**, never directly in `Tabs`.
103
- - **`Avatar` always needs `AvatarFallback`** for when the image fails.
104
- - **Button has no `isLoading`** — compose: `<Button disabled><Spinner data-icon="inline-start" />Saving…</Button>`.
105
- - **Use components, not custom markup**: callout → `Alert` (+`AlertTitle`/`AlertDescription`),
106
- loading placeholder → `Skeleton` (no custom `animate-pulse` divs), status chip → `Badge` (no
107
- styled spans), divider → `Separator` (no `<hr>`/border divs), inline loading → `Spinner`.
108
-
109
- ## Base UI API gotchas
110
-
111
- The biggest source of bugs when you know Radix-era shadcn. When unsure, `moi ui-components docs
112
- <name>` has the real API.
113
-
114
- - **Select needs an `items` prop on the root**; the placeholder is a `{ value: null }` item, not
115
- a `placeholder` prop:
116
-
117
- ```tsx
118
- const items = [
119
- { label: 'Pick a fruit', value: null },
120
- { label: 'Apple', value: 'apple' },
121
- ]
122
- <Select items={items}>
123
- <SelectTrigger><SelectValue /></SelectTrigger>
124
- <SelectContent>
125
- <SelectGroup>
126
- {items.map(item => (
127
- <SelectItem key={item.value} value={item.value}>{item.label}</SelectItem>
128
- ))}
129
- </SelectGroup>
130
- </SelectContent>
131
- </Select>
132
- ```
133
-
134
- Extras: `multiple` + render-function `SelectValue` for multi-select; `itemToStringValue` for
135
- object values; `alignItemWithTrigger={false}` to position like a plain dropdown.
136
- - **ToggleGroup**: no `type` prop — single-select by default, `multiple` for multi; `value`/
137
- `defaultValue` is **always an array** (`defaultValue={["daily"]}`; controlled single value:
138
- `value={[value]} onValueChange={v => setValue(v[0])}`).
139
- - **Slider**: plain number for one thumb (`defaultValue={50}`), array only for ranges.
140
- - **Accordion**: no `type`/`collapsible` props — `defaultValue` is **always an array**
141
- (`defaultValue={["item-1"]}`), `multiple` to allow several open.
142
- - **`AlertAction` is absolutely positioned** in the alert's top-right corner, and the alert
143
- reserves only ~4.5rem of right padding for it. Keep it to one small control (`size="sm"`
144
- button or icon button); anything wider overlaps the title and description text.
145
-
146
- ## Forms
147
-
148
- - Lay out forms with `FieldGroup` + `Field` — never raw `div`s with spacing utilities:
149
-
150
- ```tsx
151
- <FieldGroup>
152
- <Field>
153
- <FieldLabel htmlFor="email">Email</FieldLabel>
154
- <Input id="email" type="email" />
155
- <FieldDescription>Work email preferred.</FieldDescription>
156
- </Field>
157
- </FieldGroup>
158
- ```
159
-
160
- `Field orientation="horizontal"` for settings rows; `FieldSet` + `FieldLegend` for groups of
161
- related checkboxes/radios/switches.
162
- - **Validation and disabled need both attributes**: `data-invalid` on `Field` + `aria-invalid`
163
- on the control; `data-disabled` on `Field` + `disabled` on the control.
164
- - **Inside `InputGroup`, use `InputGroupInput`/`InputGroupTextarea`** — never raw
165
- `Input`/`Textarea`. A button attached to an input is `InputGroup` + `InputGroupAddon`, never
166
- absolute positioning over an `Input`.
167
- - **2–7 exclusive options → `ToggleGroup`**, not a loop of `Button`s with manual active state.
168
- - Control chooser: free text → `input`/`textarea` · predefined options → `select` · searchable →
169
- `combobox` · boolean setting → `switch` · boolean consent → `checkbox` · one-of-few →
170
- `radio-group` · numeric range → `slider`.
171
-
172
- ## Styling
173
-
174
- - **Semantic tokens only, never raw colors**: `bg-primary`, `text-muted-foreground`,
175
- `text-destructive`, `bg-popover` — not `bg-blue-500` or `text-emerald-600`. Every token pairs
176
- `name`/`name-foreground` (background / text-on-it): `background`, `card`, `popover`,
177
- `primary`, `secondary`, `muted`, `accent`, `destructive`, plus `border`, `input`, `ring`,
178
- `chart-1…5`, and `--radius`. Status colors come from `Badge` variants or `text-destructive`.
179
- - **Built-in variants before custom classes**: `variant="outline"`, `size="sm"` — not
180
- hand-rolled border/bg utilities on `Button`.
181
- - **Prefer each component's default size.** Use smaller variants such as `sm` or `xs` only when a
182
- real density constraint calls for them and the reduced control remains comfortable to use. When
183
- using a non-default size, compare it with neighboring controls. Controls in the same group must
184
- have matching heights and compatible visual weight.
185
- - **`className` is for layout** (`max-w-md`, `mt-4`, `w-full`) — never for overriding a
186
- component's colors or typography.
187
- - **`gap-*`, not `space-x-*`/`space-y-*`** (`flex flex-col gap-4`). **`size-10`, not
188
- `w-10 h-10`.** **`truncate`**, not the three-class spell.
189
- - **`cn()` from `../ui/utils` for conditional classes** — no template-literal ternaries. The
190
- same import works from `_`-prefixed shared modules next to your applets (a
191
- `.moi/widgets/_utils.tsx` importing `cn` uses `../ui/utils` too) — no need to re-implement
192
- it.
193
- - **No manual `z-index` on overlays** — dialog/popover/menu/tooltip handle their own stacking.
194
-
195
- ## Icons
196
-
197
- - Tabler only: `import { IconSearch } from '@tabler/icons-react'` — every name is
198
- `Icon`-prefixed. Installed components already come converted.
199
- - In a `Button`, mark position with `data-icon="inline-start"` / `"inline-end"`; **no sizing
200
- classes on icons inside components** (Button, DropdownMenuItem, Alert size them via CSS).
201
- - Pass icons as component objects (`icon={IconCheck}`), never as string keys into a lookup map.
202
-
203
- ## Customization
204
-
205
- Cheapest first — stop at the first level that works:
206
-
207
- 1. **Workspace theme** (`moi theme`) — fonts, colors, radius flow into every component through
208
- tokens.
209
- 2. **Built-in variants + `className` layout** at the callsite (merges correctly via `cn`).
210
- 3. **Edit the file in `.moi/ui/`** — e.g. add a `cva` variant to `button.tsx`; propagates to
211
- every applet using it, and `add` won't overwrite it without `--force`.
212
- 4. **Wrapper components** — compose primitives into app-level pieces (a `ConfirmDialog` wrapping
213
- `AlertDialog` parts) in a `_`-prefixed shared module (`.moi/widgets/_utils.tsx` — see the
214
- workspace layout in the skill).
50
+ Don't nest buttons inside triggers. When `render` replaces a button with a non-button
51
+ element, also pass `nativeButton={false}`.
52
+
53
+ ## Overlays
54
+
55
+ Use the installed portal and stacking behavior; don't add a second portal or z-index overrides.
56
+ `applet-portal.tsx` preserves applet styles for portalled content. Never edit or remove it.
57
+
58
+ ## Styling and icons
59
+
60
+ - Use semantic theme tokens and built-in variants. Reserve `className` for layout;
61
+ avoid overriding component colors or typography and adding manual `dark:` color overrides.
62
+ - Prefer default sizes. Use smaller controls when space calls for them, keeping neighboring
63
+ controls consistent and comfortable to use.
64
+ - Prefer `gap-*` for spacing, `size-*` for equal width and height, and `truncate` for ellipsis.
65
+ - Use `cn()` from `../ui/utils` for conditional classes.
66
+ - Use Tabler icons with explicit `stroke` following [the icon guidance](DESIGN.md#icons).
67
+ Let components size their icons; in buttons, mark position with
68
+ `data-icon="inline-start"` or `data-icon="inline-end"`.
69
+
70
+ ## Customization and updates
71
+
72
+ Use `moi theme` for workspace-wide appearance. When variants and layout props aren't enough,
73
+ edit the source in `.moi/ui/`; every importing applet gets the change. Put reusable compositions
74
+ in `_`-prefixed shared modules next to applets.
75
+
76
+ Existing files are skipped by `add`. Use `--force` only for an intended reinstall, after checking
77
+ local edits. Existing support files remain protected even with `--force`; request a dependency
78
+ component explicitly to update it.
@@ -1 +0,0 @@
1
- import{_c as r}from"/chunk-v7wr1df4.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function o(a){let[{mount:t}]=await Promise.all([import("/chunk-p1yqa71k.js"),import("/chunk-kmbxhgwv.js").then((e)=>e.loadAppConfig())]);t(a)}globalThis.__init=o;
@@ -1 +0,0 @@
1
- import{a}from"/chunk-pcnahct1.js";import"/chunk-v7wr1df4.js";export{a as sanitizeSvg};