opsfuse-ui 0.1.1 → 0.1.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.
@@ -9,6 +9,7 @@ You are an expert on the OpsFuse UI component library. When invoked, answer ques
9
9
  ```tsx
10
10
  import { Button, Card, CardContent, Input, Badge, Recharts } from "opsfuse-ui";
11
11
  import { Home, Search, Plus } from "opsfuse-ui/icons";
12
+ import { format, addDays } from "opsfuse-ui/date-fns";
12
13
  // or for performance-sensitive apps:
13
14
  import { Button, Badge } from "opsfuse-ui/core";
14
15
  import { ChartContainer, Calendar } from "opsfuse-ui/extended";
@@ -17,9 +18,10 @@ import { Button } from "@/components/ui/button";
17
18
  ```
18
19
 
19
20
  - `opsfuse-ui/icons` — flat Lucide icon re-exports. Write `<Search />` directly. For names that collide with opsfuse components (`Badge`, `Calendar`, `Command`, `Form`, `Sheet`, `Sidebar`, `Table`) either alias on import or use `Lucide.<Icon>` from the main entry.
21
+ - `opsfuse-ui/date-fns` — flat `date-fns` re-exports (functions + locales). Use the `DateFns` namespace from the main entry (`import { DateFns } from "opsfuse-ui"`) only for collision cases.
20
22
  - `Recharts` (main entry) — namespace re-export of `recharts`. Write `<Recharts.BarChart />`.
21
23
 
22
- Never install `lucide-react` or `recharts` directly in host apps.
24
+ Never install `lucide-react`, `recharts`, or `date-fns` directly in host apps.
23
25
 
24
26
  All components require a `.opsfuse-ui` ancestor class (provided by `OpsfuseThemeProvider`).
25
27
 
@@ -1392,6 +1394,50 @@ const Icon = Icons[name as keyof typeof Icons] as Icons.LucideIcon;
1392
1394
 
1393
1395
  ---
1394
1396
 
1397
+ ## date-fns
1398
+
1399
+ **Subpath:** `opsfuse-ui/date-fns` (flat re-export of [`date-fns`](https://date-fns.org/) — all functions and locales, fully tree-shakable)
1400
+ **Main entry:** `DateFns` namespace (`import { DateFns } from "opsfuse-ui"`) — only needed for collision cases
1401
+
1402
+ ### Direct named import (preferred)
1403
+
1404
+ Import any date-fns function from `opsfuse-ui/date-fns` — no need to install `date-fns` directly. The library pins the version, so the host and library always agree.
1405
+
1406
+ ```tsx
1407
+ import { format, addDays, parseISO, differenceInDays } from "opsfuse-ui/date-fns";
1408
+
1409
+ const today = new Date();
1410
+ const next = addDays(today, 7);
1411
+ const label = format(next, "PPP");
1412
+ ```
1413
+
1414
+ ### Locales
1415
+
1416
+ Locales live at the `opsfuse-ui/date-fns/locale` subpath (mirroring date-fns itself):
1417
+
1418
+ ```tsx
1419
+ import { format } from "opsfuse-ui/date-fns";
1420
+ import { fr, enUS } from "opsfuse-ui/date-fns/locale";
1421
+
1422
+ format(new Date(), "PPP", { locale: fr });
1423
+ ```
1424
+
1425
+ ### Name collisions
1426
+
1427
+ If a date-fns export name collides with another import in your file, use the `DateFns` namespace:
1428
+
1429
+ ```tsx
1430
+ import { DateFns } from "opsfuse-ui";
1431
+
1432
+ DateFns.format(new Date(), "yyyy-MM-dd");
1433
+ ```
1434
+
1435
+ ### Why route through the library
1436
+
1437
+ Host apps must **not** install or import `date-fns` directly. Routing through `opsfuse-ui/date-fns` guarantees a single pinned version across the host and library (matching the version the `Calendar` and date components are built against), avoids duplicate copies in the bundle, and keeps host upgrades centralized to bumping `opsfuse-ui`.
1438
+
1439
+ ---
1440
+
1395
1441
  ## Provider / Theme
1396
1442
 
1397
1443
  **Export:** `OpsfuseThemeProvider`, `OpsfuseRoot`, `OPSFUSE_THEME_SCOPE`, `OPSFUSE_BRAND_THEMES`, `DEFAULT_OPSFUSE_BRAND_THEME`
@@ -487,6 +487,7 @@ export default function RootLayout({
487
487
  | Use design tokens `var(--subtle-foreground)` | Use `text-gray-600` or `#6b7280` |
488
488
  | Use `data-slot` on custom component parts | Skip `data-slot` on wrappers |
489
489
  | Use `confirm()` before destructive actions | Use `window.confirm()` |
490
- | Import icons from `lucide-react` | Import from other icon libraries |
490
+ | Import icons from `opsfuse-ui/icons` | Import from `lucide-react` or other icon libraries |
491
+ | Import dates from `opsfuse-ui/date-fns` | Install or import `date-fns` directly |
491
492
  | Use `<Field>` for form layout | Raw `div` + `label` + `input` |
492
493
  | Test light AND dark mode after migration | Only check light mode |
@@ -70,6 +70,14 @@ Host apps must **not** install or import `lucide-react` directly — the full ic
70
70
 
71
71
  For names that collide with opsfuse component exports (`Badge`, `Calendar`, `Command`, `Form`, `Sheet`, `Sidebar`, `Table`), alias on import (`import { Calendar as CalendarIcon } from "opsfuse-ui/icons"`) or use `<Lucide.Calendar />` from the main entry.
72
72
 
73
+ ### Dates always from `opsfuse-ui/date-fns`
74
+
75
+ ```tsx
76
+ import { format, addDays, parseISO } from "opsfuse-ui/date-fns";
77
+ ```
78
+
79
+ Host apps must **not** install or import `date-fns` directly — the full `date-fns` surface (including locales) is re-exported as flat named exports from `opsfuse-ui/date-fns` (and as the `DateFns` namespace from the main entry, for collision cases: `import { DateFns } from "opsfuse-ui"` → `DateFns.format(...)`). This guarantees a single pinned version across the host and library.
80
+
73
81
  ---
74
82
 
75
83
  ## 2. PROVIDERS SETUP (main.tsx)
@@ -152,7 +160,8 @@ Write stories for all new components. Test in both light and dark mode. Page-lev
152
160
  | Use `cva()` for multi-variant components | Inline ternary chains for variants |
153
161
  | Add `data-slot` to every component part | Skip `data-slot` on wrapper/part elements |
154
162
  | Use `<Field>` compound for form inputs | Lay out label + input with raw divs |
155
- | Import icons from `lucide-react` | Import from other icon libraries |
163
+ | Import icons from `opsfuse-ui/icons` | Import from `lucide-react` or other icon libraries |
164
+ | Import dates from `opsfuse-ui/date-fns` | Install/import `date-fns` directly in host apps |
156
165
  | Use `.transition-micro/smooth/data` motion classes | Hardcode `transition duration-200` everywhere |
157
166
  | Use `confirm()` before destructive actions | Skip confirmation on destructive button clicks |
158
167
  | Use spacing tokens `--space-1` through `--space-10` | Use arbitrary gaps like `gap-[13px]` |
package/README.md CHANGED
@@ -91,11 +91,16 @@ import { Button, cn } from "opsfuse-ui";
91
91
  | `opsfuse-ui/core` | Core components only (no charts, calendar, carousel, etc.) |
92
92
  | `opsfuse-ui/extended` | Heavier components (Chart, Calendar, Carousel, Command, Combobox, Drawer, InputOTP, Sonner) |
93
93
  | `opsfuse-ui/recharts` | Re-exported Recharts with theme support |
94
+ | `opsfuse-ui/icons` | Flat re-export of `lucide-react` icons |
95
+ | `opsfuse-ui/date-fns` | Flat re-export of `date-fns` utilities |
96
+ | `opsfuse-ui/date-fns/locale` | Flat re-export of `date-fns` locales |
94
97
 
95
98
  ```ts
96
99
  import { Button, Badge, OpsfuseRoot } from "opsfuse-ui/core";
97
100
  import { ChartContainer, Calendar } from "opsfuse-ui/extended";
98
101
  import { Recharts } from "opsfuse-ui/recharts";
102
+ import { Home, Search } from "opsfuse-ui/icons";
103
+ import { format, addDays } from "opsfuse-ui/date-fns";
99
104
  ```
100
105
 
101
106
  **TypeScript:** use `moduleResolution` `"bundler"` or `"node16"` / `"nodenext"` so `package.json` `exports` resolve correctly.
package/dist/core.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as e, C as t, D as n, E as r, F as i, I as a, M as o, N as s, O as c, P as l, S as u, Ut as d, _ as f, a as p, b as m, c as h, f as g, g as _, h as v, i as y, k as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, v as k, x as A, y as j } from "./input-group-DIfVGMYe.js";
2
- import { $ as M, $n as N, $r as P, $t as F, A as I, An as L, Ar as R, At as z, B, Bn as V, Br as H, Bt as U, C as W, Cn as G, Cr as K, Ct as q, D as J, Dn as Y, Dr as X, Dt as Z, E as Q, En as $, Er as ee, Et as te, F as ne, Fn as re, Fr as ie, Ft as ae, G as oe, Gn as se, Gr as ce, Gt as le, H as ue, Hn as de, Hr as fe, Ht as pe, I as me, In as he, Ir as ge, It as _e, J as ve, Jn as ye, Jr as be, Jt as xe, K as Se, Kn as Ce, Kr as we, Kt as Te, L as Ee, Ln as De, Lr as Oe, Lt as ke, M as Ae, Mn as je, Mr as Me, Mt as Ne, N as Pe, Nn as Fe, Nr as Ie, Nt as Le, O as Re, On as ze, Or as Be, Ot as Ve, P as He, Pn as Ue, Pr as We, Pt as Ge, Q as Ke, Qn as qe, Qr as Je, Qt as Ye, R as Xe, Rn as Ze, Rr as Qe, Rt as $e, S as et, Sn as tt, Sr as nt, St as rt, T as it, Tn as at, Tr as ot, Tt as st, U as ct, Un as lt, Ur as ut, Ut as dt, V as ft, Vn as pt, Vr as mt, Vt as ht, W as gt, Wn as _t, Wr as vt, Wt as yt, X as bt, Xn as xt, Xr as St, Xt as Ct, Y as wt, Yn as Tt, Yr as Et, Yt as Dt, Z as Ot, Zn as kt, Zr as At, Zt as jt, _ as Mt, _n as Nt, _r as Pt, _t as Ft, a as It, ai as Lt, an as Rt, ar as zt, at as Bt, b as Vt, bn as Ht, br as Ut, bt as Wt, c as Gt, ci as Kt, cn as qt, cr as Jt, ct as Yt, d as Xt, dn as Zt, dr as Qt, dt as $t, ei as en, en as tn, er as nn, et as rn, f as an, fn as on, fr as sn, ft as cn, g as ln, gn as un, gr as dn, gt as fn, h as pn, hn as mn, hr as hn, ht as gn, i as _n, ii as vn, in as yn, ir as bn, it as xn, j as Sn, jn as Cn, jr as wn, jt as Tn, k as En, kn as Dn, kr as On, kt as kn, l as An, li as jn, ln as Mn, lr as Nn, lt as Pn, m as Fn, mn as In, mr as Ln, mt as Rn, n as zn, ni as Bn, nn as Vn, nr as Hn, nt as Un, o as Wn, oi as Gn, on as Kn, or as qn, ot as Jn, p as Yn, pn as Xn, pr as Zn, pt as Qn, q as $n, qn as er, qr as tr, qt as nr, r as rr, ri as ir, rn as ar, rr as or, rt as sr, s as cr, si as lr, sn as ur, sr as dr, st as fr, t as pr, ti as mr, tn as hr, tr as gr, tt as _r, u as vr, ui as yr, un as br, ur as xr, ut as Sr, v as Cr, vn as wr, vr as Tr, vt as Er, w as Dr, wn as Or, wr as kr, wt as Ar, x as jr, xn as Mr, xr as Nr, xt as Pr, y as Fr, yn as Ir, yr as Lr, yt as Rr, z as zr, zn as Br, zr as Vr, zt as Hr } from "./toggle-group-D21Ul2kd.js";
1
+ import { A as e, C as t, D as n, E as r, F as i, I as a, M as o, N as s, O as c, P as l, S as u, Ut as d, _ as f, a as p, b as m, c as h, f as g, g as _, h as v, i as y, k as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, v as k, x as A, y as j } from "./input-group-8e8jjdvl.js";
2
+ import { $ as M, $n as N, $r as P, $t as F, A as I, An as L, Ar as R, At as z, B, Bn as V, Br as H, Bt as U, C as W, Cn as G, Cr as K, Ct as q, D as J, Dn as Y, Dr as X, Dt as Z, E as Q, En as $, Er as ee, Et as te, F as ne, Fn as re, Fr as ie, Ft as ae, G as oe, Gn as se, Gr as ce, Gt as le, H as ue, Hn as de, Hr as fe, Ht as pe, I as me, In as he, Ir as ge, It as _e, J as ve, Jn as ye, Jr as be, Jt as xe, K as Se, Kn as Ce, Kr as we, Kt as Te, L as Ee, Ln as De, Lr as Oe, Lt as ke, M as Ae, Mn as je, Mr as Me, Mt as Ne, N as Pe, Nn as Fe, Nr as Ie, Nt as Le, O as Re, On as ze, Or as Be, Ot as Ve, P as He, Pn as Ue, Pr as We, Pt as Ge, Q as Ke, Qn as qe, Qr as Je, Qt as Ye, R as Xe, Rn as Ze, Rr as Qe, Rt as $e, S as et, Sn as tt, Sr as nt, St as rt, T as it, Tn as at, Tr as ot, Tt as st, U as ct, Un as lt, Ur as ut, Ut as dt, V as ft, Vn as pt, Vr as mt, Vt as ht, W as gt, Wn as _t, Wr as vt, Wt as yt, X as bt, Xn as xt, Xr as St, Xt as Ct, Y as wt, Yn as Tt, Yr as Et, Yt as Dt, Z as Ot, Zn as kt, Zr as At, Zt as jt, _ as Mt, _n as Nt, _r as Pt, _t as Ft, a as It, ai as Lt, an as Rt, ar as zt, at as Bt, b as Vt, bn as Ht, br as Ut, bt as Wt, c as Gt, ci as Kt, cn as qt, cr as Jt, ct as Yt, d as Xt, dn as Zt, dr as Qt, dt as $t, ei as en, en as tn, er as nn, et as rn, f as an, fn as on, fr as sn, ft as cn, g as ln, gn as un, gr as dn, gt as fn, h as pn, hn as mn, hr as hn, ht as gn, i as _n, ii as vn, in as yn, ir as bn, it as xn, j as Sn, jn as Cn, jr as wn, jt as Tn, k as En, kn as Dn, kr as On, kt as kn, l as An, li as jn, ln as Mn, lr as Nn, lt as Pn, m as Fn, mn as In, mr as Ln, mt as Rn, n as zn, ni as Bn, nn as Vn, nr as Hn, nt as Un, o as Wn, oi as Gn, on as Kn, or as qn, ot as Jn, p as Yn, pn as Xn, pr as Zn, pt as Qn, q as $n, qn as er, qr as tr, qt as nr, r as rr, ri as ir, rn as ar, rr as or, rt as sr, s as cr, si as lr, sn as ur, sr as dr, st as fr, t as pr, ti as mr, tn as hr, tr as gr, tt as _r, u as vr, ui as yr, un as br, ur as xr, ut as Sr, v as Cr, vn as wr, vr as Tr, vt as Er, w as Dr, wn as Or, wr as kr, wt as Ar, x as jr, xn as Mr, xr as Nr, xt as Pr, y as Fr, yn as Ir, yr as Lr, yt as Rr, z as zr, zn as Br, zr as Vr, zt as Hr } from "./toggle-group-D2isQKZo.js";
3
3
  export { Ln as Accordion, hn as AccordionContent, dn as AccordionItem, Pt as AccordionTrigger, P as Alert, en as AlertAction, mr as AlertDescription, mt as AlertDialog, fe as AlertDialogAction, ut as AlertDialogCancel, vt as AlertDialogContent, ce as AlertDialogDescription, we as AlertDialogFooter, tr as AlertDialogHeader, be as AlertDialogMedia, Et as AlertDialogOverlay, St as AlertDialogPortal, At as AlertDialogTitle, Je as AlertDialogTrigger, Bn as AlertProvider, ir as AlertTitle, Zn as AspectRatio, sn as Avatar, xr as Badge, or as Breadcrumb, bn as BreadcrumbEllipsis, zt as BreadcrumbItem, qn as BreadcrumbLink, dr as BreadcrumbList, Jt as BreadcrumbPage, Nn as BreadcrumbSeparator, l as Button, qe as ButtonGroup, N as ButtonGroupSeparator, nn as ButtonGroupText, se as Card, Ce as CardAction, er as CardContent, ye as CardDescription, Tt as CardFooter, xt as CardHeader, kt as CardTitle, _t as Checkbox, pt as Collapsible, de as CollapsibleContent, lt as CollapsibleTrigger, Vr as ConfirmationDialogProvider, $ as ContextMenu, Y as ContextMenuCheckboxItem, ze as ContextMenuContent, Dn as ContextMenuGroup, L as ContextMenuItem, Cn as ContextMenuLabel, je as ContextMenuPortal, Fe as ContextMenuRadioGroup, Ue as ContextMenuRadioItem, re as ContextMenuSeparator, he as ContextMenuShortcut, De as ContextMenuSub, Ze as ContextMenuSubContent, Br as ContextMenuSubTrigger, V as ContextMenuTrigger, o as DEFAULT_OPSFUSE_BRAND_THEME, g as Dialog, T as DialogClose, S as DialogContent, v as DialogDescription, _ as DialogFooter, f as DialogHeader, k as DialogOverlay, j as DialogPortal, m as DialogProvider, A as DialogTitle, u as DialogTrigger, Or as DirectionProvider, G as DropdownMenu, tt as Empty, on as Field, Xn as FieldContent, In as FieldDescription, mn as FieldError, un as FieldGroup, Nt as FieldLabel, wr as FieldLegend, Ir as FieldSeparator, Ht as FieldSet, Mr as FieldTitle, Mn as HoverCard, br as HoverCardContent, Zt as HoverCardTrigger, h as Input, O as InputGroup, C as InputGroupAddon, E as InputGroupButton, y as InputGroupInput, p as InputGroupText, w as InputGroupTextarea, Ye as Item, F as ItemActions, tn as ItemContent, hr as ItemDescription, Vn as ItemFooter, ar as ItemGroup, yn as ItemHeader, Rt as ItemMedia, Kn as ItemSeparator, ur as ItemTitle, Ct as Kbd, jt as KbdGroup, x as Label, Ge as Menubar, ae as MenubarCheckboxItem, _e as MenubarContent, ke as MenubarGroup, $e as MenubarItem, Hr as MenubarLabel, U as MenubarMenu, ht as MenubarPortal, pe as MenubarRadioGroup, dt as MenubarRadioItem, yt as MenubarSeparator, le as MenubarShortcut, Te as MenubarSub, nr as MenubarSubContent, xe as MenubarSubTrigger, Dt as MenubarTrigger, st as NavigationMenu, te as NavigationMenuContent, Z as NavigationMenuIndicator, Ve as NavigationMenuItem, kn as NavigationMenuLink, z as NavigationMenuList, Tn as NavigationMenuTrigger, Ne as NavigationMenuViewport, s as OPSFUSE_BRAND_THEMES, e as OPSFUSE_THEME_SCOPE, Lr as OpsfuseRoot, Ut as OpsfuseThemeProvider, qt as PageHeader, Er as Pagination, Rr as PaginationContent, Wt as PaginationEllipsis, Pr as PaginationItem, rt as PaginationLink, q as PaginationNext, Ar as PaginationPrevious, Ft as PaginationWrapper, Sr as Popover, $t as PopoverAnchor, cn as PopoverContent, Qn as PopoverDescription, Rn as PopoverHeader, gn as PopoverTitle, fn as PopoverTrigger, Pn as Progress, fr as RadioGroup, Yt as RadioGroupItem, yr as RecruitSmartly, xn as ResizableHandle, Bt as ResizablePanel, Jn as ResizablePanelGroup, oe as SSelect, K as STooltip, Un as ScrollArea, sr as ScrollBar, gt as Select, Se as SelectContent, $n as SelectField, ve as SelectGroup, wt as SelectItem, bt as SelectLabel, Ot as SelectScrollDownButton, Ke as SelectScrollUpButton, M as SelectSeparator, rn as SelectTrigger, _r as SelectValue, Hn as Separator, On as Sheet, R as SheetClose, wn as SheetContent, Me as SheetDescription, Ie as SheetFooter, We as SheetHeader, ie as SheetProvider, ge as SheetTitle, Oe as SheetTrigger, Fr as Sidebar, Vt as SidebarContent, jr as SidebarFooter, et as SidebarGroup, W as SidebarGroupAction, Dr as SidebarGroupContent, it as SidebarGroupLabel, Q as SidebarHeader, J as SidebarInput, Re as SidebarInset, En as SidebarMenu, I as SidebarMenuAction, Sn as SidebarMenuBadge, Ae as SidebarMenuButton, Pe as SidebarMenuItem, He as SidebarMenuSkeleton, ne as SidebarMenuSub, me as SidebarMenuSubButton, Ee as SidebarMenuSubItem, Xe as SidebarProvider, zr as SidebarRail, B as SidebarSeparator, ft as SidebarTrigger, ct as Skeleton, jn as SkillReady, ee as Slider, X as SliderDialogProvider, a as Spinner, Cr as Switch, vr as Table, Xt as TableBody, an as TableCaption, Yn as TableCell, Fn as TableFooter, pn as TableHead, ln as TableHeader, Mt as TableRow, Wn as Tabs, It as TabsComponent, cr as TabsContent, Gt as TabsList, An as TabsTrigger, Kt as TalentScan, D as Textarea, rr as Toggle, pr as ToggleGroup, zn as ToggleGroupItem, Nr as Tooltip, nt as TooltipContent, kr as TooltipProvider, ot as TooltipTrigger, lr as Verity, Gn as WorkLog, Qt as badgeVariants, gr as buttonGroupVariants, i as buttonVariants, d as cn, H as confirm, vn as dismissAlert, r as mergeOpsfusePortalSurface, Le as navigationMenuTriggerStyle, t as openDialog, Qe as openSheet, Be as openSlider, n as opsfuseBrandThemeClass, Lt as showAlert, _n as toggleVariants, at as useDirection, Tr as useIsMobile, c as useOpsfuseBrandTheme, b as useOpsfusePortalSurface, ue as useSidebar };