@foundrykit/primitives 2.1.2 → 2.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/dist/components/accordion/index.js +60 -6
- package/dist/components/alert/index.js +62 -6
- package/dist/components/alert-dialog/index.js +142 -13
- package/dist/components/aspect-ratio/index.js +9 -3
- package/dist/components/avatar/index.js +50 -5
- package/dist/components/badge/index.js +37 -4
- package/dist/components/breadcrumb/index.js +95 -9
- package/dist/components/button-group/index.js +74 -6
- package/dist/components/card/index.js +66 -8
- package/dist/components/checkbox/index.js +30 -3
- package/dist/components/collapsible/index.js +33 -7
- package/dist/components/context-menu/index.js +208 -17
- package/dist/components/dialog/index.js +126 -12
- package/dist/components/direction/index.js +10 -2
- package/dist/components/drawer/index.js +118 -12
- package/dist/components/dropdown/index.js +216 -17
- package/dist/components/empty/index.js +95 -9
- package/dist/components/field/index.js +211 -13
- package/dist/components/hover-card/index.js +35 -5
- package/dist/components/item/index.js +178 -14
- package/dist/components/kbd/index.js +27 -4
- package/dist/components/label/index.js +21 -3
- package/dist/components/menubar/index.js +235 -18
- package/dist/components/native-select/index.js +25 -3
- package/dist/components/navigation-menu/index.js +161 -11
- package/dist/components/popover/index.js +40 -6
- package/dist/components/progress/index.js +30 -3
- package/dist/components/radio-group/index.js +43 -4
- package/dist/components/resizable/index.js +43 -5
- package/dist/components/scroll-area/index.js +58 -4
- package/dist/components/section/index.js +13 -3
- package/dist/components/select/index.js +159 -12
- package/dist/components/sheet/index.js +118 -10
- package/dist/components/skeleton/index.js +13 -3
- package/dist/components/slider/index.js +64 -3
- package/dist/components/sonner/index.js +21 -4
- package/dist/components/spinner/index.js +19 -3
- package/dist/components/switch/index.js +30 -3
- package/dist/components/table/index.js +105 -10
- package/dist/components/tabs/index.js +63 -6
- package/dist/components/toggle/index.js +41 -4
- package/dist/components/toggle-group/index.js +80 -4
- package/dist/components/tooltip/index.js +51 -6
- package/dist/components/typography/index.js +147 -14
- package/dist/index.js +198 -245
- package/package.json +4 -4
- package/dist/chunk-25N35Z5M.js +0 -42
- package/dist/chunk-2JOT4DV4.js +0 -66
- package/dist/chunk-2SBGU5XA.js +0 -233
- package/dist/chunk-2UG6OCGA.js +0 -75
- package/dist/chunk-3BAO7TAS.js +0 -105
- package/dist/chunk-3NQR7JZR.js +0 -128
- package/dist/chunk-3QUMCM5K.js +0 -225
- package/dist/chunk-3TZXV53R.js +0 -55
- package/dist/chunk-3UKWAM5M.js +0 -33
- package/dist/chunk-44I6VK3H.js +0 -105
- package/dist/chunk-67UXTT4O.js +0 -116
- package/dist/chunk-727ACUWN.js +0 -82
- package/dist/chunk-76APYFRN.js +0 -29
- package/dist/chunk-AJAAMJYH.js +0 -12
- package/dist/chunk-B5YCE3UP.js +0 -57
- package/dist/chunk-BIFBYERK.js +0 -69
- package/dist/chunk-DXZ4GUQO.js +0 -33
- package/dist/chunk-ED6T7ZZN.js +0 -130
- package/dist/chunk-EEAK2RWF.js +0 -23
- package/dist/chunk-F2TEA6ER.js +0 -138
- package/dist/chunk-FF5D53KL.js +0 -69
- package/dist/chunk-FRIOQFPE.js +0 -171
- package/dist/chunk-G2YBCHWR.js +0 -46
- package/dist/chunk-GKCBSG2W.js +0 -67
- package/dist/chunk-GPEL656S.js +0 -84
- package/dist/chunk-JKKCRFYB.js +0 -36
- package/dist/chunk-JTSIBZS4.js +0 -194
- package/dist/chunk-MCXSVXO4.js +0 -24
- package/dist/chunk-MMZJQ7RW.js +0 -33
- package/dist/chunk-MYIUX3DT.js +0 -62
- package/dist/chunk-P5KEJOBH.js +0 -155
- package/dist/chunk-PAO3DSEF.js +0 -48
- package/dist/chunk-PLLG76QJ.js +0 -32
- package/dist/chunk-SDYKJVXX.js +0 -253
- package/dist/chunk-SIQHWNPH.js +0 -45
- package/dist/chunk-SKR3J46C.js +0 -17
- package/dist/chunk-STRBREHN.js +0 -17
- package/dist/chunk-SUEPE6OX.js +0 -47
- package/dist/chunk-TA23RNS4.js +0 -162
- package/dist/chunk-TRXU4SOJ.js +0 -224
- package/dist/chunk-U7JIOR7A.js +0 -172
- package/dist/chunk-VPBVKBZ7.js +0 -25
- package/dist/chunk-W4XY3SNY.js +0 -40
- package/dist/chunk-YT2ZIMZI.js +0 -16
- package/dist/components/accordion/index.cjs +0 -104
- package/dist/components/accordion/index.d.cts +0 -25
- package/dist/components/alert/index.cjs +0 -96
- package/dist/components/alert/index.d.cts +0 -28
- package/dist/components/alert-dialog/index.cjs +0 -200
- package/dist/components/alert-dialog/index.d.cts +0 -42
- package/dist/components/aspect-ratio/index.cjs +0 -47
- package/dist/components/aspect-ratio/index.d.cts +0 -19
- package/dist/components/avatar/index.cjs +0 -92
- package/dist/components/avatar/index.d.cts +0 -24
- package/dist/components/badge/index.cjs +0 -67
- package/dist/components/badge/index.d.cts +0 -24
- package/dist/components/breadcrumb/index.cjs +0 -135
- package/dist/components/breadcrumb/index.d.cts +0 -33
- package/dist/components/button/index.cjs +0 -87
- package/dist/components/button/index.d.cts +0 -28
- package/dist/components/button-group/index.cjs +0 -142
- package/dist/components/button-group/index.d.cts +0 -33
- package/dist/components/card/index.cjs +0 -104
- package/dist/components/card/index.d.cts +0 -27
- package/dist/components/checkbox/index.cjs +0 -68
- package/dist/components/checkbox/index.d.cts +0 -17
- package/dist/components/collapsible/index.cjs +0 -73
- package/dist/components/collapsible/index.d.cts +0 -22
- package/dist/components/context-menu/index.cjs +0 -274
- package/dist/components/context-menu/index.d.cts +0 -48
- package/dist/components/dialog/index.cjs +0 -182
- package/dist/components/dialog/index.d.cts +0 -38
- package/dist/components/direction/index.cjs +0 -39
- package/dist/components/direction/index.d.cts +0 -20
- package/dist/components/drawer/index.cjs +0 -164
- package/dist/components/drawer/index.d.cts +0 -35
- package/dist/components/dropdown/index.cjs +0 -282
- package/dist/components/dropdown/index.d.cts +0 -52
- package/dist/components/empty/index.cjs +0 -135
- package/dist/components/empty/index.d.cts +0 -38
- package/dist/components/field/index.cjs +0 -269
- package/dist/components/field/index.d.cts +0 -42
- package/dist/components/hover-card/index.cjs +0 -77
- package/dist/components/hover-card/index.d.cts +0 -22
- package/dist/components/input/index.cjs +0 -47
- package/dist/components/input/index.d.cts +0 -17
- package/dist/components/input-group/index.cjs +0 -270
- package/dist/components/input-group/index.d.cts +0 -44
- package/dist/components/item/index.cjs +0 -262
- package/dist/components/item/index.d.cts +0 -47
- package/dist/components/kbd/index.cjs +0 -57
- package/dist/components/kbd/index.d.cts +0 -19
- package/dist/components/label/index.cjs +0 -59
- package/dist/components/label/index.d.cts +0 -16
- package/dist/components/menubar/index.cjs +0 -303
- package/dist/components/menubar/index.d.cts +0 -49
- package/dist/components/native-select/index.cjs +0 -53
- package/dist/components/native-select/index.d.cts +0 -19
- package/dist/components/navigation-menu/index.cjs +0 -215
- package/dist/components/navigation-menu/index.d.cts +0 -37
- package/dist/components/popover/index.cjs +0 -84
- package/dist/components/popover/index.d.cts +0 -23
- package/dist/components/progress/index.cjs +0 -68
- package/dist/components/progress/index.d.cts +0 -16
- package/dist/components/radio-group/index.cjs +0 -83
- package/dist/components/radio-group/index.d.cts +0 -22
- package/dist/components/resizable/index.cjs +0 -75
- package/dist/components/resizable/index.d.cts +0 -25
- package/dist/components/scroll-area/index.cjs +0 -98
- package/dist/components/scroll-area/index.d.cts +0 -21
- package/dist/components/section/index.cjs +0 -41
- package/dist/components/section/index.d.cts +0 -27
- package/dist/components/select/index.cjs +0 -215
- package/dist/components/select/index.d.cts +0 -36
- package/dist/components/separator/index.cjs +0 -63
- package/dist/components/separator/index.d.cts +0 -18
- package/dist/components/sheet/index.cjs +0 -170
- package/dist/components/sheet/index.d.cts +0 -31
- package/dist/components/skeleton/index.cjs +0 -41
- package/dist/components/skeleton/index.d.cts +0 -14
- package/dist/components/slider/index.cjs +0 -102
- package/dist/components/slider/index.d.cts +0 -19
- package/dist/components/sonner/index.cjs +0 -51
- package/dist/components/sonner/index.d.cts +0 -18
- package/dist/components/spinner/index.cjs +0 -47
- package/dist/components/spinner/index.d.cts +0 -17
- package/dist/components/switch/index.cjs +0 -68
- package/dist/components/switch/index.d.cts +0 -17
- package/dist/components/table/index.cjs +0 -147
- package/dist/components/table/index.d.cts +0 -35
- package/dist/components/tabs/index.cjs +0 -107
- package/dist/components/tabs/index.d.cts +0 -27
- package/dist/components/textarea/index.cjs +0 -44
- package/dist/components/textarea/index.d.cts +0 -15
- package/dist/components/toggle/index.cjs +0 -81
- package/dist/components/toggle/index.d.cts +0 -26
- package/dist/components/toggle-group/index.cjs +0 -120
- package/dist/components/toggle-group/index.d.cts +0 -27
- package/dist/components/tooltip/index.cjs +0 -95
- package/dist/components/tooltip/index.d.cts +0 -25
- package/dist/components/typography/index.cjs +0 -197
- package/dist/components/typography/index.d.cts +0 -28
- package/dist/index.cjs +0 -4094
- package/dist/index.d.cts +0 -83
|
@@ -1,10 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
|
|
3
|
+
// src/components/tooltip/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function TooltipProvider({
|
|
8
|
+
delayDuration = 0,
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
TooltipPrimitive.Provider,
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "tooltip-provider",
|
|
15
|
+
delayDuration,
|
|
16
|
+
...props
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
function Tooltip({
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
24
|
+
}
|
|
25
|
+
function TooltipTrigger({
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
29
|
+
}
|
|
30
|
+
function TooltipContent({
|
|
31
|
+
className,
|
|
32
|
+
sideOffset = 0,
|
|
33
|
+
children,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
37
|
+
TooltipPrimitive.Content,
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "tooltip-content",
|
|
40
|
+
sideOffset,
|
|
41
|
+
className: cn(
|
|
42
|
+
"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",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
children,
|
|
48
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
) });
|
|
52
|
+
}
|
|
8
53
|
export {
|
|
9
54
|
Tooltip,
|
|
10
55
|
TooltipContent,
|
|
@@ -1,17 +1,150 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
// src/components/typography/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function TypographyH1({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"h1",
|
|
7
|
+
{
|
|
8
|
+
"data-slot": "typography-h1",
|
|
9
|
+
className: cn(
|
|
10
|
+
"scroll-m-20 text-4xl font-extrabold tracking-tight text-balance",
|
|
11
|
+
className
|
|
12
|
+
),
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
function TypographyH2({ className, ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(
|
|
19
|
+
"h2",
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "typography-h2",
|
|
22
|
+
className: cn(
|
|
23
|
+
"scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",
|
|
24
|
+
className
|
|
25
|
+
),
|
|
26
|
+
...props
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
function TypographyH3({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
"h3",
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "typography-h3",
|
|
35
|
+
className: cn(
|
|
36
|
+
"scroll-m-20 text-2xl font-semibold tracking-tight",
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function TypographyH4({ className, ...props }) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
"h4",
|
|
46
|
+
{
|
|
47
|
+
"data-slot": "typography-h4",
|
|
48
|
+
className: cn(
|
|
49
|
+
"scroll-m-20 text-xl font-semibold tracking-tight",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function TypographyP({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
"p",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "typography-p",
|
|
61
|
+
className: cn("leading-7 [&:not(:first-child)]:mt-6", className),
|
|
62
|
+
...props
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
function TypographyBlockquote({
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}) {
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"blockquote",
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "typography-blockquote",
|
|
74
|
+
className: cn("mt-6 border-l-2 pl-6 italic", className),
|
|
75
|
+
...props
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function TypographyList({ className, ...props }) {
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
"ul",
|
|
82
|
+
{
|
|
83
|
+
"data-slot": "typography-list",
|
|
84
|
+
className: cn("my-6 ml-6 list-disc [&>li]:mt-2", className),
|
|
85
|
+
...props
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function TypographyInlineCode({
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
"code",
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "typography-inline-code",
|
|
97
|
+
className: cn(
|
|
98
|
+
"bg-muted relative rounded px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold",
|
|
99
|
+
className
|
|
100
|
+
),
|
|
101
|
+
...props
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
function TypographyLead({ className, ...props }) {
|
|
106
|
+
return /* @__PURE__ */ jsx(
|
|
107
|
+
"p",
|
|
108
|
+
{
|
|
109
|
+
"data-slot": "typography-lead",
|
|
110
|
+
className: cn("text-muted-foreground text-xl", className),
|
|
111
|
+
...props
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
function TypographyLarge({ className, ...props }) {
|
|
116
|
+
return /* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "typography-large",
|
|
120
|
+
className: cn("text-lg font-semibold", className),
|
|
121
|
+
...props
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
function TypographySmall({
|
|
126
|
+
className,
|
|
127
|
+
...props
|
|
128
|
+
}) {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
"small",
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "typography-small",
|
|
133
|
+
className: cn("text-sm leading-none font-medium", className),
|
|
134
|
+
...props
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function TypographyMuted({ className, ...props }) {
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
"p",
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "typography-muted",
|
|
143
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
15
148
|
export {
|
|
16
149
|
TypographyBlockquote,
|
|
17
150
|
TypographyH1,
|