@ngrok/mantle 0.0.1-alpha.13 → 0.0.1-alpha.2
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/dist/back-to-top-button/index.js +22 -0
- package/dist/button/index.js +58 -0
- package/dist/card/index.js +33 -0
- package/dist/{dts → core}/tailwind.preset.d.ts +2 -3
- package/dist/core/tailwind.preset.js +299 -0
- package/dist/cx/index.js +10 -0
- package/dist/dropdown-menu/index.js +32 -0
- package/dist/hooks/use-matches-media-query.js +21 -0
- package/dist/hooks/use-prefers-reduced-motion.js +28 -0
- package/dist/{dts/input → input}/index.d.ts +1 -1
- package/dist/input/index.js +24 -0
- package/dist/{dts/media-object → media-object}/index.d.ts +5 -4
- package/dist/media-object/index.js +27 -0
- package/dist/portal/index.js +3 -0
- package/dist/select/index.js +22 -0
- package/dist/{dts/theme-provider → theme-provider}/index.d.ts +9 -10
- package/dist/theme-provider/index.js +143 -0
- package/dist/tooltip/index.js +10 -0
- package/dist/types/as-child.js +1 -0
- package/dist/types/deep-non-nullable.js +1 -0
- package/dist/types/input.js +1 -0
- package/dist/types/variant-props.js +1 -0
- package/dist/types/with-style-props.js +1 -0
- package/package.json +3 -21
- package/dist/assets/fonts/euclid-square/swisstypefaces-EULA.pdf +0 -0
- package/dist/dts/index.d.ts +0 -15
- package/dist/index.d.ts +0 -256
- package/dist/index.js +0 -546
- package/dist/tailwind.preset.d.ts +0 -309
- package/dist/tailwind.preset.js +0 -320
- /package/dist/{dts/back-to-top-button → back-to-top-button}/index.d.ts +0 -0
- /package/dist/{dts/button → button}/index.d.ts +0 -0
- /package/dist/{dts/card → card}/index.d.ts +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-Bold-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-BoldItalic-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-Light-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-LightItalic-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-Medium-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-MediumItalic-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-Regular-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-RegularItalic-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-Semibold-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/euclid-square/EuclidSquare-SemiboldItalic-WebS.woff +0 -0
- /package/dist/{assets → core}/fonts/fonts.css +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Bold.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-BoldItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-ExtraLight.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-ExtraLightItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Italic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Light.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-LightItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Medium.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-MediumItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Regular.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-SemiBold.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-SemiBoldItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Text.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-TextItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-Thin.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/IBMPlexMono-ThinItalic.woff +0 -0
- /package/dist/{assets → core}/fonts/ibm-plex-mono/license.txt +0 -0
- /package/dist/{assets → core}/mantle.css +0 -0
- /package/dist/{dts/cx → cx}/index.d.ts +0 -0
- /package/dist/{dts/dropdown-menu → dropdown-menu}/index.d.ts +0 -0
- /package/dist/{dts/hooks → hooks}/use-matches-media-query.d.ts +0 -0
- /package/dist/{dts/hooks → hooks}/use-prefers-reduced-motion.d.ts +0 -0
- /package/dist/{dts/portal → portal}/index.d.ts +0 -0
- /package/dist/{dts/select → select}/index.d.ts +0 -0
- /package/dist/{dts/tooltip → tooltip}/index.d.ts +0 -0
- /package/dist/{dts/types → types}/as-child.d.ts +0 -0
- /package/dist/{dts/types → types}/deep-non-nullable.d.ts +0 -0
- /package/dist/{dts/input/types.d.ts → types/input.d.ts} +0 -0
- /package/dist/{dts/types → types}/variant-props.d.ts +0 -0
- /package/dist/{dts/types → types}/with-style-props.d.ts +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { usePrefersReducedMotion } from "../hooks/use-prefers-reduced-motion";
|
|
3
|
+
import { useWindowScroll } from "@uidotdev/usehooks";
|
|
4
|
+
import { useRef, useEffect } from "react";
|
|
5
|
+
import { Portal } from "../portal";
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../tooltip";
|
|
7
|
+
import { ArrowUpToLine } from "lucide-react";
|
|
8
|
+
import { cx } from "../cx";
|
|
9
|
+
export const BackToTopButton = ({ className, showThresholdPx = 200, style }) => {
|
|
10
|
+
const [position = { y: 0 }, scrollTo] = useWindowScroll();
|
|
11
|
+
const prefersReducedMotion = usePrefersReducedMotion();
|
|
12
|
+
const bodyRef = useRef(undefined);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
bodyRef.current = document.body;
|
|
15
|
+
}, []);
|
|
16
|
+
return (_jsx(Portal, { container: bodyRef.current, children: _jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsxs(TooltipTrigger, { className: cx("fixed bottom-4 right-4 z-50 flex h-10 w-10 cursor-pointer items-center justify-center rounded-full bg-blue-500 text-gray-900 transition-all duration-150 ease-in-out hover:bg-white/90 hover:shadow-lg", (position.y ?? 0) >= showThresholdPx ? "visible opacity-100" : "invisible opacity-0", className), onClick: () => {
|
|
17
|
+
scrollTo({
|
|
18
|
+
top: 0,
|
|
19
|
+
behavior: prefersReducedMotion ? "auto" : "smooth",
|
|
20
|
+
});
|
|
21
|
+
}, style: style, tabIndex: -1, children: [_jsx("span", { className: "sr-only", children: "Scroll back to top" }), _jsx(ArrowUpToLine, {})] }), _jsx(TooltipContent, { collisionPadding: 8, children: _jsx("p", { children: "Scroll back to top" }) })] }) }) }));
|
|
22
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cx } from "../cx";
|
|
6
|
+
const buttonVariants = cva("inline-flex items-center justify-center rounded-md font-medium border transition-colors focus-visible:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50", {
|
|
7
|
+
variants: {
|
|
8
|
+
priority: {
|
|
9
|
+
default: "border-blue-500 text-blue-500 bg-white hover:bg-blue-50 active:bg-blue-100 focus-visible:ring-blue-600/25",
|
|
10
|
+
primary: "bg-blue-500 text-button hover:bg-blue-600 active:bg-blue-700 focus-visible:ring-blue-600/25",
|
|
11
|
+
secondary: "bg-blue-50 border-blue-200 text-blue-900 hover:bg-blue-100 active:bg-blue-200 focus-visible:ring-blue-600/25",
|
|
12
|
+
},
|
|
13
|
+
state: {
|
|
14
|
+
default: "",
|
|
15
|
+
danger: "",
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
default: "h-10 px-4 py-2",
|
|
19
|
+
sm: "h-9 rounded-md px-3 text-sm",
|
|
20
|
+
lg: "h-12 rounded-md px-6 text-lg",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
defaultVariants: {
|
|
24
|
+
priority: "default",
|
|
25
|
+
size: "default",
|
|
26
|
+
},
|
|
27
|
+
compoundVariants: [
|
|
28
|
+
{
|
|
29
|
+
priority: "default",
|
|
30
|
+
state: "danger",
|
|
31
|
+
class: "border-red-500 text-red-500 hover:bg-red-50 active:bg-red-100 focus-visible:ring-red-600/25",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
priority: "primary",
|
|
35
|
+
state: "danger",
|
|
36
|
+
class: "bg-red-500 hover:bg-red-600 active:bg-red-700 focus-visible:ring-red-600/25",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
priority: "secondary",
|
|
40
|
+
state: "danger",
|
|
41
|
+
class: "bg-red-50 border-red-200 text-red-900 hover:bg-red-100 active:bg-red-200 focus-visible:ring-red-600/25",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Renders a button or a component that looks like a button, an interactive
|
|
47
|
+
* element activated by a user with a mouse, keyboard, finger, voice command, or
|
|
48
|
+
* other assistive technology. Once activated, it then performs an action, such
|
|
49
|
+
* as submitting a form or opening a dialog.
|
|
50
|
+
*
|
|
51
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
|
|
52
|
+
*/
|
|
53
|
+
const Button = forwardRef(({ className, priority = "default", size = "default", state = "default", asChild = false, ...props }, ref) => {
|
|
54
|
+
const Comp = asChild ? Slot : "button";
|
|
55
|
+
return _jsx(Comp, { className: cx(buttonVariants({ priority, size, state, className })), ref: ref, ...props });
|
|
56
|
+
});
|
|
57
|
+
Button.displayName = "Button";
|
|
58
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cx } from "../cx";
|
|
5
|
+
/**
|
|
6
|
+
* A container that can be used to display content in a box resembling a playing
|
|
7
|
+
* card.
|
|
8
|
+
*/
|
|
9
|
+
export const Card = forwardRef(({ className, children, ...rest }, ref) => (_jsx("div", { ref: ref, className: cx("relative rounded border bg-white", className), ...rest, children: children })));
|
|
10
|
+
Card.displayName = "Card";
|
|
11
|
+
/**
|
|
12
|
+
* The main content of a card. Usually composed as a direct child of a `Card` component.
|
|
13
|
+
*/
|
|
14
|
+
export const CardBody = forwardRef(({ className, children, ...rest }, ref) => (_jsx("div", { ref: ref, className: cx("p-6", className), ...rest, children: children })));
|
|
15
|
+
CardBody.displayName = "CardBody";
|
|
16
|
+
/**
|
|
17
|
+
* The footer container of a card. Usually composed as a direct child of a `Card` component.
|
|
18
|
+
*/
|
|
19
|
+
export const CardFooter = forwardRef(({ className, children, ...rest }, ref) => (_jsx("div", { ref: ref, className: cx("border-t px-6 py-3", className), ...rest, children: children })));
|
|
20
|
+
CardFooter.displayName = "CardFooter";
|
|
21
|
+
/**
|
|
22
|
+
* The header container of a card. Usually composed as a direct child of a `Card` component.
|
|
23
|
+
*/
|
|
24
|
+
export const CardHeader = forwardRef(({ className, children, ...rest }, ref) => (_jsx("div", { ref: ref, className: cx("border-b px-6 py-3", className), ...rest, children: children })));
|
|
25
|
+
CardHeader.displayName = "CardHeader";
|
|
26
|
+
/**
|
|
27
|
+
* The title of a card. Usually composed as a direct child of a `CardHeader` component.
|
|
28
|
+
*/
|
|
29
|
+
export const CardTitle = forwardRef(({ className, asChild, ...props }, ref) => {
|
|
30
|
+
const Comp = asChild ? Slot : "h3";
|
|
31
|
+
return _jsx(Comp, { ref: ref, className: cx("font-semibold leading-none tracking-tight", className), ...props });
|
|
32
|
+
});
|
|
33
|
+
CardTitle.displayName = "CardTitle";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const _default: {
|
|
2
2
|
content: never[];
|
|
3
3
|
darkMode: "class";
|
|
4
4
|
theme: {
|
|
@@ -305,5 +305,4 @@ declare const preset: {
|
|
|
305
305
|
handler: () => void;
|
|
306
306
|
}[];
|
|
307
307
|
};
|
|
308
|
-
export
|
|
309
|
-
export default preset;
|
|
308
|
+
export default _default;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import defaultTheme from "tailwindcss/defaultTheme";
|
|
2
|
+
import tailwindCssAnimatePlugin from "tailwindcss-animate";
|
|
3
|
+
export default {
|
|
4
|
+
content: [],
|
|
5
|
+
darkMode: "class",
|
|
6
|
+
theme: {
|
|
7
|
+
container: {
|
|
8
|
+
center: true,
|
|
9
|
+
padding: "2rem",
|
|
10
|
+
screens: {
|
|
11
|
+
"2xl": "1400px",
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
extend: {
|
|
15
|
+
fontFamily: {
|
|
16
|
+
sans: ["EuclidSquare", ...defaultTheme.fontFamily.sans],
|
|
17
|
+
mono: ["IBMPlexMono", ...defaultTheme.fontFamily.mono],
|
|
18
|
+
},
|
|
19
|
+
colors: {
|
|
20
|
+
white: "hsl(var(--white) / <alpha-value>)",
|
|
21
|
+
gray: {
|
|
22
|
+
50: "hsl(var(--gray-050) / <alpha-value>)",
|
|
23
|
+
100: "hsl(var(--gray-100) / <alpha-value>)",
|
|
24
|
+
200: "hsl(var(--gray-200) / <alpha-value>)",
|
|
25
|
+
300: "hsl(var(--gray-300) / <alpha-value>)",
|
|
26
|
+
400: "hsl(var(--gray-400) / <alpha-value>)",
|
|
27
|
+
500: "hsl(var(--gray-500) / <alpha-value>)",
|
|
28
|
+
600: "hsl(var(--gray-600) / <alpha-value>)",
|
|
29
|
+
700: "hsl(var(--gray-700) / <alpha-value>)",
|
|
30
|
+
800: "hsl(var(--gray-800) / <alpha-value>)",
|
|
31
|
+
900: "hsl(var(--gray-900) / <alpha-value>)",
|
|
32
|
+
950: "hsl(var(--gray-950) / <alpha-value>)",
|
|
33
|
+
},
|
|
34
|
+
red: {
|
|
35
|
+
50: "hsl(var(--red-050) / <alpha-value>)",
|
|
36
|
+
100: "hsl(var(--red-100) / <alpha-value>)",
|
|
37
|
+
200: "hsl(var(--red-200) / <alpha-value>)",
|
|
38
|
+
300: "hsl(var(--red-300) / <alpha-value>)",
|
|
39
|
+
400: "hsl(var(--red-400) / <alpha-value>)",
|
|
40
|
+
500: "hsl(var(--red-500) / <alpha-value>)",
|
|
41
|
+
600: "hsl(var(--red-600) / <alpha-value>)",
|
|
42
|
+
700: "hsl(var(--red-700) / <alpha-value>)",
|
|
43
|
+
800: "hsl(var(--red-800) / <alpha-value>)",
|
|
44
|
+
900: "hsl(var(--red-900) / <alpha-value>)",
|
|
45
|
+
950: "hsl(var(--red-950) / <alpha-value>)",
|
|
46
|
+
},
|
|
47
|
+
orange: {
|
|
48
|
+
50: "hsl(var(--orange-050) / <alpha-value>)",
|
|
49
|
+
100: "hsl(var(--orange-100) / <alpha-value>)",
|
|
50
|
+
200: "hsl(var(--orange-200) / <alpha-value>)",
|
|
51
|
+
300: "hsl(var(--orange-300) / <alpha-value>)",
|
|
52
|
+
400: "hsl(var(--orange-400) / <alpha-value>)",
|
|
53
|
+
500: "hsl(var(--orange-500) / <alpha-value>)",
|
|
54
|
+
600: "hsl(var(--orange-600) / <alpha-value>)",
|
|
55
|
+
700: "hsl(var(--orange-700) / <alpha-value>)",
|
|
56
|
+
800: "hsl(var(--orange-800) / <alpha-value>)",
|
|
57
|
+
900: "hsl(var(--orange-900) / <alpha-value>)",
|
|
58
|
+
950: "hsl(var(--orange-950) / <alpha-value>)",
|
|
59
|
+
},
|
|
60
|
+
amber: {
|
|
61
|
+
50: "hsl(var(--amber-050) / <alpha-value>)",
|
|
62
|
+
100: "hsl(var(--amber-100) / <alpha-value>)",
|
|
63
|
+
200: "hsl(var(--amber-200) / <alpha-value>)",
|
|
64
|
+
300: "hsl(var(--amber-300) / <alpha-value>)",
|
|
65
|
+
400: "hsl(var(--amber-400) / <alpha-value>)",
|
|
66
|
+
500: "hsl(var(--amber-500) / <alpha-value>)",
|
|
67
|
+
600: "hsl(var(--amber-600) / <alpha-value>)",
|
|
68
|
+
700: "hsl(var(--amber-700) / <alpha-value>)",
|
|
69
|
+
800: "hsl(var(--amber-800) / <alpha-value>)",
|
|
70
|
+
900: "hsl(var(--amber-900) / <alpha-value>)",
|
|
71
|
+
950: "hsl(var(--amber-950) / <alpha-value>)",
|
|
72
|
+
},
|
|
73
|
+
yellow: {
|
|
74
|
+
50: "hsl(var(--yellow-050) / <alpha-value>)",
|
|
75
|
+
100: "hsl(var(--yellow-100) / <alpha-value>)",
|
|
76
|
+
200: "hsl(var(--yellow-200) / <alpha-value>)",
|
|
77
|
+
300: "hsl(var(--yellow-300) / <alpha-value>)",
|
|
78
|
+
400: "hsl(var(--yellow-400) / <alpha-value>)",
|
|
79
|
+
500: "hsl(var(--yellow-500) / <alpha-value>)",
|
|
80
|
+
600: "hsl(var(--yellow-600) / <alpha-value>)",
|
|
81
|
+
700: "hsl(var(--yellow-700) / <alpha-value>)",
|
|
82
|
+
800: "hsl(var(--yellow-800) / <alpha-value>)",
|
|
83
|
+
900: "hsl(var(--yellow-900) / <alpha-value>)",
|
|
84
|
+
950: "hsl(var(--yellow-950) / <alpha-value>)",
|
|
85
|
+
},
|
|
86
|
+
lime: {
|
|
87
|
+
50: "hsl(var(--lime-050) / <alpha-value>)",
|
|
88
|
+
100: "hsl(var(--lime-100) / <alpha-value>)",
|
|
89
|
+
200: "hsl(var(--lime-200) / <alpha-value>)",
|
|
90
|
+
300: "hsl(var(--lime-300) / <alpha-value>)",
|
|
91
|
+
400: "hsl(var(--lime-400) / <alpha-value>)",
|
|
92
|
+
500: "hsl(var(--lime-500) / <alpha-value>)",
|
|
93
|
+
600: "hsl(var(--lime-600) / <alpha-value>)",
|
|
94
|
+
700: "hsl(var(--lime-700) / <alpha-value>)",
|
|
95
|
+
800: "hsl(var(--lime-800) / <alpha-value>)",
|
|
96
|
+
900: "hsl(var(--lime-900) / <alpha-value>)",
|
|
97
|
+
950: "hsl(var(--lime-950) / <alpha-value>)",
|
|
98
|
+
},
|
|
99
|
+
green: {
|
|
100
|
+
50: "hsl(var(--green-050) / <alpha-value>)",
|
|
101
|
+
100: "hsl(var(--green-100) / <alpha-value>)",
|
|
102
|
+
200: "hsl(var(--green-200) / <alpha-value>)",
|
|
103
|
+
300: "hsl(var(--green-300) / <alpha-value>)",
|
|
104
|
+
400: "hsl(var(--green-400) / <alpha-value>)",
|
|
105
|
+
500: "hsl(var(--green-500) / <alpha-value>)",
|
|
106
|
+
600: "hsl(var(--green-600) / <alpha-value>)",
|
|
107
|
+
700: "hsl(var(--green-700) / <alpha-value>)",
|
|
108
|
+
800: "hsl(var(--green-800) / <alpha-value>)",
|
|
109
|
+
900: "hsl(var(--green-900) / <alpha-value>)",
|
|
110
|
+
950: "hsl(var(--green-950) / <alpha-value>)",
|
|
111
|
+
},
|
|
112
|
+
teal: {
|
|
113
|
+
50: "hsl(var(--teal-050) / <alpha-value>)",
|
|
114
|
+
100: "hsl(var(--teal-100) / <alpha-value>)",
|
|
115
|
+
200: "hsl(var(--teal-200) / <alpha-value>)",
|
|
116
|
+
300: "hsl(var(--teal-300) / <alpha-value>)",
|
|
117
|
+
400: "hsl(var(--teal-400) / <alpha-value>)",
|
|
118
|
+
500: "hsl(var(--teal-500) / <alpha-value>)",
|
|
119
|
+
600: "hsl(var(--teal-600) / <alpha-value>)",
|
|
120
|
+
700: "hsl(var(--teal-700) / <alpha-value>)",
|
|
121
|
+
800: "hsl(var(--teal-800) / <alpha-value>)",
|
|
122
|
+
900: "hsl(var(--teal-900) / <alpha-value>)",
|
|
123
|
+
950: "hsl(var(--teal-950) / <alpha-value>)",
|
|
124
|
+
},
|
|
125
|
+
cyan: {
|
|
126
|
+
50: "hsl(var(--cyan-050) / <alpha-value>)",
|
|
127
|
+
100: "hsl(var(--cyan-100) / <alpha-value>)",
|
|
128
|
+
200: "hsl(var(--cyan-200) / <alpha-value>)",
|
|
129
|
+
300: "hsl(var(--cyan-300) / <alpha-value>)",
|
|
130
|
+
400: "hsl(var(--cyan-400) / <alpha-value>)",
|
|
131
|
+
500: "hsl(var(--cyan-500) / <alpha-value>)",
|
|
132
|
+
600: "hsl(var(--cyan-600) / <alpha-value>)",
|
|
133
|
+
700: "hsl(var(--cyan-700) / <alpha-value>)",
|
|
134
|
+
800: "hsl(var(--cyan-800) / <alpha-value>)",
|
|
135
|
+
900: "hsl(var(--cyan-900) / <alpha-value>)",
|
|
136
|
+
950: "hsl(var(--cyan-950) / <alpha-value>)",
|
|
137
|
+
},
|
|
138
|
+
sky: {
|
|
139
|
+
50: "hsl(var(--sky-050) / <alpha-value>)",
|
|
140
|
+
100: "hsl(var(--sky-100) / <alpha-value>)",
|
|
141
|
+
200: "hsl(var(--sky-200) / <alpha-value>)",
|
|
142
|
+
300: "hsl(var(--sky-300) / <alpha-value>)",
|
|
143
|
+
400: "hsl(var(--sky-400) / <alpha-value>)",
|
|
144
|
+
500: "hsl(var(--sky-500) / <alpha-value>)",
|
|
145
|
+
600: "hsl(var(--sky-600) / <alpha-value>)",
|
|
146
|
+
700: "hsl(var(--sky-700) / <alpha-value>)",
|
|
147
|
+
800: "hsl(var(--sky-800) / <alpha-value>)",
|
|
148
|
+
900: "hsl(var(--sky-900) / <alpha-value>)",
|
|
149
|
+
950: "hsl(var(--sky-950) / <alpha-value>)",
|
|
150
|
+
},
|
|
151
|
+
blue: {
|
|
152
|
+
50: "hsl(var(--blue-050) / <alpha-value>)",
|
|
153
|
+
100: "hsl(var(--blue-100) / <alpha-value>)",
|
|
154
|
+
200: "hsl(var(--blue-200) / <alpha-value>)",
|
|
155
|
+
300: "hsl(var(--blue-300) / <alpha-value>)",
|
|
156
|
+
400: "hsl(var(--blue-400) / <alpha-value>)",
|
|
157
|
+
500: "hsl(var(--blue-500) / <alpha-value>)",
|
|
158
|
+
600: "hsl(var(--blue-600) / <alpha-value>)",
|
|
159
|
+
700: "hsl(var(--blue-700) / <alpha-value>)",
|
|
160
|
+
800: "hsl(var(--blue-800) / <alpha-value>)",
|
|
161
|
+
900: "hsl(var(--blue-900) / <alpha-value>)",
|
|
162
|
+
950: "hsl(var(--blue-950) / <alpha-value>)",
|
|
163
|
+
},
|
|
164
|
+
indigo: {
|
|
165
|
+
50: "hsl(var(--indigo-050) / <alpha-value>)",
|
|
166
|
+
100: "hsl(var(--indigo-100) / <alpha-value>)",
|
|
167
|
+
200: "hsl(var(--indigo-200) / <alpha-value>)",
|
|
168
|
+
300: "hsl(var(--indigo-300) / <alpha-value>)",
|
|
169
|
+
400: "hsl(var(--indigo-400) / <alpha-value>)",
|
|
170
|
+
500: "hsl(var(--indigo-500) / <alpha-value>)",
|
|
171
|
+
600: "hsl(var(--indigo-600) / <alpha-value>)",
|
|
172
|
+
700: "hsl(var(--indigo-700) / <alpha-value>)",
|
|
173
|
+
800: "hsl(var(--indigo-800) / <alpha-value>)",
|
|
174
|
+
900: "hsl(var(--indigo-900) / <alpha-value>)",
|
|
175
|
+
950: "hsl(var(--indigo-950) / <alpha-value>)",
|
|
176
|
+
},
|
|
177
|
+
violet: {
|
|
178
|
+
50: "hsl(var(--violet-050) / <alpha-value>)",
|
|
179
|
+
100: "hsl(var(--violet-100) / <alpha-value>)",
|
|
180
|
+
200: "hsl(var(--violet-200) / <alpha-value>)",
|
|
181
|
+
300: "hsl(var(--violet-300) / <alpha-value>)",
|
|
182
|
+
400: "hsl(var(--violet-400) / <alpha-value>)",
|
|
183
|
+
500: "hsl(var(--violet-500) / <alpha-value>)",
|
|
184
|
+
600: "hsl(var(--violet-600) / <alpha-value>)",
|
|
185
|
+
700: "hsl(var(--violet-700) / <alpha-value>)",
|
|
186
|
+
800: "hsl(var(--violet-800) / <alpha-value>)",
|
|
187
|
+
900: "hsl(var(--violet-900) / <alpha-value>)",
|
|
188
|
+
950: "hsl(var(--violet-950) / <alpha-value>)",
|
|
189
|
+
},
|
|
190
|
+
purple: {
|
|
191
|
+
50: "hsl(var(--purple-050) / <alpha-value>)",
|
|
192
|
+
100: "hsl(var(--purple-100) / <alpha-value>)",
|
|
193
|
+
200: "hsl(var(--purple-200) / <alpha-value>)",
|
|
194
|
+
300: "hsl(var(--purple-300) / <alpha-value>)",
|
|
195
|
+
400: "hsl(var(--purple-400) / <alpha-value>)",
|
|
196
|
+
500: "hsl(var(--purple-500) / <alpha-value>)",
|
|
197
|
+
600: "hsl(var(--purple-600) / <alpha-value>)",
|
|
198
|
+
700: "hsl(var(--purple-700) / <alpha-value>)",
|
|
199
|
+
800: "hsl(var(--purple-800) / <alpha-value>)",
|
|
200
|
+
900: "hsl(var(--purple-900) / <alpha-value>)",
|
|
201
|
+
950: "hsl(var(--purple-950) / <alpha-value>)",
|
|
202
|
+
},
|
|
203
|
+
fuchsia: {
|
|
204
|
+
50: "hsl(var(--fuchsia-050) / <alpha-value>)",
|
|
205
|
+
100: "hsl(var(--fuchsia-100) / <alpha-value>)",
|
|
206
|
+
200: "hsl(var(--fuchsia-200) / <alpha-value>)",
|
|
207
|
+
300: "hsl(var(--fuchsia-300) / <alpha-value>)",
|
|
208
|
+
400: "hsl(var(--fuchsia-400) / <alpha-value>)",
|
|
209
|
+
500: "hsl(var(--fuchsia-500) / <alpha-value>)",
|
|
210
|
+
600: "hsl(var(--fuchsia-600) / <alpha-value>)",
|
|
211
|
+
700: "hsl(var(--fuchsia-700) / <alpha-value>)",
|
|
212
|
+
800: "hsl(var(--fuchsia-800) / <alpha-value>)",
|
|
213
|
+
900: "hsl(var(--fuchsia-900) / <alpha-value>)",
|
|
214
|
+
950: "hsl(var(--fuchsia-950) / <alpha-value>)",
|
|
215
|
+
},
|
|
216
|
+
pink: {
|
|
217
|
+
50: "hsl(var(--pink-050) / <alpha-value>)",
|
|
218
|
+
100: "hsl(var(--pink-100) / <alpha-value>)",
|
|
219
|
+
200: "hsl(var(--pink-200) / <alpha-value>)",
|
|
220
|
+
300: "hsl(var(--pink-300) / <alpha-value>)",
|
|
221
|
+
400: "hsl(var(--pink-400) / <alpha-value>)",
|
|
222
|
+
500: "hsl(var(--pink-500) / <alpha-value>)",
|
|
223
|
+
600: "hsl(var(--pink-600) / <alpha-value>)",
|
|
224
|
+
700: "hsl(var(--pink-700) / <alpha-value>)",
|
|
225
|
+
800: "hsl(var(--pink-800) / <alpha-value>)",
|
|
226
|
+
900: "hsl(var(--pink-900) / <alpha-value>)",
|
|
227
|
+
950: "hsl(var(--pink-950) / <alpha-value>)",
|
|
228
|
+
},
|
|
229
|
+
rose: {
|
|
230
|
+
50: "hsl(var(--rose-050) / <alpha-value>)",
|
|
231
|
+
100: "hsl(var(--rose-100) / <alpha-value>)",
|
|
232
|
+
200: "hsl(var(--rose-200) / <alpha-value>)",
|
|
233
|
+
300: "hsl(var(--rose-300) / <alpha-value>)",
|
|
234
|
+
400: "hsl(var(--rose-400) / <alpha-value>)",
|
|
235
|
+
500: "hsl(var(--rose-500) / <alpha-value>)",
|
|
236
|
+
600: "hsl(var(--rose-600) / <alpha-value>)",
|
|
237
|
+
700: "hsl(var(--rose-700) / <alpha-value>)",
|
|
238
|
+
800: "hsl(var(--rose-800) / <alpha-value>)",
|
|
239
|
+
900: "hsl(var(--rose-900) / <alpha-value>)",
|
|
240
|
+
950: "hsl(var(--rose-950) / <alpha-value>)",
|
|
241
|
+
},
|
|
242
|
+
button: "hsl(var(--button))",
|
|
243
|
+
border: "hsl(var(--border))",
|
|
244
|
+
input: "hsl(var(--input))",
|
|
245
|
+
ring: "hsl(var(--ring))",
|
|
246
|
+
background: "hsl(var(--background))",
|
|
247
|
+
foreground: "hsl(var(--foreground))",
|
|
248
|
+
primary: {
|
|
249
|
+
DEFAULT: "hsl(var(--primary))",
|
|
250
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
251
|
+
},
|
|
252
|
+
secondary: {
|
|
253
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
254
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
255
|
+
},
|
|
256
|
+
destructive: {
|
|
257
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
258
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
259
|
+
},
|
|
260
|
+
muted: {
|
|
261
|
+
DEFAULT: "hsl(var(--muted))",
|
|
262
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
263
|
+
},
|
|
264
|
+
accent: {
|
|
265
|
+
DEFAULT: "hsl(var(--accent))",
|
|
266
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
267
|
+
},
|
|
268
|
+
popover: {
|
|
269
|
+
DEFAULT: "hsl(var(--popover))",
|
|
270
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
271
|
+
},
|
|
272
|
+
card: {
|
|
273
|
+
DEFAULT: "hsl(var(--card))",
|
|
274
|
+
foreground: "hsl(var(--card-foreground))",
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
borderRadius: {
|
|
278
|
+
lg: "var(--radius)",
|
|
279
|
+
md: "calc(var(--radius) - 2px)",
|
|
280
|
+
sm: "calc(var(--radius) - 4px)",
|
|
281
|
+
},
|
|
282
|
+
keyframes: {
|
|
283
|
+
"accordion-down": {
|
|
284
|
+
from: { height: "0" },
|
|
285
|
+
to: { height: "var(--radix-accordion-content-height)" },
|
|
286
|
+
},
|
|
287
|
+
"accordion-up": {
|
|
288
|
+
from: { height: "var(--radix-accordion-content-height)" },
|
|
289
|
+
to: { height: "0" },
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
animation: {
|
|
293
|
+
"accordion-down": "accordion-down 0.2s ease-out",
|
|
294
|
+
"accordion-up": "accordion-up 0.2s ease-out",
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
plugins: [tailwindCssAnimatePlugin],
|
|
299
|
+
};
|
package/dist/cx/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
/**
|
|
4
|
+
* Conditionally add Tailwind (and other) CSS classes.
|
|
5
|
+
*
|
|
6
|
+
* Allows for tailwind overrides in LTR-specificity-like order of applied classes.
|
|
7
|
+
*/
|
|
8
|
+
export function cx(...inputs) {
|
|
9
|
+
return twMerge(clsx(inputs));
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
import { Check, ChevronRight, Circle } from "lucide-react";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
import { cx } from "../cx";
|
|
6
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
9
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
10
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
11
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
12
|
+
const DropdownMenuSubTrigger = forwardRef(({ className, inset, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cx("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] })));
|
|
13
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
14
|
+
const DropdownMenuSubContent = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.SubContent, { ref: ref, className: cx("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-white p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props })));
|
|
15
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
16
|
+
const DropdownMenuContent = forwardRef(({ className, sideOffset = 4, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { ref: ref, sideOffset: sideOffset, className: cx("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className), ...props }) })));
|
|
17
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
18
|
+
const DropdownMenuItem = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Item, { ref: ref, className: cx("relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className), ...props })));
|
|
19
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
20
|
+
const DropdownMenuCheckboxItem = forwardRef(({ className, children, checked, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cx("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), checked: checked, ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), children] })));
|
|
21
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
22
|
+
const DropdownMenuRadioItem = forwardRef(({ className, children, ...props }, ref) => (_jsxs(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cx("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(Circle, { className: "h-2 w-2 fill-current" }) }) }), children] })));
|
|
23
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
24
|
+
const DropdownMenuLabel = forwardRef(({ className, inset, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Label, { ref: ref, className: cx("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })));
|
|
25
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
26
|
+
const DropdownMenuSeparator = forwardRef(({ className, ...props }, ref) => (_jsx(DropdownMenuPrimitive.Separator, { ref: ref, className: cx("-mx-1 my-1 h-px bg-muted", className), ...props })));
|
|
27
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
28
|
+
const DropdownMenuShortcut = ({ className, ...props }) => {
|
|
29
|
+
return _jsx("span", { className: cx("ml-auto text-xs tracking-widest opacity-60", className), ...props });
|
|
30
|
+
};
|
|
31
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
32
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
export function useMatchesMediaQuery(mediaQuery) {
|
|
3
|
+
const [matches, setMatches] = useState(() => mediaQuery.matches);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
function onChange() {
|
|
6
|
+
setMatches(mediaQuery.matches);
|
|
7
|
+
}
|
|
8
|
+
if (typeof mediaQuery.addEventListener === "undefined") {
|
|
9
|
+
// fix for Safari < 14.x
|
|
10
|
+
mediaQuery.addListener(onChange);
|
|
11
|
+
return () => {
|
|
12
|
+
mediaQuery.removeListener(onChange);
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
mediaQuery.addEventListener("change", onChange);
|
|
16
|
+
return () => {
|
|
17
|
+
mediaQuery.removeEventListener("change", onChange);
|
|
18
|
+
};
|
|
19
|
+
}, [mediaQuery]);
|
|
20
|
+
return matches;
|
|
21
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* no-preference is the default value for the prefers-reduced-motion media query.
|
|
4
|
+
* Users who have never fiddled with their a11y settings will still see animations
|
|
5
|
+
* (no explicit opt-in required from a user's perspective)
|
|
6
|
+
*/
|
|
7
|
+
const query = "(prefers-reduced-motion: no-preference)";
|
|
8
|
+
/**
|
|
9
|
+
* usePrefersReducedMotion returns true if the user has opted out of animations
|
|
10
|
+
*/
|
|
11
|
+
export function usePrefersReducedMotion() {
|
|
12
|
+
// default to no animations, since we don't know what the user's preference is on the server
|
|
13
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = useState(true);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const mediaQueryList = window.matchMedia(query);
|
|
16
|
+
// set the _real_ initial value now that we're on the client
|
|
17
|
+
setPrefersReducedMotion(!mediaQueryList.matches);
|
|
18
|
+
// register for updates
|
|
19
|
+
function listener(event) {
|
|
20
|
+
setPrefersReducedMotion(!event.matches);
|
|
21
|
+
}
|
|
22
|
+
mediaQueryList.addEventListener("change", listener);
|
|
23
|
+
return () => {
|
|
24
|
+
mediaQueryList.removeEventListener("change", listener);
|
|
25
|
+
};
|
|
26
|
+
}, []);
|
|
27
|
+
return prefersReducedMotion;
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InputHTMLAttributes } from "react";
|
|
2
2
|
import type { VariantProps } from "../types/variant-props";
|
|
3
|
-
import type { AutoComplete, InputType } from "
|
|
3
|
+
import type { AutoComplete, InputType } from "../types/input";
|
|
4
4
|
declare const inputVariants: (props?: ({
|
|
5
5
|
state?: "default" | "danger" | "success" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cx } from "../cx";
|
|
5
|
+
const inputVariants = cva("flex h-10 w-full rounded-md border bg-white px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-4 disabled:cursor-not-allowed disabled:opacity-50", {
|
|
6
|
+
variants: {
|
|
7
|
+
state: {
|
|
8
|
+
default: "text-gray-900 border-gray-300 placeholder:text-gray-400 focus:border-blue-500 focus-visible:ring-blue-600/25",
|
|
9
|
+
danger: "text-red-900 border-red-500 placeholder:text-red-400 focus:border-red-500 focus-visible:ring-red-600/25",
|
|
10
|
+
success: "text-green-900 border-green-500 placeholder:text-green-400 focus:border-green-500 focus-visible:ring-green-600/25",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
state: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
/**
|
|
18
|
+
* Used to create interactive controls for web-based forms in order to accept data from the user
|
|
19
|
+
*/
|
|
20
|
+
const Input = forwardRef(({ className, state = "default", type = "text", ...props }, ref) => {
|
|
21
|
+
return _jsx("input", { className: cx(inputVariants({ state }), className), ref: ref, type: type, ...props });
|
|
22
|
+
});
|
|
23
|
+
Input.displayName = "Input";
|
|
24
|
+
export { Input };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
|
+
type Props = HTMLAttributes<HTMLDivElement>;
|
|
2
3
|
/**
|
|
3
4
|
* The media object is an image/icon (media) to the left, with descriptive
|
|
4
5
|
* content (title and subtitle/description) to the right.
|
|
@@ -11,13 +12,13 @@ import type { HTMLAttributes } from "react";
|
|
|
11
12
|
* Compose the media object with the `MediaObjectMedia` and `MediaObjectContent`
|
|
12
13
|
* components as direct children.
|
|
13
14
|
*/
|
|
14
|
-
declare const MediaObject: import("react").ForwardRefExoticComponent<
|
|
15
|
+
export declare const MediaObject: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
16
|
/**
|
|
16
17
|
* The container for an image or icon to display in the media slot of the media object.
|
|
17
18
|
*/
|
|
18
|
-
declare const MediaObjectMedia: import("react").ForwardRefExoticComponent<
|
|
19
|
+
export declare const MediaObjectMedia: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
20
|
/**
|
|
20
21
|
* The container for the content slot of a media object.
|
|
21
22
|
*/
|
|
22
|
-
declare const MediaObjectContent: import("react").ForwardRefExoticComponent<
|
|
23
|
-
export {
|
|
23
|
+
export declare const MediaObjectContent: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cx } from "../cx";
|
|
4
|
+
/**
|
|
5
|
+
* The media object is an image/icon (media) to the left, with descriptive
|
|
6
|
+
* content (title and subtitle/description) to the right.
|
|
7
|
+
*
|
|
8
|
+
* Change the spacing between the media and content by passing a `gap-*` class.
|
|
9
|
+
* The default gap is `gap-4`.
|
|
10
|
+
*
|
|
11
|
+
* Use flexbox utilities to change the alignment of the media and content.
|
|
12
|
+
*
|
|
13
|
+
* Compose the media object with the `MediaObjectMedia` and `MediaObjectContent`
|
|
14
|
+
* components as direct children.
|
|
15
|
+
*/
|
|
16
|
+
export const MediaObject = forwardRef(({ className, children, style }, ref) => (_jsx("div", { ref: ref, className: cx("flex gap-4", className), style: style, children: children })));
|
|
17
|
+
MediaObject.displayName = "MediaObject";
|
|
18
|
+
/**
|
|
19
|
+
* The container for an image or icon to display in the media slot of the media object.
|
|
20
|
+
*/
|
|
21
|
+
export const MediaObjectMedia = forwardRef(({ className, children, style }, ref) => (_jsx("div", { ref: ref, className: cx("shrink-0 leading-none", className), style: style, children: children })));
|
|
22
|
+
MediaObjectMedia.displayName = "MediaObjectMedia";
|
|
23
|
+
/**
|
|
24
|
+
* The container for the content slot of a media object.
|
|
25
|
+
*/
|
|
26
|
+
export const MediaObjectContent = forwardRef(({ className, children, style }, ref) => (_jsx("div", { ref: ref, className: cx("min-w-0 flex-1", className), style: style, children: children })));
|
|
27
|
+
MediaObjectContent.displayName = "MediaObjectContent";
|