@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.
- package/README.md +87 -13
- package/dist/alert.d.ts +10 -0
- package/dist/alert.js +27 -0
- package/dist/app-shell.d.ts +4 -0
- package/dist/app-shell.js +11 -0
- package/dist/breadcrumb.d.ts +10 -0
- package/dist/breadcrumb.js +23 -0
- package/dist/command-palette.d.ts +17 -0
- package/dist/command-palette.js +78 -0
- package/dist/dialog.d.ts +14 -0
- package/dist/dialog.js +39 -0
- package/dist/dot.d.ts +9 -0
- package/dist/dot.js +21 -0
- package/dist/drawer.d.ts +9 -0
- package/dist/drawer.js +17 -0
- package/dist/dropdown-menu.d.ts +13 -0
- package/dist/dropdown-menu.js +32 -0
- package/dist/empty-state.d.ts +14 -0
- package/dist/empty-state.js +30 -0
- package/dist/header.d.ts +3 -0
- package/dist/header.js +8 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +31 -0
- package/dist/kv.d.ts +5 -0
- package/dist/kv.js +12 -0
- package/dist/link.d.ts +10 -0
- package/dist/link.js +15 -0
- package/dist/log-view.d.ts +17 -0
- package/dist/log-view.js +56 -0
- package/dist/navigation.d.ts +12 -0
- package/dist/navigation.js +23 -0
- package/dist/page-header.d.ts +9 -0
- package/dist/page-header.js +19 -0
- package/dist/pagination.d.ts +10 -0
- package/dist/pagination.js +21 -0
- package/dist/popover.d.ts +8 -0
- package/dist/popover.js +21 -0
- package/dist/search.d.ts +5 -0
- package/dist/search.js +9 -0
- package/dist/select.d.ts +11 -0
- package/dist/select.js +30 -0
- package/dist/separator.d.ts +4 -0
- package/dist/separator.js +9 -0
- package/dist/sidebar.d.ts +6 -0
- package/dist/sidebar.js +17 -0
- package/dist/skeleton.d.ts +7 -0
- package/dist/skeleton.js +15 -0
- package/dist/spinner.d.ts +9 -0
- package/dist/spinner.js +15 -0
- package/dist/split.d.ts +11 -0
- package/dist/split.js +64 -0
- package/dist/stat.d.ts +12 -0
- package/dist/stat.js +32 -0
- package/dist/styles.css +156 -1
- package/dist/switch.d.ts +4 -0
- package/dist/switch.js +11 -0
- package/dist/tabs.d.ts +7 -0
- package/dist/tabs.js +18 -0
- package/dist/textarea.d.ts +3 -0
- package/dist/textarea.js +6 -0
- package/dist/toast.d.ts +15 -0
- package/dist/toast.js +43 -0
- package/dist/tooltip.d.ts +7 -0
- package/dist/tooltip.js +20 -0
- package/dist/use-isomorphic-layout-effect.d.ts +2 -0
- package/dist/use-isomorphic-layout-effect.js +4 -0
- package/dist/validation-message.d.ts +3 -0
- package/dist/validation-message.js +8 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,13 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
export * from "./alert.js";
|
|
2
3
|
export * from "./alert-dialog.js";
|
|
4
|
+
export * from "./app-shell.js";
|
|
3
5
|
export * from "./badge.js";
|
|
4
6
|
export * from "./brand-mark.js";
|
|
7
|
+
export * from "./breadcrumb.js";
|
|
5
8
|
export * from "./button.js";
|
|
6
9
|
export * from "./card.js";
|
|
7
10
|
export * from "./checkbox.js";
|
|
11
|
+
export * from "./command-palette.js";
|
|
12
|
+
export * from "./dialog.js";
|
|
13
|
+
export * from "./dot.js";
|
|
14
|
+
export * from "./drawer.js";
|
|
15
|
+
export * from "./dropdown-menu.js";
|
|
16
|
+
export * from "./empty-state.js";
|
|
8
17
|
export * from "./form-field.js";
|
|
18
|
+
export * from "./header.js";
|
|
9
19
|
export * from "./input.js";
|
|
20
|
+
export * from "./kv.js";
|
|
10
21
|
export * from "./label.js";
|
|
22
|
+
export * from "./link.js";
|
|
23
|
+
export * from "./log-view.js";
|
|
24
|
+
export * from "./navigation.js";
|
|
25
|
+
export * from "./page-header.js";
|
|
26
|
+
export * from "./pagination.js";
|
|
27
|
+
export * from "./popover.js";
|
|
28
|
+
export * from "./search.js";
|
|
29
|
+
export * from "./select.js";
|
|
30
|
+
export * from "./separator.js";
|
|
31
|
+
export * from "./sidebar.js";
|
|
32
|
+
export * from "./skeleton.js";
|
|
33
|
+
export * from "./spinner.js";
|
|
34
|
+
export * from "./split.js";
|
|
35
|
+
export * from "./stat.js";
|
|
36
|
+
export * from "./switch.js";
|
|
11
37
|
export * from "./table.js";
|
|
38
|
+
export * from "./tabs.js";
|
|
12
39
|
export * from "./terminal-icon.js";
|
|
40
|
+
export * from "./textarea.js";
|
|
13
41
|
export * from "./theme-selector.js";
|
|
42
|
+
export * from "./toast.js";
|
|
43
|
+
export * from "./tooltip.js";
|
|
44
|
+
export * from "./validation-message.js";
|
package/dist/kv.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function KV({ className, ...props }: React.ComponentProps<"dl">): React.JSX.Element;
|
|
3
|
+
declare function KVKey({ className, ...props }: React.ComponentProps<"dt">): React.JSX.Element;
|
|
4
|
+
declare function KVValue({ className, ...props }: React.ComponentProps<"dd">): React.JSX.Element;
|
|
5
|
+
export { KV, KVKey, KVValue };
|
package/dist/kv.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as cn } from "clsx";
|
|
3
|
+
function KV({ className, ...props }) {
|
|
4
|
+
return (_jsx("dl", { "data-slot": "kv", className: cn("kv", className), ...props }));
|
|
5
|
+
}
|
|
6
|
+
function KVKey({ className, ...props }) {
|
|
7
|
+
return (_jsx("dt", { "data-slot": "kv-key", className: cn("", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function KVValue({ className, ...props }) {
|
|
10
|
+
return (_jsx("dd", { "data-slot": "kv-value", className: cn("", className), ...props }));
|
|
11
|
+
}
|
|
12
|
+
export { KV, KVKey, KVValue };
|
package/dist/link.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const linkVariants: (props?: ({
|
|
4
|
+
variant?: "inline" | "standalone" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Link({ className, variant, active, asChild, ...props }: React.ComponentProps<"a"> & VariantProps<typeof linkVariants> & {
|
|
7
|
+
active?: boolean;
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export { Link, linkVariants };
|
package/dist/link.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
const linkVariants = cva("", {
|
|
6
|
+
variants: { variant: { inline: "link", standalone: "nav-item" } },
|
|
7
|
+
defaultVariants: { variant: "inline" },
|
|
8
|
+
});
|
|
9
|
+
// A destination that must carry Button weight is <Button asChild><a /></Button>,
|
|
10
|
+
// not a third variant here.
|
|
11
|
+
function Link({ className, variant = "inline", active = false, asChild = false, ...props }) {
|
|
12
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
13
|
+
return (_jsx(Comp, { "data-slot": "link", "data-variant": variant, "aria-current": active ? "page" : undefined, className: cn(linkVariants({ variant }), className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
export { Link, linkVariants };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
type LogViewHandle = {
|
|
4
|
+
scrollToBottom: (behavior?: ScrollBehavior) => void;
|
|
5
|
+
};
|
|
6
|
+
declare function LogView({ className, children, follow, onFollowChange, ref, ...props }: Omit<React.ComponentProps<"div">, "ref"> & {
|
|
7
|
+
follow?: boolean;
|
|
8
|
+
onFollowChange?: (follow: boolean) => void;
|
|
9
|
+
ref?: React.Ref<LogViewHandle>;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function LogViewLine({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function LogViewTime({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
13
|
+
declare const logViewLevelVariants: (props?: ({
|
|
14
|
+
level?: "error" | "info" | "warn" | null | undefined;
|
|
15
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
declare function LogViewLevel({ className, level, ...props }: React.ComponentProps<"span"> & VariantProps<typeof logViewLevelVariants>): React.JSX.Element;
|
|
17
|
+
export { LogView, LogViewLine, LogViewTime, LogViewLevel, logViewLevelVariants, type LogViewHandle, };
|
package/dist/log-view.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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 * as React from "react";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { clsx as cn } from "clsx";
|
|
7
|
+
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
8
|
+
/* Within this much of the end counts as "at the bottom". A log that is being
|
|
9
|
+
written to rarely lands on an exact scroll position. */
|
|
10
|
+
const BOTTOM_THRESHOLD = 8;
|
|
11
|
+
/* The frame is `.logview` and the scroller is `.log-scroll` inside it, so the
|
|
12
|
+
component owns the scroller and with it follow-tail: new lines pin the view
|
|
13
|
+
to the end until the reader scrolls away, and returning to the end resumes.
|
|
14
|
+
Pass `follow` to drive that from a control of your own — the console has a
|
|
15
|
+
"Follow" switch — and read `onFollowChange` to keep it in step. */
|
|
16
|
+
function LogView({ className, children, follow, onFollowChange, ref, ...props }) {
|
|
17
|
+
const scroller = React.useRef(null);
|
|
18
|
+
const [atBottom, setAtBottom] = React.useState(true);
|
|
19
|
+
const following = follow ?? atBottom;
|
|
20
|
+
React.useImperativeHandle(ref, () => ({
|
|
21
|
+
scrollToBottom(behavior) {
|
|
22
|
+
const el = scroller.current;
|
|
23
|
+
if (el)
|
|
24
|
+
el.scrollTo({ top: el.scrollHeight, behavior });
|
|
25
|
+
},
|
|
26
|
+
}), []);
|
|
27
|
+
/* Before paint, so a new line never shows up above the fold first. */
|
|
28
|
+
useIsomorphicLayoutEffect(() => {
|
|
29
|
+
const el = scroller.current;
|
|
30
|
+
if (el && following)
|
|
31
|
+
el.scrollTop = el.scrollHeight;
|
|
32
|
+
}, [children, following]);
|
|
33
|
+
return (_jsx("div", { "data-slot": "log-view", "data-follow": following, className: cn("logview", className), ...props, children: _jsx("div", { ref: scroller, "data-slot": "log-view-scroll", className: "log-scroll", onScroll: (event) => {
|
|
34
|
+
const el = event.currentTarget;
|
|
35
|
+
const bottom = el.scrollHeight - el.scrollTop - el.clientHeight <= BOTTOM_THRESHOLD;
|
|
36
|
+
setAtBottom(bottom);
|
|
37
|
+
if (bottom !== following)
|
|
38
|
+
onFollowChange?.(bottom);
|
|
39
|
+
}, children: children }) }));
|
|
40
|
+
}
|
|
41
|
+
function LogViewLine({ className, ...props }) {
|
|
42
|
+
return (_jsx("div", { "data-slot": "log-view-line", className: cn("", className), ...props }));
|
|
43
|
+
}
|
|
44
|
+
function LogViewTime({ className, ...props }) {
|
|
45
|
+
return (_jsx("span", { "data-slot": "log-view-time", className: cn("log-time", className), ...props }));
|
|
46
|
+
}
|
|
47
|
+
const logViewLevelVariants = cva("", {
|
|
48
|
+
variants: {
|
|
49
|
+
level: { info: "log-info", warn: "log-warn", error: "log-error" },
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: { level: "info" },
|
|
52
|
+
});
|
|
53
|
+
function LogViewLevel({ className, level = "info", ...props }) {
|
|
54
|
+
return (_jsx("span", { "data-slot": "log-view-level", "data-level": level, className: cn(logViewLevelVariants({ level }), className), ...props }));
|
|
55
|
+
}
|
|
56
|
+
export { LogView, LogViewLine, LogViewTime, LogViewLevel, logViewLevelVariants, };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Navigation({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
3
|
+
declare function NavigationGroup({ className, label, children, ...props }: React.ComponentProps<"div"> & {
|
|
4
|
+
label?: string;
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function NavigationList({ className, ...props }: React.ComponentProps<"ul">): React.JSX.Element;
|
|
7
|
+
declare function NavigationItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
8
|
+
declare function NavigationLink({ className, active, asChild, ...props }: React.ComponentProps<"a"> & {
|
|
9
|
+
active?: boolean;
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
export { Navigation, NavigationGroup, NavigationList, NavigationItem, NavigationLink, };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as cn } from "clsx";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
// Navigation carries landmark and grouping semantics only. Which destination is
|
|
5
|
+
// current is the product's answer: pass `active`, and pass `asChild` to keep a
|
|
6
|
+
// router's own link component.
|
|
7
|
+
function Navigation({ className, ...props }) {
|
|
8
|
+
return _jsx("nav", { "data-slot": "navigation", className: cn("", className), ...props });
|
|
9
|
+
}
|
|
10
|
+
function NavigationGroup({ className, label, children, ...props }) {
|
|
11
|
+
return (_jsxs("div", { "data-slot": "navigation-group", className: cn("nav-group", className), ...props, children: [label && _jsx("p", { className: "t-caps", children: label }), children] }));
|
|
12
|
+
}
|
|
13
|
+
function NavigationList({ className, ...props }) {
|
|
14
|
+
return (_jsx("ul", { "data-slot": "navigation-list", className: cn("", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function NavigationItem({ className, ...props }) {
|
|
17
|
+
return (_jsx("li", { "data-slot": "navigation-item", className: cn("", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function NavigationLink({ className, active = false, asChild = false, ...props }) {
|
|
20
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
21
|
+
return (_jsx(Comp, { "data-slot": "navigation-link", "aria-current": active ? "page" : undefined, className: cn("nav-item", className), ...props }));
|
|
22
|
+
}
|
|
23
|
+
export { Navigation, NavigationGroup, NavigationList, NavigationItem, NavigationLink, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function PageHeader({ className, actions, children, ...props }: React.ComponentProps<"div"> & {
|
|
3
|
+
actions?: React.ReactNode;
|
|
4
|
+
}): React.JSX.Element;
|
|
5
|
+
declare function PageHeaderTitle({ className, asChild, ...props }: React.ComponentProps<"h1"> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function PageHeaderDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
9
|
+
export { PageHeader, PageHeaderTitle, PageHeaderDescription };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as cn } from "clsx";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
// Actions sit beside the title, so they are a prop rather than a child: the
|
|
5
|
+
// title block keeps its own grid either way.
|
|
6
|
+
function PageHeader({ className, actions, children, ...props }) {
|
|
7
|
+
const heading = (_jsx("div", { "data-slot": "page-header", className: cn("page-header", className), ...props, children: children }));
|
|
8
|
+
if (!actions)
|
|
9
|
+
return heading;
|
|
10
|
+
return (_jsxs("div", { "data-slot": "page-header-row", className: "between", children: [heading, _jsx("div", { "data-slot": "page-header-actions", className: "row-wrap", children: actions })] }));
|
|
11
|
+
}
|
|
12
|
+
function PageHeaderTitle({ className, asChild = false, ...props }) {
|
|
13
|
+
const Comp = asChild ? Slot.Root : "h1";
|
|
14
|
+
return (_jsx(Comp, { "data-slot": "page-header-title", className: cn("t-h1", className), ...props }));
|
|
15
|
+
}
|
|
16
|
+
function PageHeaderDescription({ className, ...props }) {
|
|
17
|
+
return (_jsx("p", { "data-slot": "page-header-description", className: cn("muted t-label", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
export { PageHeader, PageHeaderTitle, PageHeaderDescription };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Button } from "./button.js";
|
|
3
|
+
declare function Pagination({ className, ...props }: React.ComponentProps<"nav">): React.JSX.Element;
|
|
4
|
+
declare function PaginationPrevious({ children, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
5
|
+
declare function PaginationNext({ children, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
6
|
+
declare function PaginationPage({ active, ...props }: React.ComponentProps<typeof Button> & {
|
|
7
|
+
active?: boolean;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
declare function PaginationEllipsis({ className, children, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
|
+
export { Pagination, PaginationPrevious, PaginationNext, PaginationPage, PaginationEllipsis, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as cn } from "clsx";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
// Controls are Buttons by default. For URL-addressable pages, pass asChild and
|
|
5
|
+
// render the product's link: <PaginationPage asChild><a href="?page=2" /></…>.
|
|
6
|
+
function Pagination({ className, ...props }) {
|
|
7
|
+
return (_jsx("nav", { "data-slot": "pagination", "aria-label": "Pagination", className: cn("pagination", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
function PaginationPrevious({ children, ...props }) {
|
|
10
|
+
return (_jsx(Button, { "data-slot": "pagination-previous", size: "sm", ...props, children: children ?? "Previous" }));
|
|
11
|
+
}
|
|
12
|
+
function PaginationNext({ children, ...props }) {
|
|
13
|
+
return (_jsx(Button, { "data-slot": "pagination-next", size: "sm", ...props, children: children ?? "Next" }));
|
|
14
|
+
}
|
|
15
|
+
function PaginationPage({ active = false, ...props }) {
|
|
16
|
+
return (_jsx(Button, { "data-slot": "pagination-page", size: "sm", "aria-current": active ? "page" : undefined, ...props }));
|
|
17
|
+
}
|
|
18
|
+
function PaginationEllipsis({ className, children, ...props }) {
|
|
19
|
+
return (_jsx("span", { "data-slot": "pagination-ellipsis", "aria-hidden": "true", className: cn("muted", className), ...props, children: children ?? "..." }));
|
|
20
|
+
}
|
|
21
|
+
export { Pagination, PaginationPrevious, PaginationNext, PaginationPage, PaginationEllipsis, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
3
|
+
declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): React.JSX.Element;
|
|
5
|
+
declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): React.JSX.Element;
|
|
6
|
+
declare function PopoverClose({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Close>): React.JSX.Element;
|
|
7
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element;
|
|
8
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverClose, PopoverContent, };
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
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 { Popover as PopoverPrimitive } from "radix-ui";
|
|
6
|
+
function Popover({ ...props }) {
|
|
7
|
+
return _jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
8
|
+
}
|
|
9
|
+
function PopoverTrigger({ ...props }) {
|
|
10
|
+
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
11
|
+
}
|
|
12
|
+
function PopoverAnchor({ ...props }) {
|
|
13
|
+
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
14
|
+
}
|
|
15
|
+
function PopoverClose({ ...props }) {
|
|
16
|
+
return _jsx(PopoverPrimitive.Close, { "data-slot": "popover-close", ...props });
|
|
17
|
+
}
|
|
18
|
+
function PopoverContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
19
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn("kiso-react-popover kiso-react-floating", className), ...props }) }));
|
|
20
|
+
}
|
|
21
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverClose, PopoverContent, };
|
package/dist/search.d.ts
ADDED
package/dist/search.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as cn } from "clsx";
|
|
3
|
+
import { Input } from "./input.js";
|
|
4
|
+
// Filters a collection that is already on screen. Global commands are
|
|
5
|
+
// CommandPalette; a single field is Input.
|
|
6
|
+
function Search({ className, containerClassName, ...props }) {
|
|
7
|
+
return (_jsxs("div", { "data-slot": "search", className: cn("input-group", containerClassName), children: [_jsxs("svg", { className: "icon", 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, { type: "search", className: className, ...props })] }));
|
|
8
|
+
}
|
|
9
|
+
export { Search };
|
package/dist/select.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
3
|
+
declare function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>): React.JSX.Element;
|
|
4
|
+
declare function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>): React.JSX.Element;
|
|
5
|
+
declare function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>): React.JSX.Element;
|
|
6
|
+
declare function SelectTrigger({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger>): React.JSX.Element;
|
|
7
|
+
declare function SelectContent({ className, children, position, sideOffset, ...props }: React.ComponentProps<typeof SelectPrimitive.Content>): React.JSX.Element;
|
|
8
|
+
declare function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>): React.JSX.Element;
|
|
9
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
|
10
|
+
declare function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>): React.JSX.Element;
|
|
11
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
|
package/dist/select.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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 { Select as SelectPrimitive } from "radix-ui";
|
|
6
|
+
function Select({ ...props }) {
|
|
7
|
+
return _jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
8
|
+
}
|
|
9
|
+
function SelectGroup({ ...props }) {
|
|
10
|
+
return _jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
11
|
+
}
|
|
12
|
+
function SelectValue({ ...props }) {
|
|
13
|
+
return _jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
14
|
+
}
|
|
15
|
+
function SelectTrigger({ className, ...props }) {
|
|
16
|
+
return (_jsx(SelectPrimitive.Trigger, { "data-slot": "select-trigger", className: cn("select", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function SelectContent({ className, children, position = "popper", sideOffset = 4, ...props }) {
|
|
19
|
+
return (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Content, { "data-slot": "select-content", position: position, sideOffset: sideOffset, className: cn("menu kiso-react-floating", className), ...props, children: _jsx(SelectPrimitive.Viewport, { "data-slot": "select-viewport", children: children }) }) }));
|
|
20
|
+
}
|
|
21
|
+
function SelectLabel({ className, ...props }) {
|
|
22
|
+
return (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: cn("menu-label t-caps", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function SelectItem({ className, children, ...props }) {
|
|
25
|
+
return (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: cn("menu-item", className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { "data-slot": "select-item-indicator", "aria-hidden": "true", children: _jsx("svg", { className: "icon icon-sm", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", children: _jsx("path", { d: "m3 8 3.5 3.5L13 5" }) }) })] }));
|
|
26
|
+
}
|
|
27
|
+
function SelectSeparator({ className, ...props }) {
|
|
28
|
+
return (_jsx(SelectPrimitive.Separator, { "data-slot": "select-separator", className: cn("menu-separator", className), ...props }));
|
|
29
|
+
}
|
|
30
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
|
|
@@ -0,0 +1,9 @@
|
|
|
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 { Separator as SeparatorPrimitive } from "radix-ui";
|
|
6
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
7
|
+
return (_jsx(SeparatorPrimitive.Root, { "data-slot": "separator", decorative: decorative, orientation: orientation, className: cn(orientation === "vertical" ? "separator-v" : "separator", className), ...props }));
|
|
8
|
+
}
|
|
9
|
+
export { Separator };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Sidebar({ className, ...props }: React.ComponentProps<"aside">): React.JSX.Element;
|
|
3
|
+
declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function SidebarBody({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
export { Sidebar, SidebarHeader, SidebarBody, SidebarFooter };
|
package/dist/sidebar.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as cn } from "clsx";
|
|
3
|
+
// Sidebar is layout. Its destinations are Navigation children, so it holds no
|
|
4
|
+
// route, no active item, and no disclosure state of its own.
|
|
5
|
+
function Sidebar({ className, ...props }) {
|
|
6
|
+
return (_jsx("aside", { "data-slot": "sidebar", className: cn("sidebar", className), ...props }));
|
|
7
|
+
}
|
|
8
|
+
function SidebarHeader({ className, ...props }) {
|
|
9
|
+
return (_jsx("div", { "data-slot": "sidebar-header", className: cn("sidebar-header", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function SidebarBody({ className, ...props }) {
|
|
12
|
+
return (_jsx("div", { "data-slot": "sidebar-body", className: cn("sidebar-body", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function SidebarFooter({ className, ...props }) {
|
|
15
|
+
return (_jsx("div", { "data-slot": "sidebar-footer", className: cn("sidebar-footer", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
export { Sidebar, SidebarHeader, SidebarBody, SidebarFooter };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const skeletonVariants: (props?: ({
|
|
4
|
+
variant?: "block" | "circle" | "text" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Skeleton({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof skeletonVariants>): React.JSX.Element;
|
|
7
|
+
export { Skeleton, skeletonVariants };
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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 skeletonVariants = cva("skeleton", {
|
|
5
|
+
variants: {
|
|
6
|
+
variant: { text: "skeleton-text", block: "", circle: "skeleton-circle" },
|
|
7
|
+
},
|
|
8
|
+
defaultVariants: { variant: "text" },
|
|
9
|
+
});
|
|
10
|
+
// The loading region owns aria-busy and the accessible label; each placeholder
|
|
11
|
+
// is decorative.
|
|
12
|
+
function Skeleton({ className, variant = "text", ...props }) {
|
|
13
|
+
return (_jsx("div", { "data-slot": "skeleton", "data-variant": variant, "aria-hidden": "true", className: cn(skeletonVariants({ variant }), className), ...props }));
|
|
14
|
+
}
|
|
15
|
+
export { Skeleton, skeletonVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const spinnerVariants: (props?: ({
|
|
4
|
+
size?: "lg" | "md" | "sm" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Spinner({ className, size, label, ...props }: React.ComponentProps<"span"> & VariantProps<typeof spinnerVariants> & {
|
|
7
|
+
label?: string;
|
|
8
|
+
}): React.JSX.Element;
|
|
9
|
+
export { Spinner, spinnerVariants };
|
package/dist/spinner.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
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 spinnerVariants = cva("spinner", {
|
|
5
|
+
variants: { size: { sm: "spinner-sm", md: "", lg: "spinner-lg" } },
|
|
6
|
+
defaultVariants: { size: "md" },
|
|
7
|
+
});
|
|
8
|
+
// Without a label the Spinner is decorative: its wait is announced by the
|
|
9
|
+
// Button, region, or status text around it.
|
|
10
|
+
function Spinner({ className, size = "md", label, ...props }) {
|
|
11
|
+
return (_jsx("span", { "data-slot": "spinner", "data-size": size, className: cn(spinnerVariants({ size }), className), ...(label
|
|
12
|
+
? { role: "status", "aria-label": label }
|
|
13
|
+
: { "aria-hidden": true }), ...props }));
|
|
14
|
+
}
|
|
15
|
+
export { Spinner, spinnerVariants };
|
package/dist/split.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Split({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
3
|
+
declare function Pane({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function Splitter({ className, defaultSize, min, max, step, onSizeChange, onPointerDown, onPointerMove, onLostPointerCapture, onKeyDown, "aria-label": ariaLabel, ...props }: React.ComponentProps<"div"> & {
|
|
5
|
+
defaultSize?: number;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
onSizeChange?: (size: number) => void;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
export { Split, Pane, Splitter };
|
package/dist/split.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
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 * as React from "react";
|
|
5
|
+
import { clsx as cn } from "clsx";
|
|
6
|
+
import { useIsomorphicLayoutEffect } from "./use-isomorphic-layout-effect.js";
|
|
7
|
+
function Split({ className, ...props }) {
|
|
8
|
+
return (_jsx("div", { "data-slot": "split", className: cn("split", className), ...props }));
|
|
9
|
+
}
|
|
10
|
+
function Pane({ className, ...props }) {
|
|
11
|
+
return (_jsx("div", { "data-slot": "pane", className: cn("pane", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
/* The divider owns the size so that dropping one between two panes is the
|
|
14
|
+
whole setup — no state to lift for a drag. Where it puts that size is what
|
|
15
|
+
`.split > .pane` already expects: `flex-basis` on the pane before it.
|
|
16
|
+
`onSizeChange` reports the percentage for anyone who wants to persist it. */
|
|
17
|
+
function Splitter({ className, defaultSize = 50, min = 25, max = 75, step = 2, onSizeChange, onPointerDown, onPointerMove, onLostPointerCapture, onKeyDown, "aria-label": ariaLabel = "Resize panes", ...props }) {
|
|
18
|
+
const ref = React.useRef(null);
|
|
19
|
+
const [size, setSize] = React.useState(defaultSize);
|
|
20
|
+
const [dragging, setDragging] = React.useState(false);
|
|
21
|
+
useIsomorphicLayoutEffect(() => {
|
|
22
|
+
const pane = ref.current?.previousElementSibling;
|
|
23
|
+
if (pane instanceof HTMLElement)
|
|
24
|
+
pane.style.flexBasis = `${size}%`;
|
|
25
|
+
}, [size]);
|
|
26
|
+
function resize(next) {
|
|
27
|
+
const value = Math.min(max, Math.max(min, next));
|
|
28
|
+
if (value === size)
|
|
29
|
+
return;
|
|
30
|
+
setSize(value);
|
|
31
|
+
onSizeChange?.(value);
|
|
32
|
+
}
|
|
33
|
+
return (_jsx("div", { ref: ref, role: "separator", tabIndex: 0, "aria-orientation": "vertical", "aria-label": ariaLabel, "aria-valuenow": Math.round(size), "aria-valuemin": min, "aria-valuemax": max, "data-slot": "splitter", className: cn("splitter", dragging && "dragging", className), ...props, onPointerDown: (event) => {
|
|
34
|
+
onPointerDown?.(event);
|
|
35
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
36
|
+
setDragging(true);
|
|
37
|
+
}, onPointerMove: (event) => {
|
|
38
|
+
onPointerMove?.(event);
|
|
39
|
+
if (!dragging)
|
|
40
|
+
return;
|
|
41
|
+
const box = event.currentTarget.parentElement?.getBoundingClientRect();
|
|
42
|
+
if (box)
|
|
43
|
+
resize(((event.clientX - box.left) / box.width) * 100);
|
|
44
|
+
},
|
|
45
|
+
/* Covers the pointer being released and the drag being cancelled. */
|
|
46
|
+
onLostPointerCapture: (event) => {
|
|
47
|
+
onLostPointerCapture?.(event);
|
|
48
|
+
setDragging(false);
|
|
49
|
+
}, onKeyDown: (event) => {
|
|
50
|
+
onKeyDown?.(event);
|
|
51
|
+
if (event.key === "ArrowLeft")
|
|
52
|
+
resize(size - step);
|
|
53
|
+
else if (event.key === "ArrowRight")
|
|
54
|
+
resize(size + step);
|
|
55
|
+
else if (event.key === "Home")
|
|
56
|
+
resize(min);
|
|
57
|
+
else if (event.key === "End")
|
|
58
|
+
resize(max);
|
|
59
|
+
else
|
|
60
|
+
return;
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
} }));
|
|
63
|
+
}
|
|
64
|
+
export { Split, Pane, Splitter };
|
package/dist/stat.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare function Stat({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function StatHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function StatLabel({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
6
|
+
declare function StatValue({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
7
|
+
declare function StatFoot({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
8
|
+
declare const statDeltaVariants: (props?: ({
|
|
9
|
+
variant?: "danger" | "info" | "neutral" | "success" | "warning" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare function StatDelta({ className, variant, ...props }: React.ComponentProps<"span"> & VariantProps<typeof statDeltaVariants>): React.JSX.Element;
|
|
12
|
+
export { Stat, StatHeader, StatLabel, StatValue, StatFoot, StatDelta, statDeltaVariants, };
|
package/dist/stat.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { clsx as cn } from "clsx";
|
|
4
|
+
function Stat({ className, ...props }) {
|
|
5
|
+
return (_jsx("div", { "data-slot": "stat", className: cn("stat", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
/* The tile puts its label and its delta on one line. */
|
|
8
|
+
function StatHeader({ className, ...props }) {
|
|
9
|
+
return (_jsx("div", { "data-slot": "stat-header", className: cn("between", className), ...props }));
|
|
10
|
+
}
|
|
11
|
+
function StatLabel({ className, ...props }) {
|
|
12
|
+
return (_jsx("span", { "data-slot": "stat-label", className: cn("stat-label", className), ...props }));
|
|
13
|
+
}
|
|
14
|
+
function StatValue({ className, ...props }) {
|
|
15
|
+
return (_jsx("span", { "data-slot": "stat-value", className: cn("stat-value", className), ...props }));
|
|
16
|
+
}
|
|
17
|
+
function StatFoot({ className, ...props }) {
|
|
18
|
+
return (_jsx("span", { "data-slot": "stat-foot", className: cn("stat-foot", className), ...props }));
|
|
19
|
+
}
|
|
20
|
+
const statDeltaVariants = cva("badge badge-outline stat-delta", {
|
|
21
|
+
variants: { variant: {
|
|
22
|
+
neutral: "", info: "info", success: "success",
|
|
23
|
+
warning: "warning", danger: "danger",
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { variant: "neutral" },
|
|
26
|
+
});
|
|
27
|
+
/* A slot rather than a prop: the direction arrow, the number and its unit are
|
|
28
|
+
content, and only their colour is the component's business. */
|
|
29
|
+
function StatDelta({ className, variant = "neutral", ...props }) {
|
|
30
|
+
return (_jsx("span", { "data-slot": "stat-delta", "data-variant": variant, className: cn(statDeltaVariants({ variant }), className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
export { Stat, StatHeader, StatLabel, StatValue, StatFoot, StatDelta, statDeltaVariants, };
|