@foundrykit/primitives 2.0.9 → 2.0.10
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/chunk-3NQR7JZR.js +128 -0
- package/dist/chunk-B5YCE3UP.js +57 -0
- package/dist/chunk-F2TEA6ER.js +138 -0
- package/dist/chunk-SIQHWNPH.js +45 -0
- package/dist/components/dialog/index.cjs +182 -0
- package/dist/components/dialog/index.d.cts +38 -0
- package/dist/components/dialog/index.d.ts +38 -0
- package/dist/components/dialog/index.js +25 -0
- package/dist/components/input-group/index.cjs +270 -0
- package/dist/components/input-group/index.d.cts +44 -0
- package/dist/components/input-group/index.d.ts +44 -0
- package/dist/components/input-group/index.js +153 -0
- package/dist/components/sheet/index.cjs +170 -0
- package/dist/components/sheet/index.d.cts +31 -0
- package/dist/components/sheet/index.d.ts +31 -0
- package/dist/components/sheet/index.js +21 -0
- package/dist/components/toggle/index.cjs +81 -0
- package/dist/components/toggle/index.d.cts +26 -0
- package/dist/components/toggle/index.d.ts +26 -0
- package/dist/components/toggle/index.js +9 -0
- package/dist/components/tooltip/index.cjs +95 -0
- package/dist/components/tooltip/index.d.cts +25 -0
- package/dist/components/tooltip/index.d.ts +25 -0
- package/dist/components/tooltip/index.js +13 -0
- package/dist/index.d.cts +11 -105
- package/dist/index.d.ts +11 -105
- package/dist/index.js +93 -399
- package/package.json +200 -8
- package/CHANGELOG.md +0 -230
- package/postcss.config.mjs +0 -6
- package/registry.json +0 -64
- package/src/components/accordion/config.ts +0 -28
- package/src/components/accordion/index.tsx +0 -80
- package/src/components/alert/config.ts +0 -40
- package/src/components/alert/index.tsx +0 -80
- package/src/components/alert-dialog/config.ts +0 -28
- package/src/components/alert-dialog/index.tsx +0 -188
- package/src/components/aspect-ratio/config.ts +0 -27
- package/src/components/aspect-ratio/index.tsx +0 -24
- package/src/components/avatar/config.ts +0 -46
- package/src/components/avatar/index.tsx +0 -67
- package/src/components/badge/config.ts +0 -56
- package/src/components/badge/index.tsx +0 -56
- package/src/components/breadcrumb/config.ts +0 -121
- package/src/components/breadcrumb/index.tsx +0 -127
- package/src/components/button/config.ts +0 -97
- package/src/components/button/index.tsx +0 -86
- package/src/components/button-group/config.ts +0 -39
- package/src/components/button-group/index.tsx +0 -99
- package/src/components/card/config.ts +0 -89
- package/src/components/card/index.tsx +0 -90
- package/src/components/checkbox/config.ts +0 -46
- package/src/components/checkbox/index.tsx +0 -41
- package/src/components/collapsible/config.ts +0 -27
- package/src/components/collapsible/index.tsx +0 -47
- package/src/components/context-menu/config.ts +0 -28
- package/src/components/context-menu/index.tsx +0 -271
- package/src/components/dialog/config.ts +0 -582
- package/src/components/dialog/index.tsx +0 -162
- package/src/components/direction/config.ts +0 -28
- package/src/components/direction/index.tsx +0 -27
- package/src/components/drawer/config.ts +0 -28
- package/src/components/drawer/index.tsx +0 -153
- package/src/components/dropdown/config.ts +0 -262
- package/src/components/dropdown/index.tsx +0 -280
- package/src/components/empty/config.ts +0 -38
- package/src/components/empty/index.tsx +0 -127
- package/src/components/field/config.ts +0 -40
- package/src/components/field/index.tsx +0 -252
- package/src/components/hover-card/config.ts +0 -27
- package/src/components/hover-card/index.tsx +0 -56
- package/src/components/input/config.ts +0 -64
- package/src/components/input/index.tsx +0 -32
- package/src/components/input-group/config.ts +0 -209
- package/src/components/input-group/index.tsx +0 -177
- package/src/components/item/config.ts +0 -52
- package/src/components/item/index.tsx +0 -215
- package/src/components/kbd/config.ts +0 -38
- package/src/components/kbd/index.tsx +0 -40
- package/src/components/label/config.ts +0 -72
- package/src/components/label/index.tsx +0 -32
- package/src/components/menubar/config.ts +0 -28
- package/src/components/menubar/index.tsx +0 -295
- package/src/components/native-select/config.ts +0 -40
- package/src/components/native-select/index.tsx +0 -40
- package/src/components/navigation-menu/config.ts +0 -32
- package/src/components/navigation-menu/index.tsx +0 -188
- package/src/components/popover/config.ts +0 -222
- package/src/components/popover/index.tsx +0 -60
- package/src/components/progress/config.ts +0 -42
- package/src/components/progress/index.tsx +0 -39
- package/src/components/radio-group/config.ts +0 -303
- package/src/components/radio-group/index.tsx +0 -58
- package/src/components/resizable/config.ts +0 -28
- package/src/components/resizable/index.tsx +0 -67
- package/src/components/scroll-area/config.ts +0 -17
- package/src/components/scroll-area/index.tsx +0 -70
- package/src/components/select/config.ts +0 -277
- package/src/components/select/index.tsx +0 -202
- package/src/components/separator/config.ts +0 -63
- package/src/components/separator/index.tsx +0 -38
- package/src/components/sheet/config.ts +0 -16
- package/src/components/sheet/index.tsx +0 -153
- package/src/components/skeleton/config.ts +0 -77
- package/src/components/skeleton/index.tsx +0 -22
- package/src/components/slider/config.ts +0 -46
- package/src/components/slider/index.tsx +0 -76
- package/src/components/sonner/config.ts +0 -27
- package/src/components/sonner/index.tsx +0 -37
- package/src/components/spinner/config.ts +0 -40
- package/src/components/spinner/index.tsx +0 -30
- package/src/components/switch/config.ts +0 -171
- package/src/components/switch/index.tsx +0 -40
- package/src/components/table/config.ts +0 -38
- package/src/components/table/index.tsx +0 -135
- package/src/components/tabs/config.ts +0 -335
- package/src/components/tabs/index.tsx +0 -82
- package/src/components/textarea/config.ts +0 -117
- package/src/components/textarea/index.tsx +0 -26
- package/src/components/toggle/config.ts +0 -67
- package/src/components/toggle/index.tsx +0 -59
- package/src/components/toggle-group/config.ts +0 -46
- package/src/components/toggle-group/index.tsx +0 -106
- package/src/components/tooltip/config.ts +0 -16
- package/src/components/tooltip/index.tsx +0 -75
- package/src/components/typography/config.ts +0 -38
- package/src/components/typography/index.tsx +0 -172
- package/src/index.ts +0 -291
- package/tsconfig.json +0 -9
- package/tsconfig.lint.json +0 -8
- package/tsup.config.ts +0 -55
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Slide-in panel (drawer) built on the Radix Dialog primitive. Compose with
|
|
7
|
+
* {@link SheetTrigger}, {@link SheetContent}, {@link SheetHeader},
|
|
8
|
+
* {@link SheetTitle}, {@link SheetDescription} and {@link SheetFooter}.
|
|
9
|
+
* {@link SheetContent} slides from a chosen `side` and includes a close button.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Sheet>
|
|
14
|
+
* <SheetTrigger>Open</SheetTrigger>
|
|
15
|
+
* <SheetContent side="left">...</SheetContent>
|
|
16
|
+
* </Sheet>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
|
|
22
|
+
/** Portalled sheet panel that slides in from `side` (`top`/`right`/`bottom`/`left`, default `right`) over an overlay, with a built-in close button. */
|
|
23
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
24
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
25
|
+
}): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Slide-in panel (drawer) built on the Radix Dialog primitive. Compose with
|
|
7
|
+
* {@link SheetTrigger}, {@link SheetContent}, {@link SheetHeader},
|
|
8
|
+
* {@link SheetTitle}, {@link SheetDescription} and {@link SheetFooter}.
|
|
9
|
+
* {@link SheetContent} slides from a chosen `side` and includes a close button.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Sheet>
|
|
14
|
+
* <SheetTrigger>Open</SheetTrigger>
|
|
15
|
+
* <SheetContent side="left">...</SheetContent>
|
|
16
|
+
* </Sheet>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function Sheet({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare function SheetClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
|
|
22
|
+
/** Portalled sheet panel that slides in from `side` (`top`/`right`/`bottom`/`left`, default `right`) over an overlay, with a built-in close button. */
|
|
23
|
+
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
24
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
25
|
+
}): react_jsx_runtime.JSX.Element;
|
|
26
|
+
declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
27
|
+
declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
28
|
+
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
|
|
30
|
+
|
|
31
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Sheet,
|
|
4
|
+
SheetClose,
|
|
5
|
+
SheetContent,
|
|
6
|
+
SheetDescription,
|
|
7
|
+
SheetFooter,
|
|
8
|
+
SheetHeader,
|
|
9
|
+
SheetTitle,
|
|
10
|
+
SheetTrigger
|
|
11
|
+
} from "../../chunk-3NQR7JZR.js";
|
|
12
|
+
export {
|
|
13
|
+
Sheet,
|
|
14
|
+
SheetClose,
|
|
15
|
+
SheetContent,
|
|
16
|
+
SheetDescription,
|
|
17
|
+
SheetFooter,
|
|
18
|
+
SheetHeader,
|
|
19
|
+
SheetTitle,
|
|
20
|
+
SheetTrigger
|
|
21
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/components/toggle/index.tsx
|
|
32
|
+
var toggle_exports = {};
|
|
33
|
+
__export(toggle_exports, {
|
|
34
|
+
Toggle: () => Toggle,
|
|
35
|
+
toggleVariants: () => toggleVariants
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(toggle_exports);
|
|
38
|
+
var import_utils = require("@foundrykit/utils");
|
|
39
|
+
var TogglePrimitive = __toESM(require("@radix-ui/react-toggle"), 1);
|
|
40
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var toggleVariants = (0, import_class_variance_authority.cva)(
|
|
43
|
+
"hover:bg-muted hover:text-muted-foreground data-[state=on]:bg-accent data-[state=on]:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
44
|
+
{
|
|
45
|
+
variants: {
|
|
46
|
+
variant: {
|
|
47
|
+
default: "bg-transparent",
|
|
48
|
+
outline: "border-input hover:bg-accent hover:text-accent-foreground border bg-transparent shadow-xs"
|
|
49
|
+
},
|
|
50
|
+
size: {
|
|
51
|
+
default: "h-9 min-w-9 px-2",
|
|
52
|
+
sm: "h-8 min-w-8 px-1.5",
|
|
53
|
+
lg: "h-10 min-w-10 px-2.5"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
variant: "default",
|
|
58
|
+
size: "default"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
function Toggle({
|
|
63
|
+
className,
|
|
64
|
+
variant,
|
|
65
|
+
size,
|
|
66
|
+
...props
|
|
67
|
+
}) {
|
|
68
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
69
|
+
TogglePrimitive.Root,
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "toggle",
|
|
72
|
+
className: (0, import_utils.cn)(toggleVariants({ variant, size, className })),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
78
|
+
0 && (module.exports = {
|
|
79
|
+
Toggle,
|
|
80
|
+
toggleVariants
|
|
81
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
|
|
7
|
+
declare const toggleVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "outline" | null | undefined;
|
|
9
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Two-state toggle button built on Radix `Toggle.Root`, styled via
|
|
13
|
+
* {@link toggleVariants} with a `variant` (default, outline) and `size`
|
|
14
|
+
* (default, sm, lg). Control the pressed state with Radix
|
|
15
|
+
* `pressed`/`onPressedChange`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Toggle variant="outline" pressed={bold} onPressedChange={setBold}>
|
|
20
|
+
* <BoldIcon />
|
|
21
|
+
* </Toggle>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
|
|
7
|
+
declare const toggleVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "outline" | null | undefined;
|
|
9
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
10
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Two-state toggle button built on Radix `Toggle.Root`, styled via
|
|
13
|
+
* {@link toggleVariants} with a `variant` (default, outline) and `size`
|
|
14
|
+
* (default, sm, lg). Control the pressed state with Radix
|
|
15
|
+
* `pressed`/`onPressedChange`.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* <Toggle variant="outline" pressed={bold} onPressedChange={setBold}>
|
|
20
|
+
* <BoldIcon />
|
|
21
|
+
* </Toggle>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
|
|
31
|
+
// src/components/tooltip/index.tsx
|
|
32
|
+
var tooltip_exports = {};
|
|
33
|
+
__export(tooltip_exports, {
|
|
34
|
+
Tooltip: () => Tooltip,
|
|
35
|
+
TooltipContent: () => TooltipContent,
|
|
36
|
+
TooltipProvider: () => TooltipProvider,
|
|
37
|
+
TooltipTrigger: () => TooltipTrigger
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(tooltip_exports);
|
|
40
|
+
var import_utils = require("@foundrykit/utils");
|
|
41
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
42
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
43
|
+
function TooltipProvider({
|
|
44
|
+
delayDuration = 0,
|
|
45
|
+
...props
|
|
46
|
+
}) {
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
TooltipPrimitive.Provider,
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "tooltip-provider",
|
|
51
|
+
delayDuration,
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function Tooltip({
|
|
57
|
+
...props
|
|
58
|
+
}) {
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
60
|
+
}
|
|
61
|
+
function TooltipTrigger({
|
|
62
|
+
...props
|
|
63
|
+
}) {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
65
|
+
}
|
|
66
|
+
function TooltipContent({
|
|
67
|
+
className,
|
|
68
|
+
sideOffset = 0,
|
|
69
|
+
children,
|
|
70
|
+
...props
|
|
71
|
+
}) {
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
73
|
+
TooltipPrimitive.Content,
|
|
74
|
+
{
|
|
75
|
+
"data-slot": "tooltip-content",
|
|
76
|
+
sideOffset,
|
|
77
|
+
className: (0, import_utils.cn)(
|
|
78
|
+
"bg-primary text-primary-foreground animate-in fade-in-0 motion-safe:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
...props,
|
|
82
|
+
children: [
|
|
83
|
+
children,
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
) });
|
|
88
|
+
}
|
|
89
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
90
|
+
0 && (module.exports = {
|
|
91
|
+
Tooltip,
|
|
92
|
+
TooltipContent,
|
|
93
|
+
TooltipProvider,
|
|
94
|
+
TooltipTrigger
|
|
95
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
/** Radix `Tooltip.Provider` wrapper (default `delayDuration` 0); wrap the app to share tooltip timing. */
|
|
6
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip root built on Radix `Tooltip.Root`. Wraps itself in a
|
|
9
|
+
* {@link TooltipProvider} (default `delayDuration` 0), so it works standalone.
|
|
10
|
+
* Compose with {@link TooltipTrigger} and {@link TooltipContent} (portalled,
|
|
11
|
+
* animated, with an arrow).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Tooltip>
|
|
16
|
+
* <TooltipTrigger>Hover</TooltipTrigger>
|
|
17
|
+
* <TooltipContent>Details</TooltipContent>
|
|
18
|
+
* </Tooltip>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
|
|
5
|
+
/** Radix `Tooltip.Provider` wrapper (default `delayDuration` 0); wrap the app to share tooltip timing. */
|
|
6
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip root built on Radix `Tooltip.Root`. Wraps itself in a
|
|
9
|
+
* {@link TooltipProvider} (default `delayDuration` 0), so it works standalone.
|
|
10
|
+
* Compose with {@link TooltipTrigger} and {@link TooltipContent} (portalled,
|
|
11
|
+
* animated, with an arrow).
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Tooltip>
|
|
16
|
+
* <TooltipTrigger>Hover</TooltipTrigger>
|
|
17
|
+
* <TooltipContent>Details</TooltipContent>
|
|
18
|
+
* </Tooltip>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
22
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
package/dist/index.d.cts
CHANGED
|
@@ -12,9 +12,7 @@ export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
|
|
|
12
12
|
export { Checkbox } from './components/checkbox/index.cjs';
|
|
13
13
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger } from './components/collapsible/index.cjs';
|
|
14
14
|
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger } from './components/context-menu/index.cjs';
|
|
15
|
-
|
|
16
|
-
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
17
|
-
import * as React from 'react';
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from './components/dialog/index.cjs';
|
|
18
16
|
export { DirectionProvider } from './components/direction/index.cjs';
|
|
19
17
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger } from './components/drawer/index.cjs';
|
|
20
18
|
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from './components/dropdown/index.cjs';
|
|
@@ -35,6 +33,7 @@ export { ResizableHandle, ResizablePanel, ResizablePanelGroup } from './componen
|
|
|
35
33
|
export { ScrollArea, ScrollBar } from './components/scroll-area/index.cjs';
|
|
36
34
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from './components/select/index.cjs';
|
|
37
35
|
export { Separator } from './components/separator/index.cjs';
|
|
36
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger } from './components/sheet/index.cjs';
|
|
38
37
|
export { Skeleton } from './components/skeleton/index.cjs';
|
|
39
38
|
export { Slider } from './components/slider/index.cjs';
|
|
40
39
|
export { Toaster } from './components/sonner/index.cjs';
|
|
@@ -43,21 +42,24 @@ export { Switch } from './components/switch/index.cjs';
|
|
|
43
42
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow } from './components/table/index.cjs';
|
|
44
43
|
export { Tabs, TabsContent, TabsList, TabsTrigger } from './components/tabs/index.cjs';
|
|
45
44
|
export { Textarea } from './components/textarea/index.cjs';
|
|
46
|
-
|
|
47
|
-
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
48
|
-
import { VariantProps } from 'class-variance-authority';
|
|
45
|
+
export { Toggle, toggleVariants } from './components/toggle/index.cjs';
|
|
49
46
|
export { ToggleGroup, ToggleGroupItem } from './components/toggle-group/index.cjs';
|
|
50
|
-
|
|
47
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './components/tooltip/index.cjs';
|
|
51
48
|
export { TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyInlineCode, TypographyLarge, TypographyLead, TypographyList, TypographyMuted, TypographyP, TypographySmall } from './components/typography/index.cjs';
|
|
52
49
|
export { useDirection } from '@radix-ui/react-direction';
|
|
53
50
|
export { toast } from 'sonner';
|
|
51
|
+
import 'react/jsx-runtime';
|
|
54
52
|
import '@radix-ui/react-accordion';
|
|
53
|
+
import 'react';
|
|
54
|
+
import 'class-variance-authority/types';
|
|
55
|
+
import 'class-variance-authority';
|
|
55
56
|
import '@radix-ui/react-alert-dialog';
|
|
56
57
|
import '@radix-ui/react-aspect-ratio';
|
|
57
58
|
import '@radix-ui/react-avatar';
|
|
58
59
|
import '@radix-ui/react-checkbox';
|
|
59
60
|
import '@radix-ui/react-collapsible';
|
|
60
61
|
import '@radix-ui/react-context-menu';
|
|
62
|
+
import '@radix-ui/react-dialog';
|
|
61
63
|
import 'vaul';
|
|
62
64
|
import '@radix-ui/react-dropdown-menu';
|
|
63
65
|
import '@radix-ui/react-label';
|
|
@@ -75,102 +77,6 @@ import '@radix-ui/react-slider';
|
|
|
75
77
|
import 'lucide-react';
|
|
76
78
|
import '@radix-ui/react-switch';
|
|
77
79
|
import '@radix-ui/react-tabs';
|
|
80
|
+
import '@radix-ui/react-toggle';
|
|
78
81
|
import '@radix-ui/react-toggle-group';
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Modal dialog root built on Radix `Dialog.Root`. Compose with
|
|
82
|
-
* {@link DialogTrigger}, {@link DialogContent} (which renders the overlay and an
|
|
83
|
-
* optional close button), {@link DialogHeader}, {@link DialogTitle},
|
|
84
|
-
* {@link DialogDescription} and {@link DialogFooter}.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```tsx
|
|
88
|
-
* <Dialog>
|
|
89
|
-
* <DialogTrigger>Open</DialogTrigger>
|
|
90
|
-
* <DialogContent>
|
|
91
|
-
* <DialogHeader><DialogTitle>Title</DialogTitle></DialogHeader>
|
|
92
|
-
* </DialogContent>
|
|
93
|
-
* </Dialog>
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
97
|
-
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
98
|
-
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
|
|
99
|
-
/**
|
|
100
|
-
* Centered, animated dialog panel rendered in a portal over a dark overlay.
|
|
101
|
-
* Set `showCloseButton={false}` to hide the built-in top-right close button.
|
|
102
|
-
*/
|
|
103
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
104
|
-
showCloseButton?: boolean;
|
|
105
|
-
}): react_jsx_runtime.JSX.Element;
|
|
106
|
-
declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
107
|
-
declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
108
|
-
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
109
|
-
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Slide-in panel (drawer) built on the Radix Dialog primitive. Compose with
|
|
113
|
-
* {@link SheetTrigger}, {@link SheetContent}, {@link SheetHeader},
|
|
114
|
-
* {@link SheetTitle}, {@link SheetDescription} and {@link SheetFooter}.
|
|
115
|
-
* {@link SheetContent} slides from a chosen `side` and includes a close button.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```tsx
|
|
119
|
-
* <Sheet>
|
|
120
|
-
* <SheetTrigger>Open</SheetTrigger>
|
|
121
|
-
* <SheetContent side="left">...</SheetContent>
|
|
122
|
-
* </Sheet>
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
declare function Sheet({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
126
|
-
declare function SheetTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
127
|
-
declare function SheetClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): react_jsx_runtime.JSX.Element;
|
|
128
|
-
/** Portalled sheet panel that slides in from `side` (`top`/`right`/`bottom`/`left`, default `right`) over an overlay, with a built-in close button. */
|
|
129
|
-
declare function SheetContent({ className, children, side, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
130
|
-
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
131
|
-
}): react_jsx_runtime.JSX.Element;
|
|
132
|
-
declare function SheetHeader({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
133
|
-
declare function SheetFooter({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
134
|
-
declare function SheetTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
135
|
-
declare function SheetDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): react_jsx_runtime.JSX.Element;
|
|
136
|
-
|
|
137
|
-
declare const toggleVariants: (props?: ({
|
|
138
|
-
variant?: "default" | "outline" | null | undefined;
|
|
139
|
-
size?: "default" | "sm" | "lg" | null | undefined;
|
|
140
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
141
|
-
/**
|
|
142
|
-
* Two-state toggle button built on Radix `Toggle.Root`, styled via
|
|
143
|
-
* {@link toggleVariants} with a `variant` (default, outline) and `size`
|
|
144
|
-
* (default, sm, lg). Control the pressed state with Radix
|
|
145
|
-
* `pressed`/`onPressedChange`.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* ```tsx
|
|
149
|
-
* <Toggle variant="outline" pressed={bold} onPressedChange={setBold}>
|
|
150
|
-
* <BoldIcon />
|
|
151
|
-
* </Toggle>
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): react_jsx_runtime.JSX.Element;
|
|
155
|
-
|
|
156
|
-
/** Radix `Tooltip.Provider` wrapper (default `delayDuration` 0); wrap the app to share tooltip timing. */
|
|
157
|
-
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): react_jsx_runtime.JSX.Element;
|
|
158
|
-
/**
|
|
159
|
-
* Tooltip root built on Radix `Tooltip.Root`. Wraps itself in a
|
|
160
|
-
* {@link TooltipProvider} (default `delayDuration` 0), so it works standalone.
|
|
161
|
-
* Compose with {@link TooltipTrigger} and {@link TooltipContent} (portalled,
|
|
162
|
-
* animated, with an arrow).
|
|
163
|
-
*
|
|
164
|
-
* @example
|
|
165
|
-
* ```tsx
|
|
166
|
-
* <Tooltip>
|
|
167
|
-
* <TooltipTrigger>Hover</TooltipTrigger>
|
|
168
|
-
* <TooltipContent>Details</TooltipContent>
|
|
169
|
-
* </Tooltip>
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
172
|
-
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
173
|
-
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
174
|
-
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
175
|
-
|
|
176
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, toggleVariants };
|
|
82
|
+
import '@radix-ui/react-tooltip';
|