@azmr/ui 0.0.1 → 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/LICENSE +1 -1
- package/README.md +244 -73
- 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/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 +240 -5
- 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/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 +173 -18
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { ButtonProps as ButtonProps$1 } from '@base-ui/react/button';
|
|
5
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
6
|
+
|
|
7
|
+
/** The look of a button, as classes. Pure (no React), so server components can use it too. */
|
|
8
|
+
declare const buttonVariants: (props?: ({
|
|
9
|
+
variant?: "link" | "default" | "secondary" | "outline" | "ghost" | "destructive" | "success" | "warning" | "info" | null | undefined;
|
|
10
|
+
size?: "sm" | "md" | "lg" | "icon" | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
|
|
13
|
+
type ButtonVariant = NonNullable<VariantProps<typeof buttonVariants>["variant"]>;
|
|
14
|
+
type TextButtonSize = "sm" | "md" | "lg";
|
|
15
|
+
/**
|
|
16
|
+
* The props `Button` adds on top of a native button. Kept as its own interface so the docs can
|
|
17
|
+
* generate a props table from it. Everything else a button accepts (`onClick`, `type`, `disabled`,
|
|
18
|
+
* `render`, `nativeButton`, `focusableWhenDisabled`, any `aria-*`, ...) is passed through.
|
|
19
|
+
*/
|
|
20
|
+
interface ButtonOwnProps {
|
|
21
|
+
/** Visual style. `default` is the primary action; use `destructive` for irreversible ones. */
|
|
22
|
+
variant?: ButtonVariant;
|
|
23
|
+
/**
|
|
24
|
+
* `md` follows the density token, so it grows or shrinks with `data-density`. `icon` is a square
|
|
25
|
+
* button for an icon alone and requires `aria-label` or `aria-labelledby`.
|
|
26
|
+
*/
|
|
27
|
+
size?: "sm" | "md" | "lg" | "icon";
|
|
28
|
+
/** Show a spinner, mark the button busy and ignore activation. It stays focusable. */
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
/** Replaces the label while `loading`. */
|
|
31
|
+
loadingText?: ReactNode;
|
|
32
|
+
/** Shown before the label; replaced by the spinner while `loading`. */
|
|
33
|
+
startIcon?: ReactNode;
|
|
34
|
+
/** Shown after the label. */
|
|
35
|
+
endIcon?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
interface BaseButtonProps extends Omit<ButtonProps$1, "className" | "children">, Omit<ButtonOwnProps, "size"> {
|
|
38
|
+
className?: string;
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/** An icon-only button has no text, so it must be given an accessible name. */
|
|
42
|
+
type IconOnly = {
|
|
43
|
+
size: "icon";
|
|
44
|
+
} & ({
|
|
45
|
+
"aria-label": string;
|
|
46
|
+
} | {
|
|
47
|
+
"aria-labelledby": string;
|
|
48
|
+
});
|
|
49
|
+
type ButtonProps = BaseButtonProps & ({
|
|
50
|
+
size?: TextButtonSize;
|
|
51
|
+
} | IconOnly);
|
|
52
|
+
declare const Button: react.ForwardRefExoticComponent<(Omit<BaseButtonProps & {
|
|
53
|
+
size: "icon";
|
|
54
|
+
} & {
|
|
55
|
+
"aria-label": string;
|
|
56
|
+
}, "ref"> | Omit<BaseButtonProps & {
|
|
57
|
+
size: "icon";
|
|
58
|
+
} & {
|
|
59
|
+
"aria-labelledby": string;
|
|
60
|
+
}, "ref"> | Omit<BaseButtonProps & {
|
|
61
|
+
size?: TextButtonSize;
|
|
62
|
+
}, "ref">) & react.RefAttributes<HTMLButtonElement>>;
|
|
63
|
+
|
|
64
|
+
export { type ButtonOwnProps as B, Button as a, type ButtonProps as b, buttonVariants as c };
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { B as ButtonOwnProps } from './button-CYt2Zw3D.js';
|
|
2
|
+
export { a as Button, b as ButtonProps, c as buttonVariants } from './button-CYt2Zw3D.js';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
5
|
+
import { ButtonProps } from '@base-ui/react/button';
|
|
6
|
+
import 'class-variance-authority';
|
|
7
|
+
import 'class-variance-authority/types';
|
|
8
|
+
|
|
9
|
+
type Named = {
|
|
10
|
+
"aria-label": string;
|
|
11
|
+
} | {
|
|
12
|
+
"aria-labelledby": string;
|
|
13
|
+
};
|
|
14
|
+
type ButtonGroupProps = Omit<HTMLAttributes<HTMLDivElement>, "aria-label" | "aria-labelledby"> & Named & {
|
|
15
|
+
/** Lay the buttons out in a row (default) or a column. */
|
|
16
|
+
orientation?: "horizontal" | "vertical";
|
|
17
|
+
/** Join the buttons into one control (default), or keep them apart with a gap. */
|
|
18
|
+
attached?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A named group of related buttons, visually joined. It is only a grouping: Tab still visits every
|
|
22
|
+
* button. For a group that behaves as one control with arrow keys and a pressed state, use
|
|
23
|
+
* `ToggleGroup`. Server-safe.
|
|
24
|
+
*/
|
|
25
|
+
declare const ButtonGroup: react.ForwardRefExoticComponent<ButtonGroupProps & react.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
|
|
27
|
+
declare const SQUARE: {
|
|
28
|
+
readonly sm: "size-8";
|
|
29
|
+
readonly md: "";
|
|
30
|
+
readonly lg: "size-11";
|
|
31
|
+
};
|
|
32
|
+
interface IconButtonProps extends Omit<ButtonProps, "className" | "children" | "aria-label" | "aria-labelledby"> {
|
|
33
|
+
/**
|
|
34
|
+
* The icon, as an element: `<Icon icon={Plus} />`. An element, not a component, so the button can be
|
|
35
|
+
* used from a Server Component (a function cannot be passed across that boundary).
|
|
36
|
+
*/
|
|
37
|
+
icon: ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* What the button does, as text: "Add item", "Close". It is the accessible name, and it is
|
|
40
|
+
* required because an icon alone cannot be announced.
|
|
41
|
+
*/
|
|
42
|
+
label: string;
|
|
43
|
+
/** Default `ghost`, so a row of icon buttons is quiet. */
|
|
44
|
+
variant?: ButtonOwnProps["variant"];
|
|
45
|
+
/** A square size. `md` follows the density token. Default `md`. */
|
|
46
|
+
size?: keyof typeof SQUARE;
|
|
47
|
+
/** Replace the icon with a spinner, mark the button busy and ignore activation. It stays focusable. */
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
/** A square button with only an icon. The label is required and becomes its `aria-label`. */
|
|
52
|
+
declare const IconButton: react.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
53
|
+
|
|
54
|
+
export { ButtonGroup, type ButtonGroupProps, ButtonOwnProps, IconButton, type IconButtonProps };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chunk-NIIDYIZA.js";
|
|
3
|
+
import {
|
|
4
|
+
IconButton
|
|
5
|
+
} from "./chunk-CZJZYN54.js";
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
buttonVariants
|
|
9
|
+
} from "./chunk-C2HKIPLQ.js";
|
|
10
|
+
import {
|
|
11
|
+
ButtonGroup
|
|
12
|
+
} from "./chunk-EE4V6XMB.js";
|
|
13
|
+
import "./chunk-2TQSHVXA.js";
|
|
14
|
+
export {
|
|
15
|
+
Button,
|
|
16
|
+
ButtonGroup,
|
|
17
|
+
IconButton,
|
|
18
|
+
buttonVariants
|
|
19
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon,
|
|
3
|
+
assertIconEntry,
|
|
4
|
+
warnMissingIcon
|
|
5
|
+
} from "./chunk-Q4PPM2SU.js";
|
|
6
|
+
|
|
7
|
+
// src/icons/create-icon-set.tsx
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
function createIconSet(icons) {
|
|
11
|
+
for (const [name, component] of Object.entries(icons)) assertIconEntry(name, component);
|
|
12
|
+
const own = Object.freeze({ ...icons });
|
|
13
|
+
const names = Object.freeze(Object.keys(own));
|
|
14
|
+
const SetIcon = forwardRef(function SetIcon2({ name, ...props }, ref) {
|
|
15
|
+
const icon = Object.hasOwn(own, name) ? own[name] : void 0;
|
|
16
|
+
if (!icon) {
|
|
17
|
+
warnMissingIcon(name);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(Icon, { ref, icon, ...props });
|
|
21
|
+
});
|
|
22
|
+
return { Icon: SetIcon, names };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
createIconSet
|
|
27
|
+
};
|
|
@@ -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
|
+
};
|