@azmr/ui 0.1.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 +171 -0
- package/dist/avatar.d.ts +58 -0
- package/dist/avatar.js +84 -0
- package/dist/breadcrumb.d.ts +47 -0
- package/dist/breadcrumb.js +120 -0
- package/dist/button-CYt2Zw3D.d.ts +64 -0
- package/dist/button.d.ts +54 -0
- package/dist/button.js +19 -0
- package/dist/chunk-2RIWL363.js +27 -0
- package/dist/chunk-2TQSHVXA.js +12 -0
- package/dist/chunk-7EOSDFS3.js +10 -0
- package/dist/chunk-C2HKIPLQ.js +118 -0
- package/dist/chunk-CAJLW6K2.js +16 -0
- package/dist/chunk-CZJZYN54.js +36 -0
- package/dist/chunk-EE4V6XMB.js +35 -0
- package/dist/chunk-EFHRRLAW.js +211 -0
- package/dist/chunk-GLB75NT3.js +21 -0
- package/dist/chunk-GX2YEJ43.js +36 -0
- package/dist/chunk-LTOLV67A.js +19 -0
- package/dist/chunk-LZMX27IZ.js +10 -0
- package/dist/chunk-NIIDYIZA.js +1 -0
- package/dist/chunk-Q4PPM2SU.js +97 -0
- package/dist/chunk-WVE2E37B.js +20 -0
- package/dist/chunk-XRZHP6BD.js +92 -0
- package/dist/disclosure.d.ts +72 -0
- package/dist/disclosure.js +221 -0
- package/dist/display.d.ts +111 -0
- package/dist/display.js +237 -0
- package/dist/features-dom-MCGKRLN5.js +7 -0
- package/dist/features-max-COBTQCO6.js +7 -0
- package/dist/floating.d.ts +81 -0
- package/dist/floating.js +231 -0
- package/dist/hooks.d.ts +33 -0
- package/dist/hooks.js +55 -0
- package/dist/icons/lucide.d.ts +77 -0
- package/dist/icons/lucide.js +135 -0
- package/dist/icons/mui-map.d.ts +1268 -0
- package/dist/icons/mui-map.js +352 -0
- package/dist/icons.d.ts +48 -0
- package/dist/icons.js +19 -0
- package/dist/index.d.ts +238 -3
- package/dist/index.js +242 -15
- package/dist/input.d.ts +14 -0
- package/dist/input.js +8 -0
- package/dist/layout/mui-map.d.ts +80 -0
- package/dist/layout/mui-map.js +104 -0
- package/dist/layout.d.ts +89 -0
- package/dist/layout.js +455 -0
- package/dist/lib.d.ts +11 -0
- package/dist/lib.js +6 -0
- package/dist/menu.d.ts +105 -0
- package/dist/menu.js +56 -0
- package/dist/modal.d.ts +105 -0
- package/dist/modal.js +273 -0
- package/dist/motion.css +295 -0
- package/dist/motion.d.ts +49 -0
- package/dist/motion.js +48 -0
- package/dist/pagination.d.ts +82 -0
- package/dist/pagination.js +211 -0
- package/dist/presets.d.ts +97 -0
- package/dist/presets.js +94 -0
- package/dist/progress.d.ts +70 -0
- package/dist/progress.js +138 -0
- package/dist/react.d.ts +81 -0
- package/dist/react.js +281 -0
- package/dist/responsive-YJBnvsjt.d.ts +69 -0
- package/dist/scroll-area.d.ts +30 -0
- package/dist/scroll-area.js +80 -0
- package/dist/shared-Fkx-sjPt.d.ts +15 -0
- package/dist/spinner.d.ts +18 -0
- package/dist/spinner.js +39 -0
- package/dist/split-button.d.ts +32 -0
- package/dist/split-button.js +54 -0
- package/dist/stepper.d.ts +27 -0
- package/dist/stepper.js +104 -0
- package/dist/styles.css +24 -0
- package/dist/table.d.ts +52 -0
- package/dist/table.js +124 -0
- package/dist/theme.d.ts +111 -0
- package/dist/theme.js +414 -0
- package/dist/toast.d.ts +77 -0
- package/dist/toast.js +203 -0
- package/dist/toggle.d.ts +55 -0
- package/dist/toggle.js +88 -0
- package/dist/tokens.css +337 -0
- package/dist/transition.d.ts +51 -0
- package/dist/transition.js +79 -0
- package/dist/types-BBudf463.d.ts +39 -0
- package/dist/typography/mui-map.d.ts +91 -0
- package/dist/typography/mui-map.js +62 -0
- package/dist/typography.d.ts +90 -0
- package/dist/typography.js +193 -0
- package/dist/useSignal-C-3ZGURN.d.ts +21 -0
- package/dist/variants-De0c0ucO.d.ts +60 -0
- package/package.json +179 -13
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-2TQSHVXA.js";
|
|
5
|
+
|
|
6
|
+
// src/components/spinner/spinner.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var Spinner = forwardRef(function Spinner2({ label, className, ...props }, ref) {
|
|
10
|
+
return (
|
|
11
|
+
// biome-ignore lint/a11y/noSvgWithoutTitle: decorative (aria-hidden) by default, or role="status" with an aria-label when `label` is set; both paths are covered by axe tests
|
|
12
|
+
/* @__PURE__ */ jsxs(
|
|
13
|
+
"svg",
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: "none",
|
|
18
|
+
"data-motion": "essential",
|
|
19
|
+
className: cn("size-4 animate-spin", className),
|
|
20
|
+
...label ? { role: "status", "aria-label": label } : { "aria-hidden": true },
|
|
21
|
+
...props,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeOpacity: "0.25", strokeWidth: "3" }),
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
"path",
|
|
26
|
+
{
|
|
27
|
+
d: "M22 12a10 10 0 0 0-10-10",
|
|
28
|
+
stroke: "currentColor",
|
|
29
|
+
strokeWidth: "3",
|
|
30
|
+
strokeLinecap: "round"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// src/components/button/variants.ts
|
|
40
|
+
import { cva } from "class-variance-authority";
|
|
41
|
+
var buttonVariants = cva(
|
|
42
|
+
[
|
|
43
|
+
"relative inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium",
|
|
44
|
+
"h-(--density-control-height) px-(--density-control-padding-x)",
|
|
45
|
+
"transition-colors duration-(--motion-duration-fast) ease-standard",
|
|
46
|
+
"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
47
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
48
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
49
|
+
],
|
|
50
|
+
{
|
|
51
|
+
variants: {
|
|
52
|
+
variant: {
|
|
53
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
54
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
55
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
56
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
57
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
58
|
+
success: "bg-success text-success-foreground hover:bg-success/90",
|
|
59
|
+
warning: "bg-warning text-warning-foreground hover:bg-warning/90",
|
|
60
|
+
info: "bg-info text-info-foreground hover:bg-info/90",
|
|
61
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
62
|
+
},
|
|
63
|
+
size: {
|
|
64
|
+
sm: "h-8 px-3 text-xs",
|
|
65
|
+
md: "",
|
|
66
|
+
lg: "h-11 px-6",
|
|
67
|
+
icon: "size-(--density-control-height) p-0"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
defaultVariants: { variant: "default", size: "md" }
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
// src/components/button/button.tsx
|
|
75
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
76
|
+
|
|
77
|
+
// src/primitives/button.ts
|
|
78
|
+
import { Button } from "@base-ui/react/button";
|
|
79
|
+
|
|
80
|
+
// src/components/button/button.tsx
|
|
81
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
82
|
+
var Button2 = forwardRef2(function Button3({
|
|
83
|
+
variant,
|
|
84
|
+
size,
|
|
85
|
+
className,
|
|
86
|
+
loading = false,
|
|
87
|
+
loadingText,
|
|
88
|
+
startIcon,
|
|
89
|
+
endIcon,
|
|
90
|
+
disabled,
|
|
91
|
+
focusableWhenDisabled,
|
|
92
|
+
children,
|
|
93
|
+
...props
|
|
94
|
+
}, ref) {
|
|
95
|
+
return /* @__PURE__ */ jsxs2(
|
|
96
|
+
Button,
|
|
97
|
+
{
|
|
98
|
+
ref,
|
|
99
|
+
disabled: disabled || loading,
|
|
100
|
+
focusableWhenDisabled: loading || focusableWhenDisabled,
|
|
101
|
+
"aria-busy": loading || void 0,
|
|
102
|
+
"data-loading": loading ? "" : void 0,
|
|
103
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
104
|
+
...props,
|
|
105
|
+
children: [
|
|
106
|
+
loading ? /* @__PURE__ */ jsx2(Spinner, {}) : startIcon,
|
|
107
|
+
loading && loadingText !== void 0 ? loadingText : children,
|
|
108
|
+
endIcon
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export {
|
|
115
|
+
Spinner,
|
|
116
|
+
buttonVariants,
|
|
117
|
+
Button2 as Button
|
|
118
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/useSignal.ts
|
|
4
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
5
|
+
function useSignal(signal) {
|
|
6
|
+
const subscribe = useCallback(
|
|
7
|
+
(onStoreChange) => signal.subscribe(() => onStoreChange()),
|
|
8
|
+
[signal]
|
|
9
|
+
);
|
|
10
|
+
const getSnapshot = useCallback(() => signal.peek(), [signal]);
|
|
11
|
+
return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
useSignal
|
|
16
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Button
|
|
4
|
+
} from "./chunk-C2HKIPLQ.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-2TQSHVXA.js";
|
|
8
|
+
|
|
9
|
+
// src/components/button/icon-button.tsx
|
|
10
|
+
import { forwardRef } from "react";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var SQUARE = { sm: "size-8", md: "", lg: "size-11" };
|
|
13
|
+
var IconButton = forwardRef(function IconButton2({ icon, label, variant = "ghost", size = "md", loading = false, className, ...props }, ref) {
|
|
14
|
+
if (process.env.NODE_ENV !== "production" && (typeof label !== "string" || !label.trim())) {
|
|
15
|
+
throw new Error(
|
|
16
|
+
"IconButton: `label` must be a non-empty string; it is the button's accessible name."
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Button,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
size: "icon",
|
|
24
|
+
variant,
|
|
25
|
+
"aria-label": label,
|
|
26
|
+
loading,
|
|
27
|
+
className: cn(SQUARE[size], className),
|
|
28
|
+
...props,
|
|
29
|
+
children: loading ? null : icon
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
IconButton
|
|
36
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-2TQSHVXA.js";
|
|
5
|
+
|
|
6
|
+
// src/components/button/button-group.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
function joinedClasses(orientation, attached) {
|
|
10
|
+
if (!attached) return cn("inline-flex gap-2", orientation === "vertical" && "flex-col");
|
|
11
|
+
return cn(
|
|
12
|
+
"inline-flex [&>*]:relative [&>*:focus-visible]:z-10 [&>*:hover]:z-10",
|
|
13
|
+
orientation === "vertical" ? "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none [&>*:not(:first-child)]:-mt-px" : "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:last-child)]:rounded-r-none [&>*:not(:first-child)]:-ml-px"
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
var ButtonGroup = forwardRef(function ButtonGroup2({ orientation = "horizontal", attached = true, className, ...props }, ref) {
|
|
17
|
+
return (
|
|
18
|
+
// biome-ignore lint/a11y/useSemanticElements: a fieldset brings a legend and default styling; a group of buttons is a plain role="group" container
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
role: "group",
|
|
24
|
+
"data-orientation": orientation,
|
|
25
|
+
className: cn(joinedClasses(orientation, attached), className),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
joinedClasses,
|
|
34
|
+
ButtonGroup
|
|
35
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
FLOATING_MOTION,
|
|
4
|
+
POSITION_DEFAULTS
|
|
5
|
+
} from "./chunk-LZMX27IZ.js";
|
|
6
|
+
import {
|
|
7
|
+
Icon
|
|
8
|
+
} from "./chunk-XRZHP6BD.js";
|
|
9
|
+
import {
|
|
10
|
+
cn
|
|
11
|
+
} from "./chunk-2TQSHVXA.js";
|
|
12
|
+
|
|
13
|
+
// src/components/menu/context-menu.tsx
|
|
14
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
15
|
+
|
|
16
|
+
// src/primitives/context-menu.ts
|
|
17
|
+
import { ContextMenu } from "@base-ui/react/context-menu";
|
|
18
|
+
|
|
19
|
+
// src/components/menu/parts.tsx
|
|
20
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
21
|
+
import { forwardRef } from "react";
|
|
22
|
+
|
|
23
|
+
// src/primitives/menu.ts
|
|
24
|
+
import { Menu } from "@base-ui/react/menu";
|
|
25
|
+
|
|
26
|
+
// src/components/menu/parts.tsx
|
|
27
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
|
+
var MENU_POSITIONER = "z-(--z-popover)";
|
|
29
|
+
var MENU_POPUP = cn(
|
|
30
|
+
"min-w-40 max-h-(--available-height) overflow-y-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-elevation-3 outline-none",
|
|
31
|
+
FLOATING_MOTION
|
|
32
|
+
);
|
|
33
|
+
var ITEM = cn(
|
|
34
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors duration-(--motion-duration-fast)",
|
|
35
|
+
"data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
|
|
36
|
+
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
37
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
38
|
+
);
|
|
39
|
+
var CHECKABLE = "pl-8";
|
|
40
|
+
var INDICATOR = "absolute left-2 flex size-4 items-center justify-center";
|
|
41
|
+
var DESTRUCTIVE = "text-destructive data-[highlighted]:bg-destructive/10 data-[highlighted]:text-destructive";
|
|
42
|
+
var MenuItem = forwardRef(function MenuItem2({ variant = "default", className, ...props }, ref) {
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Menu.Item,
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
className: cn(ITEM, variant === "destructive" && DESTRUCTIVE, className),
|
|
48
|
+
...props
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
var MenuLinkItem = forwardRef(function MenuLinkItem2({ className, ...props }, ref) {
|
|
53
|
+
return /* @__PURE__ */ jsx(Menu.LinkItem, { ref, className: cn(ITEM, className), ...props });
|
|
54
|
+
});
|
|
55
|
+
var MenuCheckboxItem = forwardRef(function MenuCheckboxItem2({ className, children, ...props }, ref) {
|
|
56
|
+
return /* @__PURE__ */ jsxs(Menu.CheckboxItem, { ref, className: cn(ITEM, CHECKABLE, className), ...props, children: [
|
|
57
|
+
/* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, { className: INDICATOR, children: /* @__PURE__ */ jsx(Icon, { icon: Check }) }),
|
|
58
|
+
children
|
|
59
|
+
] });
|
|
60
|
+
});
|
|
61
|
+
var MenuRadioGroup = Menu.RadioGroup;
|
|
62
|
+
var MenuRadioItem = forwardRef(function MenuRadioItem2({ className, children, ...props }, ref) {
|
|
63
|
+
return /* @__PURE__ */ jsxs(Menu.RadioItem, { ref, className: cn(ITEM, CHECKABLE, className), ...props, children: [
|
|
64
|
+
/* @__PURE__ */ jsx(Menu.RadioItemIndicator, { className: INDICATOR, children: /* @__PURE__ */ jsx(Icon, { icon: Circle, size: "xs", className: "fill-current" }) }),
|
|
65
|
+
children
|
|
66
|
+
] });
|
|
67
|
+
});
|
|
68
|
+
var MenuGroup = Menu.Group;
|
|
69
|
+
var MenuLabel = forwardRef(function MenuLabel2({ className, ...props }, ref) {
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
Menu.GroupLabel,
|
|
72
|
+
{
|
|
73
|
+
ref,
|
|
74
|
+
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground", className),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
});
|
|
79
|
+
var MenuSeparator = forwardRef(function MenuSeparator2({ className, ...props }, ref) {
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
Menu.Separator,
|
|
82
|
+
{
|
|
83
|
+
ref,
|
|
84
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
85
|
+
...props
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
function MenuShortcut({ className, ...props }) {
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
"span",
|
|
92
|
+
{
|
|
93
|
+
"data-azmr-shortcut": "",
|
|
94
|
+
className: cn("ml-auto pl-4 text-xs tracking-widest text-muted-foreground", className),
|
|
95
|
+
...props
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
var MenuSub = Menu.SubmenuRoot;
|
|
100
|
+
var MenuSubTrigger = forwardRef(function MenuSubTrigger2({ className, children, ...props }, ref) {
|
|
101
|
+
return /* @__PURE__ */ jsxs(
|
|
102
|
+
Menu.SubmenuTrigger,
|
|
103
|
+
{
|
|
104
|
+
ref,
|
|
105
|
+
className: cn(ITEM, "data-[popup-open]:bg-accent", className),
|
|
106
|
+
...props,
|
|
107
|
+
children: [
|
|
108
|
+
children,
|
|
109
|
+
/* @__PURE__ */ jsx(Icon, { icon: ChevronRight, className: "ml-auto" })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
});
|
|
114
|
+
var MenuSubContent = forwardRef(
|
|
115
|
+
function MenuSubContent2({
|
|
116
|
+
side = "inline-end",
|
|
117
|
+
align = "start",
|
|
118
|
+
sideOffset = 2,
|
|
119
|
+
collisionPadding = POSITION_DEFAULTS.collisionPadding,
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}, ref) {
|
|
123
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(
|
|
124
|
+
Menu.Positioner,
|
|
125
|
+
{
|
|
126
|
+
side,
|
|
127
|
+
align,
|
|
128
|
+
sideOffset,
|
|
129
|
+
collisionPadding,
|
|
130
|
+
className: MENU_POSITIONER,
|
|
131
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, { ref, className: cn(MENU_POPUP, className), ...props })
|
|
132
|
+
}
|
|
133
|
+
) });
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
// src/components/menu/context-menu.tsx
|
|
138
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
139
|
+
var ContextMenu2 = ContextMenu.Root;
|
|
140
|
+
var ContextMenuTrigger = ContextMenu.Trigger;
|
|
141
|
+
var ContextMenuContent = forwardRef2(
|
|
142
|
+
function ContextMenuContent2({
|
|
143
|
+
side,
|
|
144
|
+
align,
|
|
145
|
+
sideOffset,
|
|
146
|
+
collisionPadding = POSITION_DEFAULTS.collisionPadding,
|
|
147
|
+
className,
|
|
148
|
+
...props
|
|
149
|
+
}, ref) {
|
|
150
|
+
return /* @__PURE__ */ jsx2(ContextMenu.Portal, { children: /* @__PURE__ */ jsx2(
|
|
151
|
+
ContextMenu.Positioner,
|
|
152
|
+
{
|
|
153
|
+
side,
|
|
154
|
+
align,
|
|
155
|
+
sideOffset,
|
|
156
|
+
collisionPadding,
|
|
157
|
+
className: MENU_POSITIONER,
|
|
158
|
+
children: /* @__PURE__ */ jsx2(ContextMenu.Popup, { ref, className: cn(MENU_POPUP, className), ...props })
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
// src/components/menu/dropdown-menu.tsx
|
|
165
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
166
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
167
|
+
var DropdownMenu = Menu.Root;
|
|
168
|
+
var DropdownMenuTrigger = Menu.Trigger;
|
|
169
|
+
var DropdownMenuContent = forwardRef3(
|
|
170
|
+
function DropdownMenuContent2({
|
|
171
|
+
side = "bottom",
|
|
172
|
+
align = "start",
|
|
173
|
+
sideOffset = POSITION_DEFAULTS.sideOffset - 2,
|
|
174
|
+
collisionPadding = POSITION_DEFAULTS.collisionPadding,
|
|
175
|
+
className,
|
|
176
|
+
...props
|
|
177
|
+
}, ref) {
|
|
178
|
+
return /* @__PURE__ */ jsx3(Menu.Portal, { children: /* @__PURE__ */ jsx3(
|
|
179
|
+
Menu.Positioner,
|
|
180
|
+
{
|
|
181
|
+
side,
|
|
182
|
+
align,
|
|
183
|
+
sideOffset,
|
|
184
|
+
collisionPadding,
|
|
185
|
+
className: MENU_POSITIONER,
|
|
186
|
+
children: /* @__PURE__ */ jsx3(Menu.Popup, { ref, className: cn(MENU_POPUP, className), ...props })
|
|
187
|
+
}
|
|
188
|
+
) });
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
export {
|
|
193
|
+
MenuItem,
|
|
194
|
+
MenuLinkItem,
|
|
195
|
+
MenuCheckboxItem,
|
|
196
|
+
MenuRadioGroup,
|
|
197
|
+
MenuRadioItem,
|
|
198
|
+
MenuGroup,
|
|
199
|
+
MenuLabel,
|
|
200
|
+
MenuSeparator,
|
|
201
|
+
MenuShortcut,
|
|
202
|
+
MenuSub,
|
|
203
|
+
MenuSubTrigger,
|
|
204
|
+
MenuSubContent,
|
|
205
|
+
ContextMenu2 as ContextMenu,
|
|
206
|
+
ContextMenuTrigger,
|
|
207
|
+
ContextMenuContent,
|
|
208
|
+
DropdownMenu,
|
|
209
|
+
DropdownMenuTrigger,
|
|
210
|
+
DropdownMenuContent
|
|
211
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/motion/presets/presets.ts
|
|
2
|
+
var motionPresets = {
|
|
3
|
+
fade: { enter: "motion-fade-in", exit: "motion-fade-out" },
|
|
4
|
+
scale: { enter: "motion-scale-in", exit: "motion-scale-out" },
|
|
5
|
+
slideUp: { enter: "motion-slide-up-in", exit: "motion-slide-up-out" },
|
|
6
|
+
slideDown: { enter: "motion-slide-down-in", exit: "motion-slide-down-out" },
|
|
7
|
+
slideLeft: { enter: "motion-slide-left-in", exit: "motion-slide-left-out" },
|
|
8
|
+
slideRight: { enter: "motion-slide-right-in", exit: "motion-slide-right-out" },
|
|
9
|
+
/** A grid-template-rows collapse. Use `Collapse`. */
|
|
10
|
+
collapse: { root: "motion-collapse", inner: "motion-collapse-inner" },
|
|
11
|
+
/** A staggered list. Use `Stagger`. */
|
|
12
|
+
stagger: { container: "motion-stagger", item: "motion-stagger-item" },
|
|
13
|
+
/** A sweeping highlight for loading placeholders. Put it on a rounded, overflow-clipped box. */
|
|
14
|
+
shimmer: "motion-shimmer",
|
|
15
|
+
/** An SVG tick that draws itself. Use `AnimatedCheck`. */
|
|
16
|
+
checkDraw: "motion-check"
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
motionPresets
|
|
21
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-2TQSHVXA.js";
|
|
5
|
+
|
|
6
|
+
// src/components/input/input.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
|
|
9
|
+
// src/primitives/input.ts
|
|
10
|
+
import { Input } from "@base-ui/react/input";
|
|
11
|
+
|
|
12
|
+
// src/components/input/input.tsx
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var Input2 = forwardRef(function Input3({ className, type = "text", ...props }, ref) {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
Input,
|
|
17
|
+
{
|
|
18
|
+
ref,
|
|
19
|
+
type,
|
|
20
|
+
className: cn(
|
|
21
|
+
"flex h-(--density-control-height) w-full min-w-0 rounded-md border border-input bg-background px-(--density-control-padding-x) py-1 text-sm text-foreground",
|
|
22
|
+
"transition-colors duration-(--motion-duration-fast) ease-standard",
|
|
23
|
+
"outline-none placeholder:text-muted-foreground",
|
|
24
|
+
"focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring",
|
|
25
|
+
"aria-invalid:border-destructive data-[invalid]:border-destructive",
|
|
26
|
+
"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 read-only:bg-muted",
|
|
27
|
+
className
|
|
28
|
+
),
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
Input2 as Input
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-7EOSDFS3.js";
|
|
4
|
+
|
|
5
|
+
// src/components/shared/render-element.ts
|
|
6
|
+
import { cloneElement, createElement } from "react";
|
|
7
|
+
function renderElement(render, tag, props, children) {
|
|
8
|
+
if (!render) return createElement(tag, props, children);
|
|
9
|
+
const own = render.props;
|
|
10
|
+
return cloneElement(
|
|
11
|
+
render,
|
|
12
|
+
{ ...props, ...own, className: cn(props.className, own.className) },
|
|
13
|
+
children
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
renderElement
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/floating/shared.ts
|
|
4
|
+
var POSITION_DEFAULTS = { sideOffset: 6, collisionPadding: 8 };
|
|
5
|
+
var FLOATING_MOTION = "origin-(--transform-origin) transition-[opacity,scale] duration-(--motion-duration-fast) ease-standard data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:scale-95 data-[ending-style]:opacity-0";
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
POSITION_DEFAULTS,
|
|
9
|
+
FLOATING_MOTION
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-7EOSDFS3.js";
|
|
4
|
+
|
|
5
|
+
// src/icons/registry.ts
|
|
6
|
+
var ICON_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
7
|
+
var registry = /* @__PURE__ */ new Map();
|
|
8
|
+
var warned = /* @__PURE__ */ new Set();
|
|
9
|
+
function isIconComponent(value) {
|
|
10
|
+
return typeof value === "function" || typeof value === "object" && value !== null && "$$typeof" in value;
|
|
11
|
+
}
|
|
12
|
+
function assertIconEntry(name, component) {
|
|
13
|
+
if (!ICON_NAME.test(name)) {
|
|
14
|
+
throw new TypeError(
|
|
15
|
+
`Invalid icon name "${name}": use lower-case kebab-case, e.g. "arrow-right"`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
if (!isIconComponent(component)) {
|
|
19
|
+
throw new TypeError(`Icon "${name}" must be a React component that renders an <svg>`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function registerIcons(icons) {
|
|
23
|
+
const entries = Object.entries(icons);
|
|
24
|
+
for (const [name, component] of entries) assertIconEntry(name, component);
|
|
25
|
+
for (const [name, component] of entries) registry.set(name, component);
|
|
26
|
+
}
|
|
27
|
+
function getIcon(name) {
|
|
28
|
+
return registry.get(name);
|
|
29
|
+
}
|
|
30
|
+
function registeredIconNames() {
|
|
31
|
+
return [...registry.keys()];
|
|
32
|
+
}
|
|
33
|
+
function warnMissingIcon(name) {
|
|
34
|
+
const isProduction = typeof process !== "undefined" && process.env?.NODE_ENV === "production";
|
|
35
|
+
const key = name ?? "(no icon or name)";
|
|
36
|
+
if (isProduction || warned.has(key)) return;
|
|
37
|
+
warned.add(key);
|
|
38
|
+
console.error(
|
|
39
|
+
name === void 0 ? "<Icon> needs an `icon` component or a registered `name`; rendering nothing." : `<Icon name="${name}"> is not registered (see registerIcons); rendering nothing.`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/icons/icon.tsx
|
|
44
|
+
import { forwardRef } from "react";
|
|
45
|
+
import { jsx } from "react/jsx-runtime";
|
|
46
|
+
var iconSizes = {
|
|
47
|
+
xs: "size-3",
|
|
48
|
+
sm: "size-3.5",
|
|
49
|
+
md: "size-4",
|
|
50
|
+
lg: "size-5",
|
|
51
|
+
xl: "size-6"
|
|
52
|
+
};
|
|
53
|
+
var Icon = forwardRef(function Icon2({
|
|
54
|
+
icon,
|
|
55
|
+
name,
|
|
56
|
+
size = "md",
|
|
57
|
+
spin = false,
|
|
58
|
+
className,
|
|
59
|
+
"aria-label": ariaLabel,
|
|
60
|
+
"aria-labelledby": ariaLabelledBy,
|
|
61
|
+
...props
|
|
62
|
+
}, ref) {
|
|
63
|
+
const resolved = icon ?? (name === void 0 ? void 0 : getIcon(name));
|
|
64
|
+
if (!resolved) {
|
|
65
|
+
warnMissingIcon(name);
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const Component = resolved;
|
|
69
|
+
const labelled = Boolean(ariaLabel || ariaLabelledBy);
|
|
70
|
+
const numeric = typeof size === "number";
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
Component,
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
className: cn(
|
|
76
|
+
numeric ? void 0 : iconSizes[size],
|
|
77
|
+
"shrink-0",
|
|
78
|
+
spin && "animate-spin",
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
...numeric ? { width: size, height: size } : {},
|
|
82
|
+
...spin ? { "data-motion": "essential" } : {},
|
|
83
|
+
...labelled ? { role: "img", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy } : { "aria-hidden": true },
|
|
84
|
+
...props
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
assertIconEntry,
|
|
91
|
+
registerIcons,
|
|
92
|
+
getIcon,
|
|
93
|
+
registeredIconNames,
|
|
94
|
+
warnMissingIcon,
|
|
95
|
+
iconSizes,
|
|
96
|
+
Icon
|
|
97
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/use-reduced-motion.ts
|
|
4
|
+
import { useSyncExternalStore } from "react";
|
|
5
|
+
var QUERY = "(prefers-reduced-motion: reduce)";
|
|
6
|
+
function subscribe(onChange) {
|
|
7
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return () => {
|
|
8
|
+
};
|
|
9
|
+
const media = window.matchMedia(QUERY);
|
|
10
|
+
media.addEventListener("change", onChange);
|
|
11
|
+
return () => media.removeEventListener("change", onChange);
|
|
12
|
+
}
|
|
13
|
+
var read = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(QUERY).matches;
|
|
14
|
+
function useReducedMotion() {
|
|
15
|
+
return useSyncExternalStore(subscribe, read, () => false);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
useReducedMotion
|
|
20
|
+
};
|