@momoi-labs/kiso-react 0.2.0 → 0.3.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 (69) hide show
  1. package/README.md +87 -13
  2. package/dist/alert.d.ts +10 -0
  3. package/dist/alert.js +27 -0
  4. package/dist/app-shell.d.ts +4 -0
  5. package/dist/app-shell.js +11 -0
  6. package/dist/breadcrumb.d.ts +10 -0
  7. package/dist/breadcrumb.js +23 -0
  8. package/dist/command-palette.d.ts +17 -0
  9. package/dist/command-palette.js +78 -0
  10. package/dist/dialog.d.ts +14 -0
  11. package/dist/dialog.js +39 -0
  12. package/dist/dot.d.ts +9 -0
  13. package/dist/dot.js +21 -0
  14. package/dist/drawer.d.ts +9 -0
  15. package/dist/drawer.js +17 -0
  16. package/dist/dropdown-menu.d.ts +13 -0
  17. package/dist/dropdown-menu.js +32 -0
  18. package/dist/empty-state.d.ts +14 -0
  19. package/dist/empty-state.js +30 -0
  20. package/dist/header.d.ts +3 -0
  21. package/dist/header.js +8 -0
  22. package/dist/index.d.ts +31 -0
  23. package/dist/index.js +31 -0
  24. package/dist/kv.d.ts +5 -0
  25. package/dist/kv.js +12 -0
  26. package/dist/link.d.ts +10 -0
  27. package/dist/link.js +15 -0
  28. package/dist/log-view.d.ts +17 -0
  29. package/dist/log-view.js +56 -0
  30. package/dist/navigation.d.ts +12 -0
  31. package/dist/navigation.js +23 -0
  32. package/dist/page-header.d.ts +9 -0
  33. package/dist/page-header.js +19 -0
  34. package/dist/pagination.d.ts +10 -0
  35. package/dist/pagination.js +21 -0
  36. package/dist/popover.d.ts +8 -0
  37. package/dist/popover.js +21 -0
  38. package/dist/search.d.ts +5 -0
  39. package/dist/search.js +9 -0
  40. package/dist/select.d.ts +11 -0
  41. package/dist/select.js +30 -0
  42. package/dist/separator.d.ts +4 -0
  43. package/dist/separator.js +9 -0
  44. package/dist/sidebar.d.ts +6 -0
  45. package/dist/sidebar.js +17 -0
  46. package/dist/skeleton.d.ts +7 -0
  47. package/dist/skeleton.js +15 -0
  48. package/dist/spinner.d.ts +9 -0
  49. package/dist/spinner.js +15 -0
  50. package/dist/split.d.ts +11 -0
  51. package/dist/split.js +64 -0
  52. package/dist/stat.d.ts +12 -0
  53. package/dist/stat.js +32 -0
  54. package/dist/styles.css +156 -1
  55. package/dist/switch.d.ts +4 -0
  56. package/dist/switch.js +11 -0
  57. package/dist/tabs.d.ts +7 -0
  58. package/dist/tabs.js +18 -0
  59. package/dist/textarea.d.ts +3 -0
  60. package/dist/textarea.js +6 -0
  61. package/dist/toast.d.ts +15 -0
  62. package/dist/toast.js +43 -0
  63. package/dist/tooltip.d.ts +7 -0
  64. package/dist/tooltip.js +20 -0
  65. package/dist/use-isomorphic-layout-effect.d.ts +2 -0
  66. package/dist/use-isomorphic-layout-effect.js +4 -0
  67. package/dist/validation-message.d.ts +3 -0
  68. package/dist/validation-message.js +8 -0
  69. package/package.json +2 -2
package/README.md CHANGED
@@ -30,21 +30,98 @@ is required. The Kiso base stylesheet includes global styles and Google Fonts.
30
30
 
31
31
  ## Available components
32
32
 
33
+ Controls and forms
34
+
33
35
  - Button and `buttonVariants`; Badge and `badgeVariants`.
34
- - BrandMark and TerminalIcon, the momoi-labs terminal prompt glyph.
35
- - Input, Label, Checkbox, and FormField.
36
+ - Input, Textarea, Search, Label, Checkbox, Switch, and FormField.
37
+ - Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectGroup,
38
+ SelectLabel, and SelectSeparator.
39
+ - ValidationMessage, for a field error referenced by `aria-describedby`.
40
+
41
+ Data and structure
42
+
36
43
  - Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter.
37
44
  - Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption.
38
- - AlertDialog, Trigger, Portal, Overlay, Content, Header, Footer, Title,
39
- Description, Action, and Cancel (each prefixed with `AlertDialog`).
45
+ - EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions.
46
+ - Header, PageHeader, PageHeaderTitle, PageHeaderDescription.
47
+ - Sidebar, SidebarHeader, SidebarBody, SidebarFooter.
48
+ - AppShell and AppShellMain, the sidebar and main columns of a console.
49
+ - Split, Pane, and Splitter, a list-detail layout with a resizable divider.
50
+ - LogView, LogViewLine, LogViewTime, and LogViewLevel.
51
+ - Stat, StatHeader, StatLabel, StatValue, StatFoot, and StatDelta.
52
+ - KV, KVKey, and KVValue, a description list of fixed facts.
53
+ - Separator, horizontal or vertical, and Dot and `dotVariants`.
54
+ - BrandMark and TerminalIcon, the momoi-labs terminal prompt glyph.
55
+
56
+ Navigation
57
+
58
+ - Navigation, NavigationGroup, NavigationList, NavigationItem, NavigationLink.
59
+ - Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage,
60
+ BreadcrumbSeparator.
61
+ - Link and `linkVariants`; Pagination, PaginationPrevious, PaginationNext,
62
+ PaginationPage, PaginationEllipsis.
63
+ - Tabs, TabsList, TabsTrigger, TabsContent.
40
64
  - ThemeSelector, a controlled selector. The application owns theme persistence
41
65
  and applies `data-theme="light"` or `data-theme="dark"` to the document root.
42
66
  Remove the attribute for system mode.
43
67
 
68
+ Feedback
69
+
70
+ - Alert, AlertContent, AlertTitle, AlertDescription, and `alertVariants`.
71
+ - Spinner, Skeleton, and their variants.
72
+ - ToastProvider, ToastViewport, Toast, ToastTitle, ToastDescription,
73
+ ToastContent, ToastAction, ToastClose.
74
+
75
+ Overlays
76
+
77
+ - Dialog, DialogTrigger, DialogContent, DialogHeader, DialogBody, DialogFooter,
78
+ DialogTitle, DialogDescription, DialogClose.
79
+ - AlertDialog, Trigger, Portal, Overlay, Content, Header, Footer, Title,
80
+ Description, Action, and Cancel (each prefixed with `AlertDialog`).
81
+ - Drawer, with `placement="bottom"` or `"side"`, and the matching `Drawer*` parts.
82
+ - Popover, DropdownMenu, and Tooltip, with their trigger and content parts.
83
+ - CommandPalette, CommandPaletteInput, CommandPaletteList, CommandPaletteGroup,
84
+ CommandPaletteItem, CommandPaletteEmpty.
85
+
44
86
  Button variants are `default`, `primary`, `destructive`, and `ghost`; sizes are
45
87
  `xs`, `sm`, `md`, and `lg`. Badge variants are `neutral`, `info`, `success`,
46
- `warning`, and `danger`. Native props and refs pass through to the underlying
47
- control. FormField adds `label` and optional `hint` to Input's props.
88
+ `warning`, and `danger`. Alert and Toast variants follow their contracts:
89
+ `info` / `success` / `warning` / `error`, and `neutral` / `success` / `warning`
90
+ / `error`. Native props and refs pass through to the underlying control.
91
+ FormField adds `label` and optional `hint` to Input's props.
92
+
93
+ Navigation, Sidebar, and Link know nothing about routing. Mark the current
94
+ destination with `active`, and pass `asChild` to render a router's own link
95
+ component. CommandPalette is controlled: it owns the overlay, focus, and its
96
+ Arrow / Enter / Escape keys, while the product owns the shortcut that opens it
97
+ and the filtering that decides which items to render.
98
+
99
+ Dot variants match Badge's: `neutral`, `info`, `success`, `warning`, and
100
+ `danger`, plus `size` and `pulse`. A `neutral` Dot inherits `currentColor`, so
101
+ it takes the colour of the row it sits in. StatDelta takes the same variants.
102
+
103
+ Splitter owns the pane size, so dropping one between two Panes is the whole
104
+ setup. It writes a percentage to the pane before it, starts at `defaultSize`
105
+ and stays between `min` and `max`, and reports changes through `onSizeChange`.
106
+ It is a real `separator`: focus it and the arrow keys move it by `step`, Home
107
+ and End take it to the bounds.
108
+
109
+ LogView owns its scroller and follows the tail. New lines pin the view to the
110
+ end until the reader scrolls away, and returning to the end resumes. Drive that
111
+ from a control of your own with `follow` and `onFollowChange`, or scroll to the
112
+ end imperatively through the ref:
113
+
114
+ ```tsx
115
+ const log = useRef<LogViewHandle>(null);
116
+
117
+ <LogView ref={log} follow={follow} onFollowChange={setFollow}>
118
+ <LogViewLine>
119
+ <LogViewTime>09:41:03.901</LogViewTime>
120
+ <LogViewLevel level="warn">WARN </LogViewLevel> redis unavailable
121
+ </LogViewLine>
122
+ </LogView>
123
+ <Button onClick={() => log.current?.scrollToBottom()}>Jump to end</Button>
124
+ ```
48
125
 
49
126
  Compose confirmations with AlertDialogTitle and AlertDialogDescription inside
50
127
  AlertDialogContent, plus AlertDialogCancel and AlertDialogAction. For asynchronous
@@ -68,15 +145,12 @@ import { BrandMark, TerminalIcon } from '@momoi-labs/kiso-react';
68
145
  </div>
69
146
  ```
70
147
 
71
- The gallery covers all 36 Kiso catalog entries. Entries labelled Composition
72
- preview are examples, not additional exports from this package. CommandPalette
73
- is a layout preview without complete command keyboard behavior.
74
-
75
148
  ## Development
76
149
 
77
- From the repository root, run `npm ci`, then `npm run prototype`.
78
- The console opens at <http://127.0.0.1:5173/#overview> and the component gallery at
79
- <http://127.0.0.1:5173/#components>. All console data is simulated in memory.
150
+ From the repository root, run `npm ci`, then `npm run prototype`. The component
151
+ gallery opens at <http://127.0.0.1:5173/#components> and covers all 43 Kiso
152
+ catalog entries, each rendering the component this package exports. Its sample
153
+ data is simulated in memory.
80
154
 
81
155
  `npm run check:react` builds the demo and tests packed npm artifacts in an
82
156
  isolated consumer, including TypeScript, CSS bundling, and rendered semantics.
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const alertVariants: (props?: ({
4
+ variant?: "error" | "info" | "success" | "warning" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Alert({ className, variant, role, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
7
+ declare function AlertContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
8
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
9
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
10
+ export { Alert, AlertContent, AlertTitle, AlertDescription, alertVariants };
package/dist/alert.js ADDED
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { clsx as cn } from "clsx";
4
+ const alertVariants = cva("alert", {
5
+ variants: {
6
+ variant: {
7
+ info: "alert-info",
8
+ success: "alert-success",
9
+ warning: "alert-warning",
10
+ error: "alert-danger",
11
+ },
12
+ },
13
+ defaultVariants: { variant: "info" },
14
+ });
15
+ function Alert({ className, variant = "info", role, ...props }) {
16
+ return (_jsx("div", { "data-slot": "alert", "data-variant": variant, role: role ?? (variant === "error" ? "alert" : "status"), className: cn(alertVariants({ variant }), className), ...props }));
17
+ }
18
+ function AlertContent({ className, ...props }) {
19
+ return (_jsx("div", { "data-slot": "alert-content", className: cn("stack-xs grow", className), ...props }));
20
+ }
21
+ function AlertTitle({ className, ...props }) {
22
+ return (_jsx("p", { "data-slot": "alert-title", className: cn("alert-title", className), ...props }));
23
+ }
24
+ function AlertDescription({ className, ...props }) {
25
+ return (_jsx("p", { "data-slot": "alert-description", className: cn("alert-body", className), ...props }));
26
+ }
27
+ export { Alert, AlertContent, AlertTitle, AlertDescription, alertVariants };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ declare function AppShell({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
3
+ declare function AppShellMain({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
4
+ export { AppShell, AppShellMain };
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { clsx as cn } from "clsx";
3
+ function AppShell({ className, ...props }) {
4
+ return (_jsx("div", { "data-slot": "app-shell", className: cn("app-shell", className), ...props }));
5
+ }
6
+ /* `grow` carries the `min-width: 0` the main column needs so a wide table or
7
+ log line cannot push the sidebar off the screen. */
8
+ function AppShellMain({ className, ...props }) {
9
+ return (_jsx("main", { "data-slot": "app-shell-main", className: cn("grow", className), ...props }));
10
+ }
11
+ export { AppShell, AppShellMain };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ declare function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
3
+ declare function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
4
+ declare function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
5
+ declare function BreadcrumbLink({ className, asChild, ...props }: React.ComponentProps<"a"> & {
6
+ asChild?: boolean;
7
+ }): React.JSX.Element;
8
+ declare function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
9
+ declare function BreadcrumbSeparator({ className, children, ...props }: React.ComponentProps<"li">): React.JSX.Element;
10
+ export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, };
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { clsx as cn } from "clsx";
3
+ import { Slot } from "radix-ui";
4
+ function Breadcrumb({ className, ...props }) {
5
+ return (_jsx("nav", { "data-slot": "breadcrumb", "aria-label": "Breadcrumb", className: cn("", className), ...props }));
6
+ }
7
+ function BreadcrumbList({ className, ...props }) {
8
+ return (_jsx("ol", { "data-slot": "breadcrumb-list", className: cn("breadcrumb", className), ...props }));
9
+ }
10
+ function BreadcrumbItem({ className, ...props }) {
11
+ return (_jsx("li", { "data-slot": "breadcrumb-item", className: cn("", className), ...props }));
12
+ }
13
+ function BreadcrumbLink({ className, asChild = false, ...props }) {
14
+ const Comp = asChild ? Slot.Root : "a";
15
+ return (_jsx(Comp, { "data-slot": "breadcrumb-link", className: cn("", className), ...props }));
16
+ }
17
+ function BreadcrumbPage({ className, ...props }) {
18
+ return (_jsx("span", { "data-slot": "breadcrumb-page", "aria-current": "page", className: cn("", className), ...props }));
19
+ }
20
+ function BreadcrumbSeparator({ className, children, ...props }) {
21
+ return (_jsx("li", { "data-slot": "breadcrumb-separator", "aria-hidden": "true", className: cn("sep", className), ...props, children: children ?? "/" }));
22
+ }
23
+ export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "radix-ui";
3
+ declare function CommandPalette({ className, label, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Root> & {
4
+ className?: string;
5
+ label?: string;
6
+ }): React.JSX.Element;
7
+ declare function CommandPaletteInput({ className, onKeyDown, ...props }: React.ComponentProps<"input">): React.JSX.Element;
8
+ declare function CommandPaletteList({ className, "aria-label": ariaLabel, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
+ declare function CommandPaletteGroup({ className, heading, children, ...props }: React.ComponentProps<"div"> & {
10
+ heading: string;
11
+ }): React.JSX.Element;
12
+ declare function CommandPaletteItem({ className, disabled, onSelect, onClick, ...props }: React.ComponentProps<"div"> & {
13
+ disabled?: boolean;
14
+ onSelect?: () => void;
15
+ }): React.JSX.Element;
16
+ declare function CommandPaletteEmpty({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
17
+ export { CommandPalette, CommandPaletteInput, CommandPaletteList, CommandPaletteGroup, CommandPaletteItem, CommandPaletteEmpty, };
@@ -0,0 +1,78 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { clsx as cn } from "clsx";
5
+ import { Dialog as DialogPrimitive, VisuallyHidden } from "radix-ui";
6
+ import { DialogOverlay, DialogPortal } from "./dialog.js";
7
+ // The palette owns its overlay, focus, and in-palette keys. Matching is the
8
+ // product's: render the items that match the query. The shortcut that opens it
9
+ // is product chrome too, so the palette stays controlled.
10
+ const CommandPaletteContext = React.createContext(null);
11
+ function useCommandPalette() {
12
+ const context = React.useContext(CommandPaletteContext);
13
+ if (!context) {
14
+ throw new Error("CommandPalette parts must be used inside <CommandPalette>");
15
+ }
16
+ return context;
17
+ }
18
+ function items(list) {
19
+ return Array.from(list?.querySelectorAll('[data-slot="command-palette-item"]:not([aria-disabled="true"])') ?? []);
20
+ }
21
+ function CommandPalette({ className, label = "Command palette", children, ...props }) {
22
+ const [activeId, setActiveId] = React.useState("");
23
+ const listId = React.useId();
24
+ const listRef = React.useRef(null);
25
+ return (_jsx(DialogPrimitive.Root, { "data-slot": "command-palette", ...props, children: _jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "command-palette-content", className: cn("palette kiso-react-palette", className), children: [_jsx(VisuallyHidden.Root, { asChild: true, children: _jsx(DialogPrimitive.Title, { children: label }) }), _jsx(CommandPaletteContext.Provider, { value: { activeId, setActiveId, listId, listRef }, children: children })] })] }) }));
26
+ }
27
+ function CommandPaletteInput({ className, onKeyDown, ...props }) {
28
+ const { activeId, setActiveId, listId, listRef } = useCommandPalette();
29
+ // The query changes the list under the highlight, so re-anchor it every
30
+ // render rather than tracking an index that the filter invalidates.
31
+ React.useEffect(() => {
32
+ const visible = items(listRef.current);
33
+ if (!visible.some((item) => item.id === activeId)) {
34
+ setActiveId(visible[0]?.id ?? "");
35
+ }
36
+ });
37
+ function move(event) {
38
+ const visible = items(listRef.current);
39
+ const index = visible.findIndex((item) => item.id === activeId);
40
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
41
+ event.preventDefault();
42
+ if (!visible.length)
43
+ return;
44
+ const step = event.key === "ArrowDown" ? 1 : -1;
45
+ const next = visible[(index + step + visible.length) % visible.length];
46
+ setActiveId(next.id);
47
+ next.scrollIntoView({ block: "nearest" });
48
+ }
49
+ else if (event.key === "Enter") {
50
+ event.preventDefault();
51
+ visible[index]?.click();
52
+ }
53
+ onKeyDown?.(event);
54
+ }
55
+ return (_jsxs("div", { className: "palette-input", "data-slot": "command-palette-input", children: [_jsxs("svg", { className: "icon muted", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", "aria-hidden": "true", children: [_jsx("circle", { cx: "7", cy: "7", r: "4.5" }), _jsx("path", { d: "m10.5 10.5 3 3" })] }), _jsx("input", { role: "combobox", "aria-expanded": "true", "aria-controls": listId, "aria-activedescendant": activeId || undefined, "aria-autocomplete": "list", autoComplete: "off", autoFocus: true, onKeyDown: move, className: className, ...props })] }));
56
+ }
57
+ function CommandPaletteList({ className, "aria-label": ariaLabel = "Commands", ...props }) {
58
+ const { listId, listRef } = useCommandPalette();
59
+ return (_jsx("div", { id: listId, ref: listRef, role: "listbox", "aria-label": ariaLabel, "data-slot": "command-palette-list", className: cn("palette-list", className), ...props }));
60
+ }
61
+ function CommandPaletteGroup({ className, heading, children, ...props }) {
62
+ const headingId = React.useId();
63
+ return (_jsxs("div", { role: "group", "aria-labelledby": headingId, "data-slot": "command-palette-group", className: cn("", className), ...props, children: [_jsx("p", { id: headingId, className: "t-caps menu-label", children: heading }), children] }));
64
+ }
65
+ function CommandPaletteItem({ className, disabled = false, onSelect, onClick, ...props }) {
66
+ const id = React.useId();
67
+ const { activeId, setActiveId } = useCommandPalette();
68
+ return (_jsx("div", { id: id, role: "option", "data-slot": "command-palette-item", "aria-selected": activeId === id, "aria-disabled": disabled || undefined, className: cn("menu-item", className), onPointerMove: () => !disabled && setActiveId(id), onClick: (event) => {
69
+ if (disabled)
70
+ return;
71
+ onSelect?.();
72
+ onClick?.(event);
73
+ }, ...props }));
74
+ }
75
+ function CommandPaletteEmpty({ className, ...props }) {
76
+ return (_jsx("p", { "data-slot": "command-palette-empty", className: cn("menu-item muted", className), ...props }));
77
+ }
78
+ export { CommandPalette, CommandPaletteInput, CommandPaletteList, CommandPaletteGroup, CommandPaletteItem, CommandPaletteEmpty, };
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "radix-ui";
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
+ declare function DialogContent({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Content>): React.JSX.Element;
9
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
10
+ declare function DialogBody({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
11
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
12
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
13
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
14
+ export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, };
package/dist/dialog.js ADDED
@@ -0,0 +1,39 @@
1
+ // Adapted from shadcn/ui new-york-v4. See ../SHADCN-LICENSE.
2
+ "use client";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { clsx as cn } from "clsx";
5
+ import { Dialog as DialogPrimitive } from "radix-ui";
6
+ function Dialog({ ...props }) {
7
+ return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
8
+ }
9
+ function DialogTrigger({ ...props }) {
10
+ return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
11
+ }
12
+ function DialogPortal({ ...props }) {
13
+ return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
14
+ }
15
+ function DialogClose({ ...props }) {
16
+ return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
17
+ }
18
+ function DialogOverlay({ className, ...props }) {
19
+ return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("kiso-react-overlay", className), ...props }));
20
+ }
21
+ function DialogContent({ className, children, ...props }) {
22
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsx(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "dialog-content", className: cn("kiso-react-dialog marked", className), ...props, children: children })] }));
23
+ }
24
+ function DialogHeader({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn("dialog-header", className), ...props }));
26
+ }
27
+ function DialogBody({ className, ...props }) {
28
+ return (_jsx("div", { "data-slot": "dialog-body", className: cn("dialog-body", className), ...props }));
29
+ }
30
+ function DialogFooter({ className, ...props }) {
31
+ return (_jsx("div", { "data-slot": "dialog-footer", className: cn("dialog-footer", className), ...props }));
32
+ }
33
+ function DialogTitle({ className, ...props }) {
34
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("t-h3", className), ...props }));
35
+ }
36
+ function DialogDescription({ className, ...props }) {
37
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("muted", className), ...props }));
38
+ }
39
+ export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, };
package/dist/dot.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const dotVariants: (props?: ({
4
+ variant?: "danger" | "info" | "neutral" | "success" | "warning" | null | undefined;
5
+ size?: "lg" | "md" | null | undefined;
6
+ pulse?: boolean | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ declare function Dot({ className, variant, size, pulse, ...props }: React.ComponentProps<"span"> & VariantProps<typeof dotVariants>): React.JSX.Element;
9
+ export { Dot, dotVariants };
package/dist/dot.js ADDED
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { clsx as cn } from "clsx";
4
+ /* `.dot` paints itself with `currentColor`, so the utility classes that carry
5
+ status colour double as the variant. Spelled as a `variant` prop because
6
+ that is how Badge already says the same thing. */
7
+ const dotVariants = cva("dot", {
8
+ variants: {
9
+ variant: {
10
+ neutral: "", info: "info", success: "success",
11
+ warning: "warning", danger: "danger",
12
+ },
13
+ size: { md: "", lg: "dot-lg" },
14
+ pulse: { true: "dot-pulse", false: "" },
15
+ },
16
+ defaultVariants: { variant: "neutral", size: "md", pulse: false },
17
+ });
18
+ function Dot({ className, variant = "neutral", size = "md", pulse = false, ...props }) {
19
+ return (_jsx("span", { "data-slot": "dot", "data-variant": variant, className: cn(dotVariants({ variant, size, pulse }), className), "aria-hidden": "true", ...props }));
20
+ }
21
+ export { Dot, dotVariants };
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "radix-ui";
3
+ import { DialogBody, DialogClose, DialogFooter, DialogHeader, DialogTitle, DialogDescription } from "./dialog.js";
4
+ declare function Drawer({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
5
+ declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
6
+ declare function DrawerContent({ className, placement, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
7
+ placement?: "bottom" | "side";
8
+ }): React.JSX.Element;
9
+ export { Drawer, DrawerTrigger, DrawerContent, DialogClose as DrawerClose, DialogHeader as DrawerHeader, DialogBody as DrawerBody, DialogFooter as DrawerFooter, DialogTitle as DrawerTitle, DialogDescription as DrawerDescription, };
package/dist/drawer.js ADDED
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { clsx as cn } from "clsx";
4
+ import { Dialog as DialogPrimitive } from "radix-ui";
5
+ import { DialogBody, DialogClose, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogDescription, } from "./dialog.js";
6
+ // A Drawer is a Dialog anchored to an edge: same task semantics, same
7
+ // accessible name, different placement.
8
+ function Drawer({ ...props }) {
9
+ return _jsx(DialogPrimitive.Root, { "data-slot": "drawer", ...props });
10
+ }
11
+ function DrawerTrigger({ ...props }) {
12
+ return _jsx(DialogPrimitive.Trigger, { "data-slot": "drawer-trigger", ...props });
13
+ }
14
+ function DrawerContent({ className, placement = "bottom", children, ...props }) {
15
+ return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsx(DialogPrimitive.Content, { "aria-modal": "true", "data-slot": "drawer-content", "data-placement": placement, className: cn("kiso-react-drawer marked", className), ...props, children: children })] }));
16
+ }
17
+ export { Drawer, DrawerTrigger, DrawerContent, DialogClose as DrawerClose, DialogHeader as DrawerHeader, DialogBody as DrawerBody, DialogFooter as DrawerFooter, DialogTitle as DrawerTitle, DialogDescription as DrawerDescription, };
@@ -0,0 +1,13 @@
1
+ import * as React from "react";
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
3
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
4
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
6
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
7
+ declare function DropdownMenuItem({ className, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
8
+ variant?: "action" | "link" | "destructive";
9
+ }): React.JSX.Element;
10
+ declare function DropdownMenuLabel({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label>): React.JSX.Element;
11
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
12
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
13
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, };
@@ -0,0 +1,32 @@
1
+ // Adapted from shadcn/ui new-york-v4. See ../SHADCN-LICENSE.
2
+ "use client";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { clsx as cn } from "clsx";
5
+ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
6
+ function DropdownMenu({ ...props }) {
7
+ return _jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
8
+ }
9
+ function DropdownMenuTrigger({ ...props }) {
10
+ return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props }));
11
+ }
12
+ function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
13
+ return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("menu kiso-react-floating", className), ...props }) }));
14
+ }
15
+ function DropdownMenuGroup({ ...props }) {
16
+ return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
17
+ }
18
+ // `link` renders a real anchor through asChild, so open-in-new-tab keeps
19
+ // working; `destructive` is the only colour an item may carry.
20
+ function DropdownMenuItem({ className, variant = "action", ...props }) {
21
+ return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-variant": variant, className: cn("menu-item", variant === "destructive" && "is-danger", className), ...props }));
22
+ }
23
+ function DropdownMenuLabel({ className, ...props }) {
24
+ return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", className: cn("menu-label t-caps", className), ...props }));
25
+ }
26
+ function DropdownMenuSeparator({ className, ...props }) {
27
+ return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("menu-separator", className), ...props }));
28
+ }
29
+ function DropdownMenuShortcut({ className, ...props }) {
30
+ return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("kbd", className), ...props }));
31
+ }
32
+ export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, };
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const emptyStateVariants: (props?: ({
4
+ variant?: "first-run" | "informational" | "no-results" | null | undefined;
5
+ size?: "md" | "sm" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function EmptyState({ className, variant, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof emptyStateVariants>): React.JSX.Element;
8
+ declare function EmptyStateIcon({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
+ declare function EmptyStateTitle({ className, asChild, ...props }: React.ComponentProps<"h3"> & {
10
+ asChild?: boolean;
11
+ }): React.JSX.Element;
12
+ declare function EmptyStateDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
13
+ declare function EmptyStateActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
14
+ export { EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, emptyStateVariants, };
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from "class-variance-authority";
3
+ import { clsx as cn } from "clsx";
4
+ import { Slot } from "radix-ui";
5
+ // Emptiness is not an error: the variants change which action belongs here, not
6
+ // the colour of the surface.
7
+ const emptyStateVariants = cva("empty", {
8
+ variants: {
9
+ variant: { "first-run": "", "no-results": "", informational: "" },
10
+ size: { md: "", sm: "empty-sm" },
11
+ },
12
+ defaultVariants: { variant: "first-run", size: "md" },
13
+ });
14
+ function EmptyState({ className, variant = "first-run", size = "md", ...props }) {
15
+ return (_jsx("div", { "data-slot": "empty-state", "data-variant": variant, "data-size": size, className: cn(emptyStateVariants({ variant, size }), className), ...props }));
16
+ }
17
+ function EmptyStateIcon({ className, ...props }) {
18
+ return (_jsx("div", { "data-slot": "empty-state-icon", "aria-hidden": "true", className: cn("empty-icon", className), ...props }));
19
+ }
20
+ function EmptyStateTitle({ className, asChild = false, ...props }) {
21
+ const Comp = asChild ? Slot.Root : "h3";
22
+ return (_jsx(Comp, { "data-slot": "empty-state-title", className: cn("t-h3", className), ...props }));
23
+ }
24
+ function EmptyStateDescription({ className, ...props }) {
25
+ return (_jsx("p", { "data-slot": "empty-state-description", className: cn("", className), ...props }));
26
+ }
27
+ function EmptyStateActions({ className, ...props }) {
28
+ return (_jsx("div", { "data-slot": "empty-state-actions", className: cn("row-wrap", className), ...props }));
29
+ }
30
+ export { EmptyState, EmptyStateIcon, EmptyStateTitle, EmptyStateDescription, EmptyStateActions, emptyStateVariants, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Header({ className, ...props }: React.ComponentProps<"header">): React.JSX.Element;
3
+ export { Header };
package/dist/header.js ADDED
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { clsx as cn } from "clsx";
3
+ // Shared product chrome: brand, Navigation, and global status or actions.
4
+ // Location within the product is Breadcrumb, not Header.
5
+ function Header({ className, ...props }) {
6
+ return (_jsx("header", { "data-slot": "header", className: cn("topbar", className), ...props }));
7
+ }
8
+ export { Header };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,43 @@
1
+ export * from "./alert.js";
1
2
  export * from "./alert-dialog.js";
3
+ export * from "./app-shell.js";
2
4
  export * from "./badge.js";
3
5
  export * from "./brand-mark.js";
6
+ export * from "./breadcrumb.js";
4
7
  export * from "./button.js";
5
8
  export * from "./card.js";
6
9
  export * from "./checkbox.js";
10
+ export * from "./command-palette.js";
11
+ export * from "./dialog.js";
12
+ export * from "./dot.js";
13
+ export * from "./drawer.js";
14
+ export * from "./dropdown-menu.js";
15
+ export * from "./empty-state.js";
7
16
  export * from "./form-field.js";
17
+ export * from "./header.js";
8
18
  export * from "./input.js";
19
+ export * from "./kv.js";
9
20
  export * from "./label.js";
21
+ export * from "./link.js";
22
+ export * from "./log-view.js";
23
+ export * from "./navigation.js";
24
+ export * from "./page-header.js";
25
+ export * from "./pagination.js";
26
+ export * from "./popover.js";
27
+ export * from "./search.js";
28
+ export * from "./select.js";
29
+ export * from "./separator.js";
30
+ export * from "./sidebar.js";
31
+ export * from "./skeleton.js";
32
+ export * from "./spinner.js";
33
+ export * from "./split.js";
34
+ export * from "./stat.js";
35
+ export * from "./switch.js";
10
36
  export * from "./table.js";
37
+ export * from "./tabs.js";
11
38
  export * from "./terminal-icon.js";
39
+ export * from "./textarea.js";
12
40
  export * from "./theme-selector.js";
41
+ export * from "./toast.js";
42
+ export * from "./tooltip.js";
43
+ export * from "./validation-message.js";