@nomosui/react 0.6.0 → 0.7.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.
package/SKILL.md CHANGED
@@ -27,7 +27,8 @@ pour expliquer une brique, elle appartient à l'app, pas au cœur.
27
27
  - **Recueillir ou montrer une note** → `Rating` : interactif seulement si l'app fournit
28
28
  `onValueChange`, sinon un affichage.
29
29
  - **Lister des événements datés** → `Timeline` (frise, présentation seule ; le format de
30
- la date vient de l'app).
30
+ la date vient de l'app). Un point porte un état — `done` (défaut) ou `past` (grisé) —
31
+ et un `past` exige un `stateLabel` fourni par l'app : la couleur seule ne suffit pas.
31
32
  - **Nommer un contrôle iconique, glisser une aide courte** → `Tooltip` en famille (un
32
33
  `TooltipProvider` autour de plusieurs, `Tooltip`, `TooltipTrigger`, `TooltipContent`).
33
34
  Jamais pour une information essentielle : elle n'est ni au clavier seul ni au tactile.
@@ -225,7 +226,10 @@ aplati par mode) et `nomos://component/<nom>` (le manifeste).
225
226
  Au-delà du manifeste, chaque brique a une **vue** servie en `ui://nomos/<nom>` — un
226
227
  document auto-suffisant (`text/html;profile=mcp-app`) que l'hôte rend dans un iframe
227
228
  sandboxé. Une **scène composite** (`ui://nomos/composite/<nom>`) assemble plusieurs
228
- briques en un écran qui a du sens (un formulaire, une carte de statut).
229
+ briques en un écran qui a du sens (un formulaire, une carte de statut). Les scènes
230
+ sont aussi exportées sur la surface publique JS (`composites`, `compositeNames`,
231
+ `findComposite`, ADR 0031) : le serveur MCP et le site rendent la **même** source,
232
+ et leur copie par défaut est neutre — elle s'injecte par props.
229
233
 
230
234
  La vue **émet des intentions** (`ready`, `select`, `change`, `error`) et ne mute jamais
231
235
  l'état : l'hôte décide. Il lui pousse l'apparence (`set-view` : thème, densité) et les
package/dist/index.js CHANGED
@@ -5778,35 +5778,47 @@ function Timeline({ items, ariaLabel, className, ...props }) {
5778
5778
  "aria-label": ariaLabel,
5779
5779
  className: cn("relative flex flex-col", className),
5780
5780
  ...props,
5781
- children: items.map((item, index) => /* @__PURE__ */ jsxs("li", {
5782
- className: "relative flex gap-3 pb-4 last:pb-0",
5783
- children: [
5784
- index < items.length - 1 ? /* @__PURE__ */ jsx("span", {
5785
- "aria-hidden": true,
5786
- className: "absolute left-1 top-4 h-full w-px bg-border"
5787
- }) : null,
5788
- /* @__PURE__ */ jsx("span", {
5789
- "aria-hidden": true,
5790
- className: "relative z-10 mt-1 size-2.5 shrink-0 rounded-full bg-primary ring-4 ring-background"
5791
- }),
5792
- /* @__PURE__ */ jsxs("div", {
5793
- className: "min-w-0",
5794
- children: [/* @__PURE__ */ jsxs("div", {
5795
- className: "flex flex-wrap items-baseline gap-x-2",
5796
- children: [/* @__PURE__ */ jsx("span", {
5797
- className: "text-sm font-medium",
5798
- children: item.label
5799
- }), /* @__PURE__ */ jsx("time", {
5800
- className: "font-mono text-xs text-muted-foreground",
5801
- children: item.at
5802
- })]
5803
- }), item.detail ? /* @__PURE__ */ jsx("p", {
5804
- className: "text-xs text-muted-foreground",
5805
- children: item.detail
5806
- }) : null]
5807
- })
5808
- ]
5809
- }, item.id))
5781
+ children: items.map((item, index) => {
5782
+ const state = item.state ?? "done";
5783
+ return /* @__PURE__ */ jsxs("li", {
5784
+ className: "relative flex gap-3 pb-4 last:pb-0",
5785
+ children: [
5786
+ index < items.length - 1 ? /* @__PURE__ */ jsx("span", {
5787
+ "aria-hidden": true,
5788
+ "data-rail": true,
5789
+ className: "absolute left-1 top-2 -bottom-2 w-px bg-border"
5790
+ }) : null,
5791
+ /* @__PURE__ */ jsx("span", {
5792
+ "aria-hidden": true,
5793
+ "data-state": state,
5794
+ className: cn("relative z-10 mt-1 size-2.5 shrink-0 rounded-full ring-4 ring-background", state === "past" ? "bg-muted-foreground" : "bg-primary")
5795
+ }),
5796
+ /* @__PURE__ */ jsxs("div", {
5797
+ className: "min-w-0",
5798
+ children: [/* @__PURE__ */ jsxs("div", {
5799
+ className: "flex flex-wrap items-baseline gap-x-2",
5800
+ children: [
5801
+ /* @__PURE__ */ jsx("span", {
5802
+ className: "text-sm font-medium",
5803
+ children: item.label
5804
+ }),
5805
+ item.stateLabel ? /* @__PURE__ */ jsx("span", {
5806
+ className: "sr-only",
5807
+ children: item.stateLabel
5808
+ }) : null,
5809
+ /* @__PURE__ */ jsx("time", {
5810
+ className: "font-mono text-xs text-muted-foreground",
5811
+ children: item.at
5812
+ })
5813
+ ]
5814
+ }), item.detail ? /* @__PURE__ */ jsx("p", {
5815
+ className: "text-xs text-muted-foreground",
5816
+ children: item.detail
5817
+ }) : null]
5818
+ })
5819
+ ]
5820
+ }, item.id);
5821
+ })
5810
5822
  });
5811
5823
  }
5812
5824
  //#endregion
@@ -5835,7 +5847,9 @@ var timelineManifest = {
5835
5847
  {
5836
5848
  id: "c",
5837
5849
  at: "2026-09-30 18:05",
5838
- label: "sync triage"
5850
+ label: "sync triage",
5851
+ state: "past",
5852
+ stateLabel: "passé"
5839
5853
  }
5840
5854
  ]
5841
5855
  },
@@ -5846,7 +5860,7 @@ var timelineManifest = {
5846
5860
  type: "TimelineItem[]",
5847
5861
  required: true,
5848
5862
  check: "accepted",
5849
- description: "Les événements : `id`, `at` (date déjà formatée), `label`, `detail?`."
5863
+ description: "Les événements : `id`, `at` (date déjà formatée), `label`, `detail?`, `state?` (`done` par défaut, `past` grisé) et `stateLabel?` (le texte accessible de l'état, obligatoire pour `past` — la couleur seule ne suffit pas)."
5850
5864
  },
5851
5865
  {
5852
5866
  name: "ariaLabel",
@@ -5863,15 +5877,23 @@ var timelineManifest = {
5863
5877
  description: "Les classes de l'appelant, fusionnées après celles du composant."
5864
5878
  }
5865
5879
  ],
5866
- usages: [{
5867
- when: "montrer une suite d’événements récents (synchronisations, déploiements)",
5868
- use: "<Timeline items={events} ariaLabel={t.timeline.label} />",
5869
- avoid: "faire formater la date par le cœur : le format appartient à l’app"
5870
- }, {
5871
- when: "un seul événement, sans suite",
5872
- use: "une ligne simple, pas une frise",
5873
- avoid: "une frise d’un seul point, qui suggère une chronologie inexistante"
5874
- }]
5880
+ usages: [
5881
+ {
5882
+ when: "montrer une suite d’événements récents (synchronisations, déploiements)",
5883
+ use: "<Timeline items={events} ariaLabel={t.timeline.label} />",
5884
+ avoid: "faire formater la date par le cœur : le format appartient à l’app"
5885
+ },
5886
+ {
5887
+ when: "un seul événement, sans suite",
5888
+ use: "une ligne simple, pas une frise",
5889
+ avoid: "une frise d’un seul point, qui suggère une chronologie inexistante"
5890
+ },
5891
+ {
5892
+ when: "marquer un point comme passé",
5893
+ use: "state: 'past' avec un stateLabel fourni par l’app (ex. « passé »)",
5894
+ avoid: "se fier à la couleur seule : le point est aria-hidden, l’état doit être lu"
5895
+ }
5896
+ ]
5875
5897
  };
5876
5898
  //#endregion
5877
5899
  //#region src/catalogue/contract.ts
@@ -6271,6 +6293,102 @@ function findComponent(name) {
6271
6293
  return entry;
6272
6294
  }
6273
6295
  //#endregion
6296
+ //#region src/composites/index.tsx
6297
+ var composites = [
6298
+ {
6299
+ name: "form",
6300
+ title: "Form",
6301
+ summary: "An end-to-end form — a grid of fields and actions — assembled from the core bricks.",
6302
+ render: (props = {}) => /* @__PURE__ */ jsx("div", {
6303
+ style: {
6304
+ maxWidth: 640,
6305
+ margin: "0 auto",
6306
+ padding: 16
6307
+ },
6308
+ children: /* @__PURE__ */ jsxs(Form, {
6309
+ columns: 2,
6310
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Button, {
6311
+ variant: "outline",
6312
+ children: "Cancel"
6313
+ }), /* @__PURE__ */ jsx(Button, { children: String(props.submitLabel ?? "Save") })] }),
6314
+ children: [/* @__PURE__ */ jsx(Field, {
6315
+ label: "Name",
6316
+ htmlFor: "scene-form-name",
6317
+ children: /* @__PURE__ */ jsx(Input, {
6318
+ id: "scene-form-name",
6319
+ defaultValue: String(props.name ?? "Item 42")
6320
+ })
6321
+ }), /* @__PURE__ */ jsx(Field, {
6322
+ label: "Score",
6323
+ htmlFor: "scene-form-score",
6324
+ hint: "from 1 to 5",
6325
+ children: /* @__PURE__ */ jsx(NumberField, {
6326
+ id: "scene-form-score",
6327
+ min: 1,
6328
+ max: 5,
6329
+ defaultValue: "3",
6330
+ "aria-label": "score"
6331
+ })
6332
+ })]
6333
+ })
6334
+ })
6335
+ },
6336
+ {
6337
+ name: "status",
6338
+ title: "Status card",
6339
+ summary: "A status: a card, a state badge and a gap banner.",
6340
+ render: (props = {}) => /* @__PURE__ */ jsx("div", {
6341
+ style: {
6342
+ maxWidth: 640,
6343
+ margin: "0 auto",
6344
+ padding: 16,
6345
+ display: "flex",
6346
+ flexDirection: "column",
6347
+ gap: 12
6348
+ },
6349
+ children: /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs("div", {
6350
+ style: {
6351
+ display: "flex",
6352
+ alignItems: "center",
6353
+ gap: 8
6354
+ },
6355
+ children: [/* @__PURE__ */ jsx(CardTitle, { children: String(props.product ?? "Product") }), /* @__PURE__ */ jsx(Badge, {
6356
+ variant: "outline",
6357
+ children: String(props.status ?? "available")
6358
+ })]
6359
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(Alert, {
6360
+ tone: "warning",
6361
+ title: "missing signals",
6362
+ children: String(props.gap ?? "Monitoring: token not configured — a gap, not a zero.")
6363
+ }) })] })
6364
+ })
6365
+ },
6366
+ {
6367
+ name: "overlay",
6368
+ title: "Overlay",
6369
+ summary: "An open panel: the scrim, the stacking and the motion come from the tokens (ADR 0027).",
6370
+ render: (props = {}) => /* @__PURE__ */ jsx("div", {
6371
+ style: { padding: 16 },
6372
+ children: /* @__PURE__ */ jsxs(Sheet, {
6373
+ open: true,
6374
+ children: [/* @__PURE__ */ jsx(SheetTrigger, {
6375
+ asChild: true,
6376
+ children: /* @__PURE__ */ jsx(Button, { children: String(props.trigger ?? "Open") })
6377
+ }), /* @__PURE__ */ jsx(SheetContent, {
6378
+ side: props.side ?? "right",
6379
+ children: /* @__PURE__ */ jsxs(SheetHeader, { children: [/* @__PURE__ */ jsx(SheetTitle, { children: String(props.title ?? "Panel") }), /* @__PURE__ */ jsx(SheetDescription, { children: String(props.body ?? "A floating layer served as a view.") })] })
6380
+ })]
6381
+ })
6382
+ })
6383
+ }
6384
+ ];
6385
+ var compositeNames = composites.map((composite) => composite.name);
6386
+ function findComposite(name) {
6387
+ const composite = composites.find((candidate) => candidate.name === name);
6388
+ if (!composite) throw new Error(`Scènes : composite introuvable : \`${name}\` (connues : ${compositeNames.join(", ")}).`);
6389
+ return composite;
6390
+ }
6391
+ //#endregion
6274
6392
  //#region src/tokens/build.mjs
6275
6393
  /**
6276
6394
  * La dérivation des tokens : une source JSON, deux rendus (ADR 0004).
@@ -6632,4 +6750,4 @@ var tokensResource = {
6632
6750
  }
6633
6751
  };
6634
6752
  //#endregion
6635
- export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, Code, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CompactMeter, CopyButton, Counter, DataTablePagination, DataTableToolbar, Dialog, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FacetFilter, FacetedDataTable, Field, Fieldset, Footer, Form, Freshness, Heading, Input, Kicker, Label, Link, Meter, Navbar, NumberField, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProgressBar, RadioGroup, RadioGroupItem, Rating, ScrollArea, ScrollBar, SearchField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectionTree, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Switch, TONES, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, Timeline, Toast, ToastProvider, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tree, accordionManifest, alertDialogManifest, alertManifest, avatarManifest, badgeManifest, badgeVariants, badgeVariantsConfig, buttonManifest, buttonVariants, buttonVariantsConfig, cardManifest, catalogue, checkboxManifest, chipManifest, cn, codeBlockManifest, codeManifest, collapsibleManifest, componentManifestSchema, componentNames, copyButtonManifest, copyButtonVariantsConfig, counterManifest, dataTableFeatures, dataTablePaginationManifest, dataTableToolbarManifest, dialogManifest, dropdownMenuManifest, emptyStateManifest, facetFilterManifest, fieldManifest, fieldsetManifest, findComponent, footerManifest, formManifest, freshnessManifest, headingManifest, headingVariants, headingVariantsConfig, inputManifest, kickerManifest, kickerVariantsConfig, labelManifest, linkManifest, meterManifest, navbarManifest, numberFieldManifest, popoverManifest, progressBarManifest, radioManifest, ratingManifest, renderCss, resolveSkin, scrollAreaManifest, searchFieldManifest, selectManifest, separatorManifest, sheetManifest, skeletonManifest, switchManifest, tableManifest, tabsManifest, textManifest, textVariants, textVariantsConfig, textareaManifest, timelineManifest, toastManifest, toggleGroupManifest, toggleManifest, toggleVariants, toggleVariantsConfig, tokensResource, toneClasses, tooltipManifest, treeManifest, useToast, validateCatalogue };
6753
+ export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Chip, Code, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CompactMeter, CopyButton, Counter, DataTablePagination, DataTableToolbar, Dialog, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FacetFilter, FacetedDataTable, Field, Fieldset, Footer, Form, Freshness, Heading, Input, Kicker, Label, Link, Meter, Navbar, NumberField, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ProgressBar, RadioGroup, RadioGroupItem, Rating, ScrollArea, ScrollBar, SearchField, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SelectionTree, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, Switch, TONES, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, Timeline, Toast, ToastProvider, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tree, accordionManifest, alertDialogManifest, alertManifest, avatarManifest, badgeManifest, badgeVariants, badgeVariantsConfig, buttonManifest, buttonVariants, buttonVariantsConfig, cardManifest, catalogue, checkboxManifest, chipManifest, cn, codeBlockManifest, codeManifest, collapsibleManifest, componentManifestSchema, componentNames, compositeNames, composites, copyButtonManifest, copyButtonVariantsConfig, counterManifest, dataTableFeatures, dataTablePaginationManifest, dataTableToolbarManifest, dialogManifest, dropdownMenuManifest, emptyStateManifest, facetFilterManifest, fieldManifest, fieldsetManifest, findComponent, findComposite, footerManifest, formManifest, freshnessManifest, headingManifest, headingVariants, headingVariantsConfig, inputManifest, kickerManifest, kickerVariantsConfig, labelManifest, linkManifest, meterManifest, navbarManifest, numberFieldManifest, popoverManifest, progressBarManifest, radioManifest, ratingManifest, renderCss, resolveSkin, scrollAreaManifest, searchFieldManifest, selectManifest, separatorManifest, sheetManifest, skeletonManifest, switchManifest, tableManifest, tabsManifest, textManifest, textVariants, textVariantsConfig, textareaManifest, timelineManifest, toastManifest, toggleGroupManifest, toggleManifest, toggleVariants, toggleVariantsConfig, tokensResource, toneClasses, tooltipManifest, treeManifest, useToast, validateCatalogue };