@stll/ui 0.0.1-placeholder.0 → 0.2.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 +39 -0
- package/dist/components/outline-rail.js +405 -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/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 +60 -0
- package/dist/index.js +59 -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/lib/button-disposition.d.ts +63 -0
- package/dist/lib/button-disposition.js +52 -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 +506 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/components/date-picker-popover.logic.ts
|
|
2
|
+
const DATE_ROLLOVER_EPSILON_MS = 50;
|
|
3
|
+
const padDatePart = (value) => value.toString().padStart(2, "0");
|
|
4
|
+
const localDateFromTimestamp = (timestamp) => {
|
|
5
|
+
const current = new Date(timestamp);
|
|
6
|
+
return [
|
|
7
|
+
current.getFullYear(),
|
|
8
|
+
padDatePart(current.getMonth() + 1),
|
|
9
|
+
padDatePart(current.getDate())
|
|
10
|
+
].join("-");
|
|
11
|
+
};
|
|
12
|
+
const calendarMonthFromDate = (date) => {
|
|
13
|
+
const current = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
|
|
14
|
+
return {
|
|
15
|
+
month: current.getUTCMonth(),
|
|
16
|
+
year: current.getUTCFullYear()
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const resolveCalendarViewMonth = ({ override, today, value }) => override ?? calendarMonthFromDate(value || today);
|
|
20
|
+
const millisecondsUntilNextLocalDate = (timestamp) => {
|
|
21
|
+
const current = new Date(timestamp);
|
|
22
|
+
const nextLocalDate = new Date(current.getFullYear(), current.getMonth(), current.getDate() + 1);
|
|
23
|
+
return Math.max(0, nextLocalDate.getTime() - timestamp) + DATE_ROLLOVER_EPSILON_MS;
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { localDateFromTimestamp, millisecondsUntilNextLocalDate, resolveCalendarViewMonth };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InputProps } from "./input.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
//#region src/components/destructive-action-confirmation.d.ts
|
|
4
|
+
type DestructiveActionConfirmationProps = Omit<InputProps, "onChange" | "type" | "value"> & {
|
|
5
|
+
confirmation: string;
|
|
6
|
+
description?: React$1.ReactNode;
|
|
7
|
+
fieldClassName?: string;
|
|
8
|
+
inputClassName?: string;
|
|
9
|
+
label: React$1.ReactNode;
|
|
10
|
+
onValueChange: (value: string) => void;
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DestructiveActionConfirmation: ({ className, confirmation, description, fieldClassName, inputClassName, label, onValueChange, value, ...props }: DestructiveActionConfirmationProps) => React$1.JSX.Element;
|
|
14
|
+
declare function useDestructiveActionConfirmation(confirmation: string): {
|
|
15
|
+
confirmed: boolean;
|
|
16
|
+
onValueChange: React$1.Dispatch<React$1.SetStateAction<string>>;
|
|
17
|
+
reset: () => void;
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DestructiveActionConfirmation, useDestructiveActionConfirmation };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { Input } from "./input.js";
|
|
4
|
+
import { Field, FieldDescription, FieldLabel } from "./field.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
//#region src/components/destructive-action-confirmation.tsx
|
|
8
|
+
const DestructiveActionConfirmation = ({ className, confirmation, description, fieldClassName, inputClassName, label, onValueChange, value, ...props }) => {
|
|
9
|
+
const confirmed = isDestructiveActionConfirmed({
|
|
10
|
+
confirmation,
|
|
11
|
+
value
|
|
12
|
+
});
|
|
13
|
+
const invalid = value.length >= confirmation.length && !confirmed;
|
|
14
|
+
return /* @__PURE__ */ jsxs(Field, {
|
|
15
|
+
className: fieldClassName,
|
|
16
|
+
"data-confirmed": confirmed || void 0,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
19
|
+
description !== void 0 ? /* @__PURE__ */ jsx(FieldDescription, { children: description }) : null,
|
|
20
|
+
/* @__PURE__ */ jsx("code", {
|
|
21
|
+
className: cn("bg-muted text-foreground max-w-full rounded-md border px-2 py-1 font-mono text-xs break-all", className),
|
|
22
|
+
"data-slot": "destructive-action-confirmation-phrase",
|
|
23
|
+
children: confirmation
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ jsx(Input, {
|
|
26
|
+
"aria-invalid": invalid || void 0,
|
|
27
|
+
autoCapitalize: "none",
|
|
28
|
+
autoComplete: "off",
|
|
29
|
+
className: inputClassName,
|
|
30
|
+
"data-slot": "destructive-action-confirmation-input",
|
|
31
|
+
spellCheck: false,
|
|
32
|
+
...props,
|
|
33
|
+
onChange: (event) => {
|
|
34
|
+
onValueChange(event.currentTarget.value);
|
|
35
|
+
},
|
|
36
|
+
type: "text",
|
|
37
|
+
value
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
function useDestructiveActionConfirmation(confirmation) {
|
|
43
|
+
const [value, setValue] = React$1.useState("");
|
|
44
|
+
return {
|
|
45
|
+
confirmed: isDestructiveActionConfirmed({
|
|
46
|
+
confirmation,
|
|
47
|
+
value
|
|
48
|
+
}),
|
|
49
|
+
onValueChange: setValue,
|
|
50
|
+
reset: () => {
|
|
51
|
+
setValue("");
|
|
52
|
+
},
|
|
53
|
+
value
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function isDestructiveActionConfirmed({ confirmation, value }) {
|
|
57
|
+
return value === confirmation;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { DestructiveActionConfirmation, useDestructiveActionConfirmation };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/destructive-confirm-dialog.d.ts
|
|
3
|
+
type DestructiveConfirmDialogProps = {
|
|
4
|
+
cancelLabel: React$1.ReactNode;
|
|
5
|
+
confirmLabel: React$1.ReactNode;
|
|
6
|
+
confirmation: string;
|
|
7
|
+
description: React$1.ReactNode;
|
|
8
|
+
inputLabel: React$1.ReactNode;
|
|
9
|
+
loading?: boolean | undefined;
|
|
10
|
+
onConfirm: () => Promise<void> | void;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
open: boolean;
|
|
13
|
+
title: React$1.ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare const DestructiveConfirmDialog: ({ cancelLabel, confirmLabel, confirmation, description, inputLabel, loading, onConfirm, onOpenChange, open, title }: DestructiveConfirmDialogProps) => React$1.JSX.Element;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DestructiveConfirmDialog, type DestructiveConfirmDialogProps };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { AlertDialog, AlertDialogClose, AlertDialogContent as AlertDialogPopup, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPanel, AlertDialogTitle } from "./alert-dialog.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { DestructiveActionConfirmation, useDestructiveActionConfirmation } from "./destructive-action-confirmation.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/destructive-confirm-dialog.tsx
|
|
7
|
+
const DestructiveConfirmDialog = ({ cancelLabel, confirmLabel, confirmation, description, inputLabel, loading = false, onConfirm, onOpenChange, open, title }) => {
|
|
8
|
+
const typedConfirmation = useDestructiveActionConfirmation(confirmation);
|
|
9
|
+
const handleOpenChange = (nextOpen) => {
|
|
10
|
+
onOpenChange(nextOpen);
|
|
11
|
+
if (!nextOpen) typedConfirmation.reset();
|
|
12
|
+
};
|
|
13
|
+
const handleConfirm = async () => {
|
|
14
|
+
if (!typedConfirmation.confirmed) return;
|
|
15
|
+
try {
|
|
16
|
+
await onConfirm();
|
|
17
|
+
handleOpenChange(false);
|
|
18
|
+
} catch {}
|
|
19
|
+
};
|
|
20
|
+
const handleConfirmClick = () => {
|
|
21
|
+
handleConfirm().catch(() => void 0);
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsx(AlertDialog, {
|
|
24
|
+
onOpenChange: handleOpenChange,
|
|
25
|
+
open,
|
|
26
|
+
children: /* @__PURE__ */ jsxs(AlertDialogPopup, { children: [
|
|
27
|
+
/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [/* @__PURE__ */ jsx(AlertDialogTitle, { children: title }), /* @__PURE__ */ jsx(AlertDialogDescription, { children: description })] }),
|
|
28
|
+
/* @__PURE__ */ jsx(AlertDialogPanel, { children: /* @__PURE__ */ jsx(DestructiveActionConfirmation, {
|
|
29
|
+
confirmation,
|
|
30
|
+
label: inputLabel,
|
|
31
|
+
onValueChange: typedConfirmation.onValueChange,
|
|
32
|
+
placeholder: confirmation,
|
|
33
|
+
value: typedConfirmation.value
|
|
34
|
+
}) }),
|
|
35
|
+
/* @__PURE__ */ jsxs(AlertDialogFooter, { children: [/* @__PURE__ */ jsx(AlertDialogClose, {
|
|
36
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "ghost" }),
|
|
37
|
+
children: cancelLabel
|
|
38
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
39
|
+
disabled: !typedConfirmation.confirmed,
|
|
40
|
+
loading,
|
|
41
|
+
onClick: handleConfirmClick,
|
|
42
|
+
variant: "destructive",
|
|
43
|
+
children: confirmLabel
|
|
44
|
+
})] })
|
|
45
|
+
] })
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { DestructiveConfirmDialog };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { OverlayLayer } from "../lib/overlay-layer.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
4
|
+
//#region src/components/dialog.d.ts
|
|
5
|
+
declare const DialogCreateHandle: typeof Dialog$1.createHandle;
|
|
6
|
+
declare const Dialog: typeof Dialog$1.Root;
|
|
7
|
+
declare const DialogPortal: React$1.ForwardRefExoticComponent<Omit<import("@base-ui/react").AlertDialogPortalProps, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare function DialogTrigger({ tooltip, ...props }: Dialog$1.Trigger.Props & {
|
|
9
|
+
tooltip?: React$1.ReactNode;
|
|
10
|
+
}): React$1.JSX.Element;
|
|
11
|
+
declare function DialogClose({ tooltip, ...props }: Dialog$1.Close.Props & {
|
|
12
|
+
tooltip?: React$1.ReactNode;
|
|
13
|
+
}): React$1.JSX.Element;
|
|
14
|
+
declare const DialogBackdrop: ({ className, layer, ...props }: Dialog$1.Backdrop.Props & {
|
|
15
|
+
layer?: OverlayLayer;
|
|
16
|
+
}) => React$1.JSX.Element;
|
|
17
|
+
declare const DialogViewport: ({ className, layer, ...props }: Dialog$1.Viewport.Props & {
|
|
18
|
+
layer?: OverlayLayer;
|
|
19
|
+
}) => React$1.JSX.Element;
|
|
20
|
+
declare const DialogPopup: ({ backdropClassName, className, children, showCloseButton, bottomStickOnMobile, layer, viewportClassName, ...props }: Dialog$1.Popup.Props & {
|
|
21
|
+
backdropClassName?: string;
|
|
22
|
+
showCloseButton?: boolean;
|
|
23
|
+
bottomStickOnMobile?: boolean;
|
|
24
|
+
layer?: OverlayLayer;
|
|
25
|
+
viewportClassName?: string;
|
|
26
|
+
}) => React$1.JSX.Element;
|
|
27
|
+
declare const DialogHeader: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
28
|
+
declare const DialogFooter: ({ className, variant, ...props }: React$1.ComponentProps<"div"> & {
|
|
29
|
+
variant?: "default" | "bare";
|
|
30
|
+
}) => React$1.JSX.Element;
|
|
31
|
+
declare const DialogTitle: ({ className, ...props }: Dialog$1.Title.Props) => React$1.JSX.Element;
|
|
32
|
+
declare const DialogDescription: ({ className, ...props }: Dialog$1.Description.Props) => React$1.JSX.Element;
|
|
33
|
+
declare const DialogPanel: ({ className, scrollFade, ...props }: React$1.ComponentProps<"div"> & {
|
|
34
|
+
scrollFade?: boolean;
|
|
35
|
+
}) => React$1.JSX.Element;
|
|
36
|
+
//#endregion
|
|
37
|
+
export { Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport };
|
|
@@ -0,0 +1,92 @@
|
|
|
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 { Button } from "./button.js";
|
|
6
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
7
|
+
import { XIcon } from "lucide-react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
|
|
10
|
+
//#region src/components/dialog.tsx
|
|
11
|
+
const DialogCreateHandle = Dialog$1.createHandle;
|
|
12
|
+
const Dialog = Dialog$1.Root;
|
|
13
|
+
const DialogPortal = Dialog$1.Portal;
|
|
14
|
+
function DialogTrigger({ tooltip, ...props }) {
|
|
15
|
+
return renderTooltipTrigger({
|
|
16
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
17
|
+
trigger: /* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
18
|
+
"data-slot": "dialog-trigger",
|
|
19
|
+
...props
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function DialogClose({ tooltip, ...props }) {
|
|
24
|
+
return renderTooltipTrigger({
|
|
25
|
+
tooltip: tooltip ?? props["aria-label"] ?? props.title,
|
|
26
|
+
trigger: /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
27
|
+
"data-slot": "dialog-close",
|
|
28
|
+
...props
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const DialogBackdrop = ({ className, layer = "default", ...props }) => /* @__PURE__ */ jsx(Dialog$1.Backdrop, {
|
|
33
|
+
className: cn("fixed inset-0 bg-black/32 backdrop-blur-sm transition-opacity duration-200 data-ending-style:opacity-0 data-starting-style:opacity-0", OVERLAY_LAYER_CLASS_NAMES[layer], className),
|
|
34
|
+
"data-slot": "dialog-backdrop",
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
const DialogViewport = ({ className, layer = "default", ...props }) => /* @__PURE__ */ jsx(Dialog$1.Viewport, {
|
|
38
|
+
className: cn("fixed inset-0 grid grid-rows-[1fr_auto_3fr] justify-items-center p-4", OVERLAY_LAYER_CLASS_NAMES[layer], className),
|
|
39
|
+
"data-slot": "dialog-viewport",
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
const DialogPopup = ({ backdropClassName, className, children, showCloseButton = true, bottomStickOnMobile = true, layer = "default", viewportClassName, ...props }) => /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogBackdrop, {
|
|
43
|
+
className: backdropClassName,
|
|
44
|
+
layer
|
|
45
|
+
}), /* @__PURE__ */ jsx(DialogViewport, {
|
|
46
|
+
className: cn(bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:p-0 max-sm:pt-12", viewportClassName),
|
|
47
|
+
layer,
|
|
48
|
+
children: /* @__PURE__ */ jsxs(Dialog$1.Popup, {
|
|
49
|
+
className: cn("bg-popover text-popover-foreground relative row-start-2 flex max-h-full min-h-0 w-full max-w-lg min-w-0 -translate-y-[calc(1.25rem*var(--nested-dialogs))] scale-[calc(1-0.1*var(--nested-dialogs))] flex-col rounded-2xl border opacity-[calc(1-0.1*var(--nested-dialogs))] shadow-lg/5 transition-[scale,opacity,translate] duration-200 ease-in-out will-change-transform not-dark:bg-clip-padding before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-2xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] data-ending-style:scale-98 data-ending-style:opacity-0 data-nested:data-ending-style:translate-y-8 data-nested-dialog-open:origin-top data-starting-style:scale-98 data-starting-style:opacity-0 data-nested:data-starting-style:translate-y-8 dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", bottomStickOnMobile && "max-sm:max-w-none max-sm:rounded-none max-sm:border-x-0 max-sm:border-t max-sm:border-b-0 max-sm:opacity-[calc(1-min(var(--nested-dialogs),1))] max-sm:before:hidden max-sm:before:rounded-none max-sm:data-ending-style:translate-y-4 max-sm:data-starting-style:translate-y-4", className),
|
|
50
|
+
"data-slot": "dialog-popup",
|
|
51
|
+
...props,
|
|
52
|
+
children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
|
|
53
|
+
"aria-label": "Close",
|
|
54
|
+
className: "absolute end-2 top-2",
|
|
55
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
56
|
+
size: "icon",
|
|
57
|
+
variant: "ghost"
|
|
58
|
+
}),
|
|
59
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
60
|
+
})]
|
|
61
|
+
})
|
|
62
|
+
})] });
|
|
63
|
+
const DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
64
|
+
className: cn("flex flex-col gap-2 p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pb-3 max-sm:pb-4", className),
|
|
65
|
+
"data-slot": "dialog-header",
|
|
66
|
+
...props
|
|
67
|
+
});
|
|
68
|
+
const DialogFooter = ({ className, variant = "default", ...props }) => /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: cn("flex flex-col-reverse gap-2 px-6 sm:flex-row sm:justify-end sm:rounded-b-[calc(var(--radius-2xl)-1px)]", variant === "default" && "bg-muted/72 border-t py-4", variant === "bare" && "pt-4 pb-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-panel])]:pt-3", className),
|
|
70
|
+
"data-slot": "dialog-footer",
|
|
71
|
+
...props
|
|
72
|
+
});
|
|
73
|
+
const DialogTitle = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog$1.Title, {
|
|
74
|
+
className: cn("font-heading text-xl leading-none font-semibold", className),
|
|
75
|
+
"data-slot": "dialog-title",
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
const DialogDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Dialog$1.Description, {
|
|
79
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
80
|
+
"data-slot": "dialog-description",
|
|
81
|
+
...props
|
|
82
|
+
});
|
|
83
|
+
const DialogPanel = ({ className, scrollFade = true, ...props }) => /* @__PURE__ */ jsx(ScrollArea, {
|
|
84
|
+
scrollFade,
|
|
85
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: cn("p-6 in-[[data-slot=dialog-popup]:has([data-slot=dialog-footer]:not(.border-t))]:pb-1 in-[[data-slot=dialog-popup]:has([data-slot=dialog-header])]:pt-1", className),
|
|
87
|
+
"data-slot": "dialog-panel",
|
|
88
|
+
...props
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { Dialog, DialogBackdrop, DialogBackdrop as DialogOverlay, DialogClose, DialogPopup as DialogContent, DialogPopup, DialogCreateHandle, DialogDescription, DialogFooter, DialogHeader, DialogPanel, DialogPortal, DialogTitle, DialogTrigger, DialogViewport };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { LucideIcon } from "lucide-react";
|
|
2
|
+
//#region src/components/directional-icon.d.ts
|
|
3
|
+
type DirectionalIconProps = {
|
|
4
|
+
/**
|
|
5
|
+
* A horizontally-directional lucide icon (chevron / arrow / caret /
|
|
6
|
+
* chevrons). It is mirrored under an RTL UI so it points the correct
|
|
7
|
+
* way. Do NOT use this for orientation-independent icons (play/pause,
|
|
8
|
+
* spinner/refresh/clock, magnifier, checkmark, camera, brand marks,
|
|
9
|
+
* file-type or chart-axis glyphs) — those must never mirror.
|
|
10
|
+
*/
|
|
11
|
+
icon: LucideIcon;
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to mirror under RTL. Defaults to `true`. Pass
|
|
15
|
+
* `flip={!isExpanded}` for disclosure chevrons that also `rotate-90`
|
|
16
|
+
* on expand, so the horizontal mirror is only applied while collapsed
|
|
17
|
+
* (an always-on mirror composes with the rotation and points the
|
|
18
|
+
* expanded state the wrong way).
|
|
19
|
+
*/
|
|
20
|
+
flip?: boolean;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Single sanctioned way to render a direction-bearing icon. Centralizes
|
|
24
|
+
* the `rtl:-scale-x-100` mirror so individual call sites can't get RTL
|
|
25
|
+
* handling wrong (forget the flip, or wrongly flip a non-directional
|
|
26
|
+
* icon). See `/conventions-ux` → Right-to-Left & Bidirectional.
|
|
27
|
+
*/
|
|
28
|
+
declare const DirectionalIcon: ({ icon: Icon, className, flip }: DirectionalIconProps) => import("react").JSX.Element;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { DirectionalIcon };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/directional-icon.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Single sanctioned way to render a direction-bearing icon. Centralizes
|
|
6
|
+
* the `rtl:-scale-x-100` mirror so individual call sites can't get RTL
|
|
7
|
+
* handling wrong (forget the flip, or wrongly flip a non-directional
|
|
8
|
+
* icon). See `/conventions-ux` → Right-to-Left & Bidirectional.
|
|
9
|
+
*/
|
|
10
|
+
const DirectionalIcon = ({ icon: Icon, className, flip = true }) => /* @__PURE__ */ jsx(Icon, { className: cn(flip && "rtl:-scale-x-100", className) });
|
|
11
|
+
//#endregion
|
|
12
|
+
export { DirectionalIcon };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
2
|
+
//#region src/components/field.d.ts
|
|
3
|
+
declare const Field: ({ className, ...props }: Field$1.Root.Props) => import("react").JSX.Element;
|
|
4
|
+
declare const FieldLabel: ({ className, ...props }: Field$1.Label.Props) => import("react").JSX.Element;
|
|
5
|
+
declare const FieldItem: ({ className, ...props }: Field$1.Item.Props) => import("react").JSX.Element;
|
|
6
|
+
declare const FieldDescription: ({ className, ...props }: Field$1.Description.Props) => import("react").JSX.Element;
|
|
7
|
+
declare const FieldError: ({ className, ...props }: Field$1.Error.Props) => import("react").JSX.Element;
|
|
8
|
+
declare const FieldControl: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").FieldControlProps, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
declare const FieldValidity: import("react").FC<import("@base-ui/react").FieldValidityProps>;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Field as Field$1 } from "@base-ui/react/field";
|
|
5
|
+
//#region src/components/field.tsx
|
|
6
|
+
const Field = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Root, {
|
|
7
|
+
className: cn("flex flex-col items-start gap-2", className),
|
|
8
|
+
"data-slot": "field",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
const FieldLabel = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Label, {
|
|
12
|
+
className: cn("text-foreground inline-flex items-center gap-2 text-base/4.5 font-medium sm:text-sm/4", className),
|
|
13
|
+
"data-slot": "field-label",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
const FieldItem = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Item, {
|
|
17
|
+
className: cn("flex", className),
|
|
18
|
+
"data-slot": "field-item",
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
const FieldDescription = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Description, {
|
|
22
|
+
className: cn("text-muted-foreground text-xs", className),
|
|
23
|
+
"data-slot": "field-description",
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
const FieldError = ({ className, ...props }) => /* @__PURE__ */ jsx(Field$1.Error, {
|
|
27
|
+
className: cn("text-destructive-foreground text-xs", className),
|
|
28
|
+
"data-slot": "field-error",
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
const FieldControl = Field$1.Control;
|
|
32
|
+
const FieldValidity = Field$1.Validity;
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Field, FieldControl, FieldDescription, FieldError, FieldItem, FieldLabel, FieldValidity };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Form as Form$1 } from "@base-ui/react/form";
|
|
5
|
+
//#region src/components/form.tsx
|
|
6
|
+
const Form = ({ className, ...props }) => /* @__PURE__ */ jsx(Form$1, {
|
|
7
|
+
className: cn("flex w-full flex-col gap-4", className),
|
|
8
|
+
"data-slot": "form",
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Form };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/frame.d.ts
|
|
3
|
+
declare const Frame: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
4
|
+
declare const FramePanel: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
5
|
+
declare const FrameHeader: ({ className, ...props }: React$1.ComponentProps<"header">) => React$1.JSX.Element;
|
|
6
|
+
declare const FrameTitle: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
7
|
+
declare const FrameDescription: ({ className, ...props }: React$1.ComponentProps<"div">) => React$1.JSX.Element;
|
|
8
|
+
declare const FrameFooter: ({ className, ...props }: React$1.ComponentProps<"footer">) => React$1.JSX.Element;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/frame.tsx
|
|
4
|
+
const Frame = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
5
|
+
className: cn("bg-muted/72 relative flex flex-col rounded-2xl p-1", "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1", className),
|
|
6
|
+
"data-slot": "frame",
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
9
|
+
const FramePanel = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
10
|
+
className: cn("bg-background relative rounded-xl border bg-clip-padding p-5 shadow-xs/5 before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-xl)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:before:shadow-[0_-1px_--theme(--color-white/6%)]", className),
|
|
11
|
+
"data-slot": "frame-panel",
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
const FrameHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("header", {
|
|
15
|
+
className: cn("flex flex-col px-5 py-4", className),
|
|
16
|
+
"data-slot": "frame-panel-header",
|
|
17
|
+
...props
|
|
18
|
+
});
|
|
19
|
+
const FrameTitle = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: cn("text-sm font-semibold", className),
|
|
21
|
+
"data-slot": "frame-panel-title",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
const FrameDescription = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
26
|
+
"data-slot": "frame-panel-description",
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
const FrameFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("footer", {
|
|
30
|
+
className: cn("px-5 py-4", className),
|
|
31
|
+
"data-slot": "frame-panel-footer",
|
|
32
|
+
...props
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/components/hex-color-picker.d.ts
|
|
3
|
+
type HexColorPickerProps = {
|
|
4
|
+
/** Hex color with or without # (e.g. "#ff0000" or "FF0000") */
|
|
5
|
+
color?: string | undefined;
|
|
6
|
+
onChange?: (hex: string) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const HexColorPicker: ({ color, onChange, className }: HexColorPickerProps) => React$1.JSX.Element;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { HexColorPicker, type HexColorPickerProps };
|