@nucel/ui 0.3.0 → 0.11.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.
Files changed (63) hide show
  1. package/package.json +27 -34
  2. package/src/lib/components/BottomSheet.svelte +96 -0
  3. package/src/lib/components/Breadcrumbs.svelte +57 -0
  4. package/src/lib/components/Checkbox.svelte +64 -0
  5. package/src/lib/components/CodeBlock.svelte +264 -0
  6. package/src/lib/components/CodeEditor.svelte +175 -0
  7. package/src/lib/components/ColorInput.svelte +41 -0
  8. package/src/lib/components/ColorInput.test.ts +126 -0
  9. package/src/lib/components/Combobox.svelte +103 -0
  10. package/src/lib/components/CommandPalette.svelte +135 -0
  11. package/src/lib/components/CopyButton.svelte +95 -0
  12. package/src/lib/components/CopyButton.test.ts +213 -0
  13. package/src/lib/components/DataTable.svelte +202 -0
  14. package/src/lib/components/DateRangePicker.svelte +185 -0
  15. package/src/lib/components/DiffEditor.svelte +174 -0
  16. package/src/lib/components/Drawer.svelte +69 -0
  17. package/src/lib/components/Fab.svelte +59 -0
  18. package/src/lib/components/Form.svelte +38 -0
  19. package/src/lib/components/FormField.svelte +51 -0
  20. package/src/lib/components/IconButton.svelte +86 -0
  21. package/src/lib/components/IconButton.test.ts +139 -0
  22. package/src/lib/components/InlineCode.svelte +28 -0
  23. package/src/lib/components/Pagination.svelte +65 -0
  24. package/src/lib/components/Radio.svelte +60 -0
  25. package/src/lib/components/RadioGroup.svelte +26 -0
  26. package/src/lib/components/SearchInput.svelte +77 -0
  27. package/src/lib/components/Skeleton.svelte +76 -0
  28. package/src/lib/components/StatCard.svelte +97 -0
  29. package/src/lib/components/ThemeProvider.svelte +157 -0
  30. package/src/lib/components/ThemeToggle.svelte +68 -0
  31. package/src/lib/components/ThreeWayMerge.svelte +185 -0
  32. package/src/lib/components/ui/Alert.svelte +1 -1
  33. package/src/lib/components/ui/MarkdownRenderer.svelte +126 -8
  34. package/src/lib/components/ui/Sparkline.svelte +1 -1
  35. package/src/lib/components/ui/StatusBadge.svelte +6 -3
  36. package/src/lib/components/ui/StatusDot.svelte +3 -3
  37. package/src/lib/components/ui/table/Table.svelte +1 -1
  38. package/src/lib/components/ui/table/TableBody.svelte +1 -1
  39. package/src/lib/components/ui/table/TableCaption.svelte +1 -1
  40. package/src/lib/components/ui/table/TableCell.svelte +1 -1
  41. package/src/lib/components/ui/table/TableHead.svelte +1 -1
  42. package/src/lib/components/ui/table/TableHeader.svelte +1 -1
  43. package/src/lib/components/ui/table/TableRow.svelte +1 -1
  44. package/src/lib/index.ts +161 -61
  45. package/src/lib/utils/cn.test.ts +993 -0
  46. package/src/lib/utils/detectLanguage.ts +187 -0
  47. package/src/lib/utils/monaco-workers.d.ts +32 -0
  48. package/src/lib/utils/monacoLoader.ts +167 -0
  49. package/src/lib/utils/shikiHighlighter.ts +78 -0
  50. package/src/styles.css +100 -32
  51. package/src/lib/components/ui/AppShell.svelte +0 -14
  52. package/src/lib/components/ui/AppSidebar.svelte +0 -45
  53. package/src/lib/components/ui/CodeBlock.svelte +0 -92
  54. package/src/lib/components/ui/CopyButton.svelte +0 -43
  55. package/src/lib/components/ui/CostDisplay.svelte +0 -26
  56. package/src/lib/components/ui/FilterBar.svelte +0 -63
  57. package/src/lib/components/ui/FormField.svelte +0 -34
  58. package/src/lib/components/ui/MetricCard.svelte +0 -79
  59. package/src/lib/components/ui/NavItem.svelte +0 -42
  60. package/src/lib/components/ui/NavSection.svelte +0 -17
  61. package/src/lib/components/ui/Pagination.svelte +0 -85
  62. package/src/lib/components/ui/StatCard.svelte +0 -19
  63. package/src/lib/components/ui/Timeline.svelte +0 -85
package/src/lib/index.ts CHANGED
@@ -163,8 +163,8 @@ export {
163
163
  // Separator
164
164
  export { Separator } from './components/ui/separator/index.js';
165
165
 
166
- // Skeleton
167
- export { Skeleton } from './components/ui/skeleton/index.js';
166
+ // Skeleton (primitive — kept for backwards-compat)
167
+ export { Skeleton as SkeletonPrimitive } from './components/ui/skeleton/index.js';
168
168
 
169
169
  // Sonner (Toaster)
170
170
  export { Toaster } from './components/ui/sonner/index.js';
@@ -243,86 +243,186 @@ export { default as Sparkline } from './components/ui/Sparkline.svelte';
243
243
  // ProviderIcon
244
244
  export { default as ProviderIcon } from './components/ui/ProviderIcon.svelte';
245
245
 
246
- // RichEditor — full-featured TipTap editor (wiki, issues, comments)
247
- export { default as RichEditor } from './components/ui/editor/RichEditor.svelte';
246
+ // Checkbox (shadcn-styled wrapper over bits-ui)
247
+ export { default as Checkbox } from './components/Checkbox.svelte';
248
248
 
249
- // CostDisplay animated cost/currency display component
250
- export { default as CostDisplay } from './components/ui/CostDisplay.svelte';
249
+ // RadioGroup + Radio (shadcn-styled wrappers over bits-ui)
250
+ export { default as RadioGroup } from './components/RadioGroup.svelte';
251
+ export { default as Radio } from './components/Radio.svelte';
251
252
 
252
- // StatusPill
253
- export { default as StatusPill } from './components/ui/StatusPill.svelte';
253
+ // Form + FormField (InertiaJS-friendly defaults)
254
+ export { default as Form } from './components/Form.svelte';
255
+ export { default as FormField } from './components/FormField.svelte';
254
256
 
255
- // PageHeader
256
- export { default as PageHeader } from './components/ui/PageHeader.svelte';
257
+ // Pagination (composite, bits-ui driven)
258
+ export { default as Pagination } from './components/Pagination.svelte';
259
+
260
+ // StatCard (dashboard metric)
261
+ export { default as StatCard } from './components/StatCard.svelte';
262
+
263
+ // Breadcrumbs (array-driven composite; for low-level pieces use Breadcrumb*)
264
+ export { default as Breadcrumbs } from './components/Breadcrumbs.svelte';
265
+
266
+ // ---- 0.5.0 additions ----
267
+
268
+ // DataTable
269
+ export { default as DataTable } from './components/DataTable.svelte';
270
+ export type { ColumnDef, SortDirection } from './components/DataTable.svelte';
271
+
272
+ // SearchInput
273
+ export { default as SearchInput } from './components/SearchInput.svelte';
274
+
275
+ // DateRangePicker
276
+ export { default as DateRangePicker } from './components/DateRangePicker.svelte';
277
+ export type { DateRange, DateRangePreset } from './components/DateRangePicker.svelte';
278
+ export { DEFAULT_PRESETS as DateRangePickerDefaultPresets } from './components/DateRangePicker.svelte';
279
+
280
+ // CodeBlock
281
+ export { default as CodeBlock } from './components/CodeBlock.svelte';
282
+
283
+ // Skeleton (composite — shimmer + width/height; supersedes SkeletonPrimitive)
284
+ export { default as Skeleton } from './components/Skeleton.svelte';
285
+
286
+ // Drawer (side panel, built on Sheet primitive)
287
+ export { default as Drawer } from './components/Drawer.svelte';
288
+
289
+ // Combobox (searchable Select built on bits-ui Combobox)
290
+ export { default as Combobox } from './components/Combobox.svelte';
291
+ export type { ComboboxOption } from './components/Combobox.svelte';
292
+
293
+ // CommandPalette (cmdk-style palette built on bits-ui Command + Dialog)
294
+ export { default as CommandPalette } from './components/CommandPalette.svelte';
295
+ export type { CommandPaletteItem } from './components/CommandPalette.svelte';
257
296
 
258
- // Table
297
+ // ---- 0.6.0 additions ----
298
+
299
+ // ThemeProvider — exposes a `theme` ('light' | 'dark' | 'system') context,
300
+ // persists the user's preference in localStorage, and reacts to
301
+ // `prefers-color-scheme` when set to 'system'.
302
+ export { default as ThemeProvider } from './components/ThemeProvider.svelte';
259
303
  export {
260
- Table,
261
- TableHeader,
262
- TableBody,
263
- TableRow,
264
- TableHead,
265
- TableCell,
266
- TableCaption,
267
- } from './components/ui/table/index.js';
304
+ getThemeContext,
305
+ type Theme,
306
+ type ResolvedTheme,
307
+ type ThemeContext,
308
+ } from './components/ThemeProvider.svelte';
268
309
 
269
- // Alert
270
- export { default as Alert } from './components/ui/Alert.svelte';
310
+ // ThemeToggle — icon button cycling system -> light -> dark -> system.
311
+ export { default as ThemeToggle } from './components/ThemeToggle.svelte';
271
312
 
272
- // ListCard
273
- export { default as ListCard } from './components/ui/ListCard.svelte';
313
+ // ---- 0.7.0 additions ----
274
314
 
275
- // StatCard
276
- export { default as StatCard } from './components/ui/StatCard.svelte';
315
+ // CodeEditor — Monaco-powered editable code editor.
316
+ // Lazy-loaded on first mount; SSR-safe; matches @nucel/ui design tokens.
317
+ export { default as CodeEditor } from './components/CodeEditor.svelte';
318
+ export type { CodeEditorTheme } from './components/CodeEditor.svelte';
277
319
 
278
- // BranchPill
279
- export { default as BranchPill } from './components/ui/BranchPill.svelte';
320
+ // DiffEditor — Monaco-powered side-by-side or inline diff view.
321
+ export { default as DiffEditor } from './components/DiffEditor.svelte';
280
322
 
281
- // CommentPill
282
- export { default as CommentPill } from './components/ui/CommentPill.svelte';
323
+ // ThreeWayMerge — base/ours/theirs/merged conflict-resolution UI on top of Monaco.
324
+ export { default as ThreeWayMerge } from './components/ThreeWayMerge.svelte';
283
325
 
284
- // PermissionChipsNucel-App permission badges
285
- export { default as PermissionChips } from './components/ui/PermissionChips.svelte';
326
+ // Monaco loader (advanced use the components above when possible).
327
+ export { loadMonaco, resolveMonacoTheme } from './utils/monacoLoader.js';
286
328
 
287
- // AppCard Nucel-App row card (marketplace, installed apps, owned apps)
288
- export { default as AppCard } from './components/ui/AppCard.svelte';
329
+ // ---- 0.8.0 additions ----
289
330
 
290
- // Kanban primitives generic Trello-style column/card chrome.
291
- // DnD wiring stays out: the consumer attaches svelte-dnd-action's
292
- // `dndzone` to whichever container they want sortable.
293
- export { default as KanbanBoard } from './components/ui/KanbanBoard.svelte';
294
- export { default as KanbanColumn } from './components/ui/KanbanColumn.svelte';
295
- export { default as KanbanCard } from './components/ui/KanbanCard.svelte';
331
+ // InlineCodesingle-line <code> with subtle background, no highlighting.
332
+ export { default as InlineCode } from './components/InlineCode.svelte';
296
333
 
297
- // Section
298
- export { default as Section } from './components/ui/Section.svelte';
334
+ // Shiki helpers (re-exported so consumers can warm the highlighter early or
335
+ // load extra languages outside CodeBlock e.g. for a route prefetch hook).
336
+ export {
337
+ getHighlighter as getShikiHighlighter,
338
+ loadLanguage as loadShikiLanguage,
339
+ SHIKI_LIGHT_THEME,
340
+ SHIKI_DARK_THEME,
341
+ } from './utils/shikiHighlighter.js';
342
+
343
+ // File-path → Shiki language id helper, useful for repo file viewers.
344
+ export { detectLanguageFromPath } from './utils/detectLanguage.js';
345
+
346
+ // ---- 0.9.0 additions (mobile primitives) ----
347
+
348
+ // BottomSheet — mobile bottom-anchored sheet (Sheet primitive with grabber +
349
+ // safe-area). Pair with `md:hidden` on triggers to keep desktop unchanged.
350
+ export { default as BottomSheet } from './components/BottomSheet.svelte';
351
+
352
+ // Fab — floating action button for mobile primary actions.
353
+ // Defaults to `md:hidden`; pass `alwaysVisible` to show on desktop too.
354
+ export { default as Fab } from './components/Fab.svelte';
355
+
356
+ // ---- 0.10.0 additions (raw-primitive gap closers) ----
357
+
358
+ // CopyButton — copy-to-clipboard button with built-in "Copied" feedback and
359
+ // timeout reset. Replaces the duplicated clipboard.writeText + copied-state
360
+ // pattern in repo clone boxes, token reveal screens, session viewers, etc.
361
+ export { default as CopyButton } from './components/CopyButton.svelte';
362
+ export type { CopyButtonVariant, CopyButtonSize } from './components/CopyButton.svelte';
363
+
364
+ // IconButton — icon-only button OR anchor (pass `href`). Defaults to the
365
+ // muted-foreground "toolbar glyph" look (hover:bg-accent) used in TopBar,
366
+ // file trees, and dismiss buttons. `size="tap"` gives a 44×44 mobile target.
367
+ // `aria-label` is required.
368
+ export { default as IconButton } from './components/IconButton.svelte';
369
+ export {
370
+ iconButtonVariants,
371
+ type IconButtonVariant,
372
+ type IconButtonSize,
373
+ type IconButtonProps,
374
+ } from './components/IconButton.svelte';
375
+
376
+ // ColorInput — styled native <input type="color"> wrapper matching the
377
+ // form-control border/ring/focus tokens. Optional `showValue` hex readout.
378
+ export { default as ColorInput } from './components/ColorInput.svelte';
379
+
380
+ // ---- 0.11.0 additions (restored components) ----
381
+ //
382
+ // These components were part of the export surface in earlier releases but
383
+ // were dropped from the 0.10.0 barrel. The nucel app still imports them, so a
384
+ // clean `bun install --frozen-lockfile` against 0.10.0 broke the build. They
385
+ // are restored here against the package's shared-component conventions.
386
+
387
+ // Alert — inline notice banner (info/success/warning/error variants).
388
+ export { default as Alert } from './components/ui/Alert.svelte';
299
389
 
300
- // SectionTitle
390
+ // Section + SectionTitle — page section wrapper + heading.
391
+ export { default as Section } from './components/ui/Section.svelte';
301
392
  export { default as SectionTitle } from './components/ui/SectionTitle.svelte';
302
393
 
303
- // FormField
304
- export { default as FormField } from './components/ui/FormField.svelte';
394
+ // PageHeader — page title + actions header row.
395
+ export { default as PageHeader } from './components/ui/PageHeader.svelte';
305
396
 
306
- // Layout
307
- export { default as AppShell } from './components/ui/AppShell.svelte';
308
- export { default as AppSidebar } from './components/ui/AppSidebar.svelte';
309
- export { default as NavItem } from './components/ui/NavItem.svelte';
310
- export { default as NavSection } from './components/ui/NavSection.svelte';
397
+ // ListCard — bordered list-item card row.
398
+ export { default as ListCard } from './components/ui/ListCard.svelte';
311
399
 
312
- // CopyButton
313
- export { default as CopyButton } from './components/ui/CopyButton.svelte';
400
+ // Pills — compact status/branch/comment chips.
401
+ export { default as StatusPill } from './components/ui/StatusPill.svelte';
402
+ export { default as BranchPill } from './components/ui/BranchPill.svelte';
403
+ export { default as CommentPill } from './components/ui/CommentPill.svelte';
314
404
 
315
- // Pagination
316
- export { default as Pagination } from './components/ui/Pagination.svelte';
405
+ // PermissionChips — permission/scope chip group.
406
+ export { default as PermissionChips } from './components/ui/PermissionChips.svelte';
317
407
 
318
- // CodeBlock
319
- export { default as CodeBlock } from './components/ui/CodeBlock.svelte';
408
+ // AppCard — app/repo summary card.
409
+ export { default as AppCard } from './components/ui/AppCard.svelte';
320
410
 
321
- // Timeline
322
- export { default as Timeline } from './components/ui/Timeline.svelte';
411
+ // Kanban — board / column / card composites.
412
+ export { default as KanbanBoard } from './components/ui/KanbanBoard.svelte';
413
+ export { default as KanbanColumn } from './components/ui/KanbanColumn.svelte';
414
+ export { default as KanbanCard } from './components/ui/KanbanCard.svelte';
323
415
 
324
- // FilterBar
325
- export { default as FilterBar } from './components/ui/FilterBar.svelte';
416
+ // RichEditor — Tiptap-powered rich text editor (wiki/issues/PR comments).
417
+ export { default as RichEditor } from './components/ui/editor/RichEditor.svelte';
326
418
 
327
- // MetricCard
328
- export { default as MetricCard } from './components/ui/MetricCard.svelte';
419
+ // Table — shadcn-styled table primitives.
420
+ export {
421
+ Table,
422
+ TableHeader,
423
+ TableBody,
424
+ TableRow,
425
+ TableHead,
426
+ TableCell,
427
+ TableCaption,
428
+ } from './components/ui/table/index.js';