@stll/ui 0.0.1-placeholder.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 +84 -0
- package/dist/components/accordion.d.ts +8 -0
- package/dist/components/accordion.js +38 -0
- package/dist/components/alert-dialog.d.ts +32 -0
- package/dist/components/alert-dialog.js +75 -0
- package/dist/components/avatar.d.ts +7 -0
- package/dist/components/avatar.js +22 -0
- package/dist/components/bidi-text.d.ts +24 -0
- package/dist/components/bidi-text.js +38 -0
- package/dist/components/brand-icons.d.ts +7 -0
- package/dist/components/brand-icons.js +18 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.js +61 -0
- package/dist/components/button-variants.d.ts +17 -0
- package/dist/components/button-variants.js +43 -0
- package/dist/components/button.d.ts +20 -0
- package/dist/components/button.js +53 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.js +44 -0
- package/dist/components/color-picker.d.ts +47 -0
- package/dist/components/color-picker.js +249 -0
- package/dist/components/combobox.d.ts +40 -0
- package/dist/components/combobox.js +208 -0
- package/dist/components/command.d.ts +34 -0
- package/dist/components/command.js +100 -0
- package/dist/components/date-picker-popover.d.ts +29 -0
- package/dist/components/date-picker-popover.js +548 -0
- package/dist/components/date-picker-popover.logic.d.ts +14 -0
- package/dist/components/date-picker-popover.logic.js +26 -0
- package/dist/components/destructive-action-confirmation.d.ts +21 -0
- package/dist/components/destructive-action-confirmation.js +60 -0
- package/dist/components/destructive-confirm-dialog.d.ts +17 -0
- package/dist/components/destructive-confirm-dialog.js +49 -0
- package/dist/components/dialog.d.ts +37 -0
- package/dist/components/dialog.js +92 -0
- package/dist/components/directional-icon.d.ts +30 -0
- package/dist/components/directional-icon.js +12 -0
- package/dist/components/field.d.ts +11 -0
- package/dist/components/field.js +34 -0
- package/dist/components/form.d.ts +5 -0
- package/dist/components/form.js +12 -0
- package/dist/components/frame.d.ts +10 -0
- package/dist/components/frame.js +35 -0
- package/dist/components/hex-color-picker.d.ts +11 -0
- package/dist/components/hex-color-picker.js +366 -0
- package/dist/components/input-group.d.ts +15 -0
- package/dist/components/input-group.js +53 -0
- package/dist/components/input-otp.d.ts +13 -0
- package/dist/components/input-otp.js +39 -0
- package/dist/components/input.d.ts +12 -0
- package/dist/components/input.js +46 -0
- package/dist/components/label.d.ts +5 -0
- package/dist/components/label.js +18 -0
- package/dist/components/menu.d.ts +44 -0
- package/dist/components/menu.js +152 -0
- package/dist/components/outline-rail.d.ts +43 -0
- package/dist/components/outline-rail.js +416 -0
- package/dist/components/pagination.d.ts +17 -0
- package/dist/components/pagination.js +78 -0
- package/dist/components/popover.d.ts +34 -0
- package/dist/components/popover.js +67 -0
- package/dist/components/preview-card.d.ts +12 -0
- package/dist/components/preview-card.js +25 -0
- package/dist/components/preview-pane.d.ts +23 -0
- package/dist/components/preview-pane.js +33 -0
- package/dist/components/scroll-area.d.ts +19 -0
- package/dist/components/scroll-area.js +38 -0
- package/dist/components/scroll-to-top.d.ts +12 -0
- package/dist/components/scroll-to-top.js +43 -0
- package/dist/components/secret-input.d.ts +9 -0
- package/dist/components/secret-input.js +38 -0
- package/dist/components/segmented-icon-toggle.d.ts +22 -0
- package/dist/components/segmented-icon-toggle.js +30 -0
- package/dist/components/select.d.ts +25 -0
- package/dist/components/select.js +196 -0
- package/dist/components/separator.d.ts +16 -0
- package/dist/components/separator.js +26 -0
- package/dist/components/sheet.d.ts +29 -0
- package/dist/components/sheet.js +87 -0
- package/dist/components/skeleton.d.ts +4 -0
- package/dist/components/skeleton.js +10 -0
- package/dist/components/stella-mark.d.ts +5 -0
- package/dist/components/stella-mark.js +12 -0
- package/dist/components/stella-wordmark.d.ts +5 -0
- package/dist/components/stella-wordmark.js +21 -0
- package/dist/components/table.d.ts +20 -0
- package/dist/components/table.js +80 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.js +46 -0
- package/dist/components/textarea.d.ts +9 -0
- package/dist/components/textarea.js +31 -0
- package/dist/components/toast.d.ts +60 -0
- package/dist/components/toast.js +261 -0
- package/dist/components/tooltip-trigger-helper.d.ts +11 -0
- package/dist/components/tooltip-trigger-helper.js +14 -0
- package/dist/components/tooltip.d.ts +15 -0
- package/dist/components/tooltip.js +32 -0
- package/dist/data-table/index.d.ts +2 -0
- package/dist/data-table/index.js +2 -0
- package/dist/data-table/schema.d.ts +70 -0
- package/dist/data-table/schema.js +40 -0
- package/dist/hooks/use-contained-handler.d.ts +55 -0
- package/dist/hooks/use-contained-handler.js +54 -0
- package/dist/hooks/use-content-dir.d.ts +48 -0
- package/dist/hooks/use-content-dir.js +45 -0
- package/dist/hooks/use-mobile.d.ts +4 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-viewport-width.d.ts +5 -0
- package/dist/hooks/use-viewport-width.js +14 -0
- package/dist/index.d.ts +67 -0
- package/dist/index.js +65 -0
- package/dist/inspector/chrome.d.ts +72 -0
- package/dist/inspector/chrome.js +153 -0
- package/dist/inspector/dock.d.ts +48 -0
- package/dist/inspector/dock.js +36 -0
- package/dist/inspector/index.d.ts +6 -0
- package/dist/inspector/index.js +6 -0
- package/dist/inspector/layout-tokens.d.ts +28 -0
- package/dist/inspector/layout-tokens.js +28 -0
- package/dist/inspector/pane-width.d.ts +64 -0
- package/dist/inspector/pane-width.js +53 -0
- package/dist/inspector/use-pane-width.d.ts +99 -0
- package/dist/inspector/use-pane-width.js +149 -0
- package/dist/kanban/card-properties.d.ts +27 -0
- package/dist/kanban/card-properties.js +19 -0
- package/dist/kanban/card-shell.d.ts +32 -0
- package/dist/kanban/card-shell.js +46 -0
- package/dist/kanban/column-header.d.ts +23 -0
- package/dist/kanban/column-header.js +24 -0
- package/dist/kanban/grouping.d.ts +84 -0
- package/dist/kanban/grouping.js +76 -0
- package/dist/kanban/index.d.ts +5 -0
- package/dist/kanban/index.js +5 -0
- package/dist/lib/button-disposition.d.ts +63 -0
- package/dist/lib/button-disposition.js +52 -0
- package/dist/lib/option-color.d.ts +28 -0
- package/dist/lib/option-color.js +59 -0
- package/dist/lib/overlay-layer.d.ts +22 -0
- package/dist/lib/overlay-layer.js +21 -0
- package/dist/lib/tab-order.d.ts +15 -0
- package/dist/lib/tab-order.js +15 -0
- package/dist/lib/tooltip-content.d.ts +13 -0
- package/dist/lib/tooltip-content.js +12 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.js +41 -0
- package/dist/lib/week.d.ts +25 -0
- package/dist/lib/week.js +40 -0
- package/dist/styles/theme.css +1209 -0
- package/package.json +518 -2
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { DirectionalIcon } from "./directional-icon.js";
|
|
4
|
+
import { buttonVariants } from "./button-variants.js";
|
|
5
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
8
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
9
|
+
//#region src/components/pagination.tsx
|
|
10
|
+
const Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx("nav", {
|
|
11
|
+
"aria-label": "Pagination",
|
|
12
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
13
|
+
"data-slot": "pagination",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
const PaginationContent = ({ className, ...props }) => /* @__PURE__ */ jsx("ul", {
|
|
17
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
18
|
+
"data-slot": "pagination-content",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
const PaginationItem = ({ ...props }) => /* @__PURE__ */ jsx("li", {
|
|
22
|
+
"data-slot": "pagination-item",
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
function PaginationLink({ className, isActive, size = "icon", render, ...props }) {
|
|
26
|
+
const defaultProps = {
|
|
27
|
+
"aria-current": isActive ? "page" : void 0,
|
|
28
|
+
className: render ? className : cn(buttonVariants({
|
|
29
|
+
size,
|
|
30
|
+
variant: isActive ? "outline" : "ghost"
|
|
31
|
+
}), className),
|
|
32
|
+
"data-active": isActive,
|
|
33
|
+
"data-slot": "pagination-link"
|
|
34
|
+
};
|
|
35
|
+
return useRender({
|
|
36
|
+
defaultTagName: "a",
|
|
37
|
+
props: mergeProps(defaultProps, props),
|
|
38
|
+
render
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */ jsxs(PaginationLink, {
|
|
42
|
+
"aria-label": "Go to previous page",
|
|
43
|
+
className: cn("max-sm:aspect-square max-sm:p-0", className),
|
|
44
|
+
size: "default",
|
|
45
|
+
...props,
|
|
46
|
+
children: [/* @__PURE__ */ jsx(DirectionalIcon, {
|
|
47
|
+
className: "sm:-ms-1",
|
|
48
|
+
icon: ChevronLeftIcon
|
|
49
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
50
|
+
className: "max-sm:hidden",
|
|
51
|
+
children: "Previous"
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
const PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs(PaginationLink, {
|
|
55
|
+
"aria-label": "Go to next page",
|
|
56
|
+
className: cn("max-sm:aspect-square max-sm:p-0", className),
|
|
57
|
+
size: "default",
|
|
58
|
+
...props,
|
|
59
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: "max-sm:hidden",
|
|
61
|
+
children: "Next"
|
|
62
|
+
}), /* @__PURE__ */ jsx(DirectionalIcon, {
|
|
63
|
+
className: "sm:-me-1",
|
|
64
|
+
icon: ChevronRightIcon
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
const PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs("span", {
|
|
68
|
+
"aria-hidden": true,
|
|
69
|
+
className: cn("flex min-w-7 justify-center", className),
|
|
70
|
+
"data-slot": "pagination-ellipsis",
|
|
71
|
+
...props,
|
|
72
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-5 sm:size-4" }), /* @__PURE__ */ jsx("span", {
|
|
73
|
+
className: "sr-only",
|
|
74
|
+
children: "More pages"
|
|
75
|
+
})]
|
|
76
|
+
});
|
|
77
|
+
//#endregion
|
|
78
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
5
|
+
//#region src/components/popover.d.ts
|
|
6
|
+
declare const PopoverCreateHandle: typeof Popover$1.createHandle;
|
|
7
|
+
declare const Popover: typeof Popover$1.Root;
|
|
8
|
+
declare function PopoverTrigger({ tooltip, ...props }: Popover$1.Trigger.Props & {
|
|
9
|
+
tooltip?: React$1.ReactNode;
|
|
10
|
+
}): React$1.JSX.Element;
|
|
11
|
+
declare const PopoverPopup: ({ children, className, side, align, sideOffset, alignOffset, tooltipStyle, anchor, layer, ...props }: Popover$1.Popup.Props & {
|
|
12
|
+
side?: Popover$1.Positioner.Props["side"];
|
|
13
|
+
align?: Popover$1.Positioner.Props["align"];
|
|
14
|
+
sideOffset?: Popover$1.Positioner.Props["sideOffset"];
|
|
15
|
+
alignOffset?: Popover$1.Positioner.Props["alignOffset"];
|
|
16
|
+
anchor?: Popover$1.Positioner.Props["anchor"];
|
|
17
|
+
layer?: OverlayLayer;
|
|
18
|
+
tooltipStyle?: boolean;
|
|
19
|
+
}) => React$1.JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Popover surface with the content layout baked in: children stack in a vertical
|
|
22
|
+
* flex container. coss renders popup children inside a separate inner Viewport,
|
|
23
|
+
* so layout utilities placed on the popup `className` silently miss the content.
|
|
24
|
+
* This wrapper removes that footgun — `className` styles the surface (e.g.
|
|
25
|
+
* width), `contentClassName` tweaks the content stack.
|
|
26
|
+
*/
|
|
27
|
+
declare const PopoverPanel: ({ children, contentClassName, ...props }: ComponentProps<typeof PopoverPopup> & {
|
|
28
|
+
contentClassName?: string;
|
|
29
|
+
}) => React$1.JSX.Element;
|
|
30
|
+
declare const PopoverClose: ({ ...props }: Popover$1.Close.Props) => React$1.JSX.Element;
|
|
31
|
+
declare const PopoverTitle: ({ className, ...props }: Popover$1.Title.Props) => React$1.JSX.Element;
|
|
32
|
+
declare const PopoverDescription: ({ className, ...props }: Popover$1.Description.Props) => React$1.JSX.Element;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { OVERLAY_LAYER_CLASS_NAMES } from "../lib/overlay-layer.js";
|
|
4
|
+
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
7
|
+
//#region src/components/popover.tsx
|
|
8
|
+
const PopoverCreateHandle = Popover$1.createHandle;
|
|
9
|
+
const Popover = Popover$1.Root;
|
|
10
|
+
function PopoverTrigger({ tooltip, ...props }) {
|
|
11
|
+
return renderTooltipTrigger({
|
|
12
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
13
|
+
trigger: /* @__PURE__ */ jsx(Popover$1.Trigger, {
|
|
14
|
+
"data-slot": "popover-trigger",
|
|
15
|
+
...props
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const PopoverPopup = ({ children, className, side = "bottom", align = "center", sideOffset = 4, alignOffset = 0, tooltipStyle = false, anchor, layer = "default", ...props }) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
20
|
+
align,
|
|
21
|
+
alignOffset,
|
|
22
|
+
anchor,
|
|
23
|
+
className: cn("h-(--positioner-height) w-(--positioner-width) max-w-(--available-width)", OVERLAY_LAYER_CLASS_NAMES[layer]),
|
|
24
|
+
"data-slot": "popover-positioner",
|
|
25
|
+
side,
|
|
26
|
+
sideOffset,
|
|
27
|
+
children: /* @__PURE__ */ jsx(Popover$1.Popup, {
|
|
28
|
+
className: cn("bg-popover text-popover-foreground relative flex h-(--popup-height,auto) w-(--popup-width,auto) origin-(--transform-origin) rounded-lg border shadow-lg/5 transition-[width,height,scale,opacity] not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", tooltipStyle && "w-fit rounded-md text-xs text-balance shadow-md/5 before:rounded-[calc(var(--radius-md)-1px)]", className),
|
|
29
|
+
"data-slot": "popover-popup",
|
|
30
|
+
...props,
|
|
31
|
+
children: /* @__PURE__ */ jsx(Popover$1.Viewport, {
|
|
32
|
+
className: cn("relative size-full max-h-(--available-height) overflow-clip px-(--viewport-inline-padding) py-4 outline-none [--viewport-inline-padding:--spacing(4)] **:data-current:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-current:opacity-100 **:data-current:transition-opacity **:data-current:data-ending-style:opacity-0 data-instant:transition-none **:data-previous:w-[calc(var(--popup-width)-2*var(--viewport-inline-padding)-2px)] **:data-previous:opacity-100 **:data-previous:transition-opacity **:data-previous:data-ending-style:opacity-0 **:data-current:data-starting-style:opacity-0 **:data-previous:data-starting-style:opacity-0", tooltipStyle ? "py-1 [--viewport-inline-padding:--spacing(2)]" : "not-data-transitioning:overflow-y-auto"),
|
|
33
|
+
"data-slot": "popover-viewport",
|
|
34
|
+
children
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}) });
|
|
38
|
+
/**
|
|
39
|
+
* Popover surface with the content layout baked in: children stack in a vertical
|
|
40
|
+
* flex container. coss renders popup children inside a separate inner Viewport,
|
|
41
|
+
* so layout utilities placed on the popup `className` silently miss the content.
|
|
42
|
+
* This wrapper removes that footgun — `className` styles the surface (e.g.
|
|
43
|
+
* width), `contentClassName` tweaks the content stack.
|
|
44
|
+
*/
|
|
45
|
+
const PopoverPanel = ({ children, contentClassName, ...props }) => /* @__PURE__ */ jsx(PopoverPopup, {
|
|
46
|
+
...props,
|
|
47
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
48
|
+
className: cn("flex flex-col gap-3", contentClassName),
|
|
49
|
+
children
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const PopoverClose = ({ ...props }) => /* @__PURE__ */ jsx(Popover$1.Close, {
|
|
53
|
+
"data-slot": "popover-close",
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
const PopoverTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Popover$1.Title, {
|
|
57
|
+
className: cn("text-lg leading-none font-semibold", className),
|
|
58
|
+
"data-slot": "popover-title",
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
const PopoverDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Popover$1.Description, {
|
|
62
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
63
|
+
"data-slot": "popover-description",
|
|
64
|
+
...props
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Popover, PopoverClose, PopoverPopup as PopoverContent, PopoverPopup, PopoverCreateHandle, PopoverDescription, PopoverPanel, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
3
|
+
//#region src/components/preview-card.d.ts
|
|
4
|
+
declare const PreviewCard: typeof PreviewCardPrimitive.Root;
|
|
5
|
+
declare const PreviewCardTrigger: ({ ...props }: PreviewCardPrimitive.Trigger.Props) => React.ReactElement;
|
|
6
|
+
declare const PreviewCardPopup: ({ className, children, align, sideOffset, anchor, ...props }: PreviewCardPrimitive.Popup.Props & {
|
|
7
|
+
align?: PreviewCardPrimitive.Positioner.Props["align"];
|
|
8
|
+
sideOffset?: PreviewCardPrimitive.Positioner.Props["sideOffset"];
|
|
9
|
+
anchor?: PreviewCardPrimitive.Positioner.Props["anchor"];
|
|
10
|
+
}) => React.ReactElement;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { PreviewCard as HoverCard, PreviewCard, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger, PreviewCardPrimitive };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
|
|
5
|
+
//#region src/components/preview-card.tsx
|
|
6
|
+
const PreviewCard = PreviewCardPrimitive.Root;
|
|
7
|
+
const PreviewCardTrigger = ({ ...props }) => /* @__PURE__ */ jsx(PreviewCardPrimitive.Trigger, {
|
|
8
|
+
"data-slot": "preview-card-trigger",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
const PreviewCardPopup = ({ className, children, align = "center", sideOffset = 4, anchor, ...props }) => /* @__PURE__ */ jsx(PreviewCardPrimitive.Portal, { children: /* @__PURE__ */ jsx(PreviewCardPrimitive.Positioner, {
|
|
12
|
+
align,
|
|
13
|
+
anchor,
|
|
14
|
+
className: "z-50",
|
|
15
|
+
"data-slot": "preview-card-positioner",
|
|
16
|
+
sideOffset,
|
|
17
|
+
children: /* @__PURE__ */ jsx(PreviewCardPrimitive.Popup, {
|
|
18
|
+
className: cn("bg-popover text-popover-foreground relative flex w-64 origin-(--transform-origin) rounded-lg border p-4 text-sm text-balance shadow-lg/5 transition-[scale,opacity] not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-ending-style:opacity-0 data-starting-style:scale-98 data-starting-style:opacity-0 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
|
|
19
|
+
"data-slot": "preview-card-content",
|
|
20
|
+
...props,
|
|
21
|
+
children
|
|
22
|
+
})
|
|
23
|
+
}) });
|
|
24
|
+
//#endregion
|
|
25
|
+
export { PreviewCard as HoverCard, PreviewCard, PreviewCardPopup as HoverCardContent, PreviewCardPopup, PreviewCardTrigger as HoverCardTrigger, PreviewCardTrigger, PreviewCardPrimitive };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/preview-pane.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Side-pane preview pattern: a list of options (menu items, rows) with a
|
|
5
|
+
* fixed-width pane beside it that previews the highlighted option. The pane
|
|
6
|
+
* stays mounted so the container never resizes mid-interaction; drive it
|
|
7
|
+
* from `onMouseEnter`/`onFocus` on the options and render `PreviewPane`
|
|
8
|
+
* empty (no children) while nothing is highlighted.
|
|
9
|
+
*/
|
|
10
|
+
declare const MenuPreviewLayout: ({ children, preview, className }: React$1.PropsWithChildren<{
|
|
11
|
+
preview: React$1.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}>) => React$1.JSX.Element;
|
|
14
|
+
type PreviewPaneProps = React$1.ComponentProps<"div"> & {
|
|
15
|
+
/**
|
|
16
|
+
* `default` is the side pane described above. `thumbnail` is the same pane
|
|
17
|
+
* shrunk to sit inline inside a card or list row beside its own label.
|
|
18
|
+
*/
|
|
19
|
+
size?: "default" | "thumbnail";
|
|
20
|
+
};
|
|
21
|
+
declare const PreviewPane: ({ children, className, size, ...props }: PreviewPaneProps) => React$1.JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { MenuPreviewLayout, PreviewPane };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/preview-pane.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Side-pane preview pattern: a list of options (menu items, rows) with a
|
|
6
|
+
* fixed-width pane beside it that previews the highlighted option. The pane
|
|
7
|
+
* stays mounted so the container never resizes mid-interaction; drive it
|
|
8
|
+
* from `onMouseEnter`/`onFocus` on the options and render `PreviewPane`
|
|
9
|
+
* empty (no children) while nothing is highlighted.
|
|
10
|
+
*/
|
|
11
|
+
const MenuPreviewLayout = ({ children, preview, className }) => /* @__PURE__ */ jsxs("div", {
|
|
12
|
+
className: cn("flex items-stretch", className),
|
|
13
|
+
"data-slot": "menu-preview-layout",
|
|
14
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
15
|
+
className: "flex min-w-32 flex-1 flex-col",
|
|
16
|
+
children
|
|
17
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: "ms-1 hidden border-s ps-1 sm:block",
|
|
19
|
+
children: preview
|
|
20
|
+
})]
|
|
21
|
+
});
|
|
22
|
+
const PreviewPane = ({ children, className, size = "default", ...props }) => /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: cn("pointer-events-none select-none", size === "thumbnail" ? "w-32" : "w-64 p-2", className),
|
|
24
|
+
"data-slot": "preview-pane",
|
|
25
|
+
...props,
|
|
26
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
27
|
+
"aria-hidden": true,
|
|
28
|
+
className: cn("bg-muted/40 overflow-hidden rounded-md border", size === "thumbnail" ? "h-20 p-1.5" : "h-36 p-2"),
|
|
29
|
+
children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { MenuPreviewLayout, PreviewPane };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from "react";
|
|
2
|
+
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
3
|
+
//#region src/components/scroll-area.d.ts
|
|
4
|
+
declare const ScrollArea: ({ className, children, scrollFade, scrollbarClassName, scrollbarGutter, viewportRef, ...props }: ScrollArea$1.Root.Props & {
|
|
5
|
+
scrollFade?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Extra classes applied to both scrollbars, on top of their default
|
|
8
|
+
* styling — the escape hatch for a consumer whose scrollbar must win a
|
|
9
|
+
* stacking fight against a sibling with its own z-index (e.g. a floating
|
|
10
|
+
* composer veil docked over the scroll area). Omit for the default
|
|
11
|
+
* (unelevated) overlay-thumb treatment.
|
|
12
|
+
*/
|
|
13
|
+
scrollbarClassName?: string;
|
|
14
|
+
scrollbarGutter?: boolean;
|
|
15
|
+
viewportRef?: Ref<HTMLDivElement>;
|
|
16
|
+
}) => import("react").JSX.Element;
|
|
17
|
+
declare const ScrollBar: ({ className, orientation, ...props }: ScrollArea$1.Scrollbar.Props) => import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
5
|
+
//#region src/components/scroll-area.tsx
|
|
6
|
+
const ScrollArea = ({ className, children, scrollFade = false, scrollbarClassName, scrollbarGutter = false, viewportRef, ...props }) => /* @__PURE__ */ jsxs(ScrollArea$1.Root, {
|
|
7
|
+
className: cn("size-full min-h-0", className),
|
|
8
|
+
...props,
|
|
9
|
+
children: [
|
|
10
|
+
/* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
11
|
+
ref: viewportRef,
|
|
12
|
+
className: cn("transition-shadows focus-visible:ring-ring focus-visible:ring-offset-background h-full overscroll-contain rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-offset-1 data-has-overflow-x:overscroll-x-contain", scrollFade && "mask-t-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-start)))] mask-r-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-end)))] mask-b-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-y-end)))] mask-l-from-[calc(100%-min(var(--fade-size),var(--scroll-area-overflow-x-start)))] [--fade-size:1.5rem]", scrollbarGutter && "data-has-overflow-x:pb-2.5 data-has-overflow-y:pe-2.5"),
|
|
13
|
+
"data-slot": "scroll-area-viewport",
|
|
14
|
+
children
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsx(ScrollBar, {
|
|
17
|
+
className: scrollbarClassName,
|
|
18
|
+
orientation: "vertical"
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx(ScrollBar, {
|
|
21
|
+
className: scrollbarClassName,
|
|
22
|
+
orientation: "horizontal"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ jsx(ScrollArea$1.Corner, { "data-slot": "scroll-area-corner" })
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
const ScrollBar = ({ className, orientation = "vertical", ...props }) => /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
28
|
+
className: cn("m-1 flex opacity-0 transition-opacity delay-300 data-hovering:opacity-100 data-hovering:delay-0 data-hovering:duration-100 data-scrolling:opacity-100 data-scrolling:delay-0 data-scrolling:duration-100 data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:flex-col data-[orientation=vertical]:w-1.5", className),
|
|
29
|
+
"data-slot": "scroll-area-scrollbar",
|
|
30
|
+
orientation,
|
|
31
|
+
...props,
|
|
32
|
+
children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, {
|
|
33
|
+
className: "bg-foreground/20 relative flex-1 rounded-full",
|
|
34
|
+
"data-slot": "scroll-area-thumb"
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
//#endregion
|
|
38
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from "react";
|
|
2
|
+
//#region src/components/scroll-to-top.d.ts
|
|
3
|
+
type ScrollToTopProps = {
|
|
4
|
+
scrollContainerRef: RefObject<HTMLElement | null>;
|
|
5
|
+
/** Show once scrollTop exceeds this many px. */
|
|
6
|
+
threshold?: number;
|
|
7
|
+
label?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const ScrollToTop: ({ scrollContainerRef, threshold, label, className }: ScrollToTopProps) => import("react").JSX.Element;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { ScrollToTop, ScrollToTopProps };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
//#region src/components/scroll-to-top.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Scroll-to-top affordance — a subtle floating button that fades in once a
|
|
8
|
+
* scroll container is scrolled past a threshold and jumps back to the top
|
|
9
|
+
* (instant, not animated, so it stays snappy on very long documents).
|
|
10
|
+
*/
|
|
11
|
+
const ScrollToTop = ({ scrollContainerRef, threshold = 600, label = "Scroll to top", className }) => {
|
|
12
|
+
const [visible, setVisible] = useState(false);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const container = scrollContainerRef.current;
|
|
15
|
+
if (!container) return;
|
|
16
|
+
const onScroll = () => setVisible(container.scrollTop > threshold);
|
|
17
|
+
onScroll();
|
|
18
|
+
container.addEventListener("scroll", onScroll, { passive: true });
|
|
19
|
+
return () => container.removeEventListener("scroll", onScroll);
|
|
20
|
+
}, [scrollContainerRef, threshold]);
|
|
21
|
+
return /* @__PURE__ */ jsx("button", {
|
|
22
|
+
"aria-label": label,
|
|
23
|
+
className: cn("border-border bg-popover/90 text-muted-foreground hover:text-foreground absolute end-6 bottom-6 z-30 flex size-9 items-center justify-center rounded-full border shadow-md backdrop-blur transition-[opacity,transform] duration-200", visible ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-2 opacity-0", className),
|
|
24
|
+
onClick: () => scrollContainerRef.current?.scrollTo({
|
|
25
|
+
top: 0,
|
|
26
|
+
behavior: "instant"
|
|
27
|
+
}),
|
|
28
|
+
type: "button",
|
|
29
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
30
|
+
"aria-hidden": true,
|
|
31
|
+
className: "size-4",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
strokeLinecap: "round",
|
|
35
|
+
strokeLinejoin: "round",
|
|
36
|
+
strokeWidth: "2",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
children: /* @__PURE__ */ jsx("path", { d: "m18 15-6-6-6 6" })
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ScrollToTop };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InputProps } from "./input.js";
|
|
2
|
+
//#region src/components/secret-input.d.ts
|
|
3
|
+
type SecretInputProps = Omit<InputProps, "type"> & {
|
|
4
|
+
hideValueLabel: string;
|
|
5
|
+
showValueLabel: string;
|
|
6
|
+
};
|
|
7
|
+
declare const SecretInput: ({ className, dir, disabled, hideValueLabel, showValueLabel, ...props }: SecretInputProps) => import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { SecretInput, type SecretInputProps };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { Input } from "./input.js";
|
|
5
|
+
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
//#region src/components/secret-input.tsx
|
|
9
|
+
const SecretInput = ({ className, dir, disabled, hideValueLabel, showValueLabel, ...props }) => {
|
|
10
|
+
const [visibility, setVisibility] = useState("concealed");
|
|
11
|
+
const isRevealed = visibility === "revealed";
|
|
12
|
+
const label = isRevealed ? hideValueLabel : showValueLabel;
|
|
13
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
14
|
+
className: "relative inline-flex w-full",
|
|
15
|
+
"data-slot": "secret-input",
|
|
16
|
+
dir: dir ?? "ltr",
|
|
17
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
18
|
+
className: cn("**:[input]:pe-9", className),
|
|
19
|
+
disabled,
|
|
20
|
+
...props,
|
|
21
|
+
dir: dir ?? "ltr",
|
|
22
|
+
type: isRevealed ? "text" : "password"
|
|
23
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
24
|
+
"aria-label": label,
|
|
25
|
+
"aria-pressed": isRevealed,
|
|
26
|
+
className: "text-muted-foreground hover:text-foreground absolute end-1 top-1/2 z-1 -translate-y-1/2",
|
|
27
|
+
"data-slot": "secret-input-visibility-toggle",
|
|
28
|
+
disabled,
|
|
29
|
+
onClick: () => setVisibility(isRevealed ? "concealed" : "revealed"),
|
|
30
|
+
size: "icon-xs",
|
|
31
|
+
type: "button",
|
|
32
|
+
variant: "ghost",
|
|
33
|
+
children: isRevealed ? /* @__PURE__ */ jsx(EyeOffIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true" })
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { SecretInput };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
//#region src/components/segmented-icon-toggle.d.ts
|
|
3
|
+
type SegmentedIconToggleOption<T extends string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
icon: ComponentType<{
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** Already-translated label; shown as a tooltip and the accessible name. */
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
type SegmentedIconToggleProps<T extends string> = {
|
|
12
|
+
value: T;
|
|
13
|
+
options: readonly SegmentedIconToggleOption<T>[];
|
|
14
|
+
onChange: (value: T) => void;
|
|
15
|
+
size?: "compact" | "touch";
|
|
16
|
+
};
|
|
17
|
+
/** Compact segmented control of icon buttons (e.g. table row wrap, list
|
|
18
|
+
* density). One shared shell so every density/mode switch looks and behaves
|
|
19
|
+
* the same across the app. */
|
|
20
|
+
declare const SegmentedIconToggle: <T extends string>({ value, options, onChange, size }: SegmentedIconToggleProps<T>) => import("react").JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { SegmentedIconToggle };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "./tooltip.js";
|
|
4
|
+
import { Button } from "./button.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/segmented-icon-toggle.tsx
|
|
7
|
+
/** Compact segmented control of icon buttons (e.g. table row wrap, list
|
|
8
|
+
* density). One shared shell so every density/mode switch looks and behaves
|
|
9
|
+
* the same across the app. */
|
|
10
|
+
const SegmentedIconToggle = ({ value, options, onChange, size = "compact" }) => /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: cn("border-border/70 bg-muted/30 inline-flex shrink-0 items-center overflow-hidden rounded-md border p-0.5", size === "touch" ? "h-7 [@media(any-pointer:coarse)]:h-12" : "h-7"),
|
|
12
|
+
children: options.map((option) => {
|
|
13
|
+
const Icon = option.icon;
|
|
14
|
+
const isActive = value === option.value;
|
|
15
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
16
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
17
|
+
"aria-label": option.label,
|
|
18
|
+
"aria-pressed": isActive,
|
|
19
|
+
className: cn("text-muted-foreground h-6 min-h-0 w-7 rounded-[4px] p-0", size === "touch" && "[@media(any-pointer:coarse)]:h-11 [@media(any-pointer:coarse)]:min-h-11 [@media(any-pointer:coarse)]:w-11", isActive && "bg-muted text-foreground ring-border/80 hover:bg-muted hover:text-foreground shadow-xs ring-1"),
|
|
20
|
+
onClick: () => onChange(option.value),
|
|
21
|
+
size: "icon-xs",
|
|
22
|
+
type: "button",
|
|
23
|
+
variant: "ghost"
|
|
24
|
+
}),
|
|
25
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })
|
|
26
|
+
}), /* @__PURE__ */ jsx(TooltipPopup, { children: option.label })] }, option.value);
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { SegmentedIconToggle };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import { Select as Select$1 } from "@base-ui/react/select";
|
|
3
|
+
//#region src/components/select.d.ts
|
|
4
|
+
type SelectItemProps = Select$1.Item.Props & {
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const Select: <Value, Multiple extends boolean | undefined = false>({ children, itemToStringLabel, ...props }: Select$1.Root.Props<Value, Multiple>) => React$1.JSX.Element;
|
|
8
|
+
declare const SelectTrigger: ({ className, size, children, ...props }: Select$1.Trigger.Props & {
|
|
9
|
+
size?: "sm" | "default" | "lg";
|
|
10
|
+
}) => React$1.JSX.Element;
|
|
11
|
+
declare const SelectValue: ({ className, children, placeholder, ...props }: Select$1.Value.Props) => React$1.JSX.Element;
|
|
12
|
+
declare const SelectPopup: ({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, collisionAvoidance, ...props }: Select$1.Popup.Props & {
|
|
13
|
+
side?: Select$1.Positioner.Props["side"];
|
|
14
|
+
sideOffset?: Select$1.Positioner.Props["sideOffset"];
|
|
15
|
+
align?: Select$1.Positioner.Props["align"];
|
|
16
|
+
alignOffset?: Select$1.Positioner.Props["alignOffset"];
|
|
17
|
+
alignItemWithTrigger?: Select$1.Positioner.Props["alignItemWithTrigger"];
|
|
18
|
+
collisionAvoidance?: Select$1.Positioner.Props["collisionAvoidance"];
|
|
19
|
+
}) => React$1.JSX.Element;
|
|
20
|
+
declare const SelectItem: ({ className, children, label: _label, ...props }: SelectItemProps) => React$1.JSX.Element;
|
|
21
|
+
declare const SelectSeparator: ({ className, ...props }: Select$1.Separator.Props) => React$1.JSX.Element;
|
|
22
|
+
declare const SelectGroup: (props: Select$1.Group.Props) => React$1.JSX.Element;
|
|
23
|
+
declare const SelectGroupLabel: (props: Select$1.GroupLabel.Props) => React$1.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Select, SelectPopup as SelectContent, SelectPopup, SelectGroup, SelectGroupLabel, SelectItem, SelectSeparator, SelectTrigger, SelectValue };
|