@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,15 +1,165 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
|
|
3
|
+
// src/components/navigation-menu/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
function NavigationMenu({
|
|
10
|
+
className,
|
|
11
|
+
children,
|
|
12
|
+
viewport = true,
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxs(
|
|
16
|
+
NavigationMenuPrimitive.Root,
|
|
17
|
+
{
|
|
18
|
+
"data-slot": "navigation-menu",
|
|
19
|
+
"data-viewport": viewport,
|
|
20
|
+
className: cn(
|
|
21
|
+
"group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props,
|
|
25
|
+
children: [
|
|
26
|
+
children,
|
|
27
|
+
viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
function NavigationMenuList({
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
NavigationMenuPrimitive.List,
|
|
38
|
+
{
|
|
39
|
+
"data-slot": "navigation-menu-list",
|
|
40
|
+
className: cn(
|
|
41
|
+
"group flex flex-1 list-none items-center justify-center gap-1",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
...props
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
function NavigationMenuItem({
|
|
49
|
+
className,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
NavigationMenuPrimitive.Item,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "navigation-menu-item",
|
|
56
|
+
className: cn("relative", className),
|
|
57
|
+
...props
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
var navigationMenuTriggerStyle = cva(
|
|
62
|
+
"group bg-background hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50"
|
|
63
|
+
);
|
|
64
|
+
function NavigationMenuTrigger({
|
|
65
|
+
className,
|
|
66
|
+
children,
|
|
67
|
+
...props
|
|
68
|
+
}) {
|
|
69
|
+
return /* @__PURE__ */ jsxs(
|
|
70
|
+
NavigationMenuPrimitive.Trigger,
|
|
71
|
+
{
|
|
72
|
+
"data-slot": "navigation-menu-trigger",
|
|
73
|
+
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
74
|
+
...props,
|
|
75
|
+
children: [
|
|
76
|
+
children,
|
|
77
|
+
" ",
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
ChevronDownIcon,
|
|
80
|
+
{
|
|
81
|
+
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
82
|
+
"aria-hidden": "true"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function NavigationMenuContent({
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}) {
|
|
93
|
+
return /* @__PURE__ */ jsx(
|
|
94
|
+
NavigationMenuPrimitive.Content,
|
|
95
|
+
{
|
|
96
|
+
"data-slot": "navigation-menu-content",
|
|
97
|
+
className: cn(
|
|
98
|
+
"data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out motion-safe:data-[motion=from-end]:slide-in-from-right-52 motion-safe:data-[motion=from-start]:slide-in-from-left-52 motion-safe:data-[motion=to-end]:slide-out-to-right-52 motion-safe:data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
|
|
99
|
+
"group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out motion-safe:group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 motion-safe:group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200",
|
|
100
|
+
className
|
|
101
|
+
),
|
|
102
|
+
...props
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function NavigationMenuViewport({
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
}) {
|
|
110
|
+
return /* @__PURE__ */ jsx(
|
|
111
|
+
"div",
|
|
112
|
+
{
|
|
113
|
+
className: cn(
|
|
114
|
+
"absolute top-full left-0 isolate z-50 flex justify-center"
|
|
115
|
+
),
|
|
116
|
+
children: /* @__PURE__ */ jsx(
|
|
117
|
+
NavigationMenuPrimitive.Viewport,
|
|
118
|
+
{
|
|
119
|
+
"data-slot": "navigation-menu-viewport",
|
|
120
|
+
className: cn(
|
|
121
|
+
"origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
122
|
+
className
|
|
123
|
+
),
|
|
124
|
+
...props
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
function NavigationMenuLink({
|
|
131
|
+
className,
|
|
132
|
+
...props
|
|
133
|
+
}) {
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
NavigationMenuPrimitive.Link,
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "navigation-menu-link",
|
|
138
|
+
className: cn(
|
|
139
|
+
"data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
|
|
140
|
+
className
|
|
141
|
+
),
|
|
142
|
+
...props
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
function NavigationMenuIndicator({
|
|
147
|
+
className,
|
|
148
|
+
...props
|
|
149
|
+
}) {
|
|
150
|
+
return /* @__PURE__ */ jsx(
|
|
151
|
+
NavigationMenuPrimitive.Indicator,
|
|
152
|
+
{
|
|
153
|
+
"data-slot": "navigation-menu-indicator",
|
|
154
|
+
className: cn(
|
|
155
|
+
"data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
|
|
156
|
+
className
|
|
157
|
+
),
|
|
158
|
+
...props,
|
|
159
|
+
children: /* @__PURE__ */ jsx("div", { className: "bg-border relative top-[60%] size-2 rotate-45 rounded-tl-sm shadow-md" })
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
13
163
|
export {
|
|
14
164
|
NavigationMenu,
|
|
15
165
|
NavigationMenuContent,
|
|
@@ -1,10 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
|
|
3
|
+
// src/components/popover/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function Popover({
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
11
|
+
}
|
|
12
|
+
function PopoverTrigger({
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
16
|
+
}
|
|
17
|
+
function PopoverContent({
|
|
18
|
+
className,
|
|
19
|
+
align = "center",
|
|
20
|
+
sideOffset = 4,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
24
|
+
PopoverPrimitive.Content,
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "popover-content",
|
|
27
|
+
align,
|
|
28
|
+
sideOffset,
|
|
29
|
+
className: cn(
|
|
30
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-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-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
function PopoverAnchor({
|
|
38
|
+
...props
|
|
39
|
+
}) {
|
|
40
|
+
return /* @__PURE__ */ jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
41
|
+
}
|
|
8
42
|
export {
|
|
9
43
|
Popover,
|
|
10
44
|
PopoverAnchor,
|
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "
|
|
2
|
+
|
|
3
|
+
// src/components/progress/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function Progress({
|
|
8
|
+
className,
|
|
9
|
+
value,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
ProgressPrimitive.Root,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "progress",
|
|
16
|
+
className: cn(
|
|
17
|
+
"bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props,
|
|
21
|
+
children: /* @__PURE__ */ jsx(
|
|
22
|
+
ProgressPrimitive.Indicator,
|
|
23
|
+
{
|
|
24
|
+
"data-slot": "progress-indicator",
|
|
25
|
+
className: "bg-primary h-full w-full flex-1 transition-all",
|
|
26
|
+
style: { transform: `translateX(-${100 - (value || 0)}%)` }
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
5
32
|
export {
|
|
6
33
|
Progress
|
|
7
34
|
};
|
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
// src/components/radio-group/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
6
|
+
import { CircleIcon } from "lucide-react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function RadioGroup({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
RadioGroupPrimitive.Root,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "radio-group",
|
|
16
|
+
className: cn("grid gap-3", className),
|
|
17
|
+
...props
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function RadioGroupItem({
|
|
22
|
+
className,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
RadioGroupPrimitive.Item,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "radio-group-item",
|
|
29
|
+
className: cn(
|
|
30
|
+
"border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
...props,
|
|
34
|
+
children: /* @__PURE__ */ jsx(
|
|
35
|
+
RadioGroupPrimitive.Indicator,
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "radio-group-indicator",
|
|
38
|
+
className: "relative flex items-center justify-center",
|
|
39
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
6
45
|
export {
|
|
7
46
|
RadioGroup,
|
|
8
47
|
RadioGroupItem
|
|
@@ -1,9 +1,47 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "
|
|
2
|
+
|
|
3
|
+
// src/components/resizable/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import { GripVerticalIcon } from "lucide-react";
|
|
6
|
+
import { Group, Panel, Separator } from "react-resizable-panels";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function ResizablePanelGroup({
|
|
9
|
+
className,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Group,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "resizable-panel-group",
|
|
16
|
+
className: cn(
|
|
17
|
+
"flex h-full w-full aria-[orientation=vertical]:flex-col",
|
|
18
|
+
className
|
|
19
|
+
),
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
function ResizablePanel({ ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(Panel, { "data-slot": "resizable-panel", ...props });
|
|
26
|
+
}
|
|
27
|
+
function ResizableHandle({
|
|
28
|
+
withHandle,
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
Separator,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "resizable-handle",
|
|
36
|
+
className: cn(
|
|
37
|
+
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:outline-hidden aria-[orientation=vertical]:h-px aria-[orientation=vertical]:w-full aria-[orientation=vertical]:after:left-0 aria-[orientation=vertical]:after:h-1 aria-[orientation=vertical]:after:w-full aria-[orientation=vertical]:after:translate-x-0 aria-[orientation=vertical]:after:-translate-y-1/2",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props,
|
|
41
|
+
children: withHandle && /* @__PURE__ */ jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: /* @__PURE__ */ jsx(GripVerticalIcon, { className: "size-2.5" }) })
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
7
45
|
export {
|
|
8
46
|
ResizableHandle,
|
|
9
47
|
ResizablePanel,
|
|
@@ -1,8 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
|
|
3
|
+
// src/components/scroll-area/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
function ScrollArea({
|
|
8
|
+
className,
|
|
9
|
+
children,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ jsxs(
|
|
13
|
+
ScrollAreaPrimitive.Root,
|
|
14
|
+
{
|
|
15
|
+
"data-slot": "scroll-area",
|
|
16
|
+
className: cn("relative", className),
|
|
17
|
+
...props,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
ScrollAreaPrimitive.Viewport,
|
|
21
|
+
{
|
|
22
|
+
"data-slot": "scroll-area-viewport",
|
|
23
|
+
className: "focus-visible:ring-ring/50 size-full h-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",
|
|
24
|
+
children
|
|
25
|
+
}
|
|
26
|
+
),
|
|
27
|
+
/* @__PURE__ */ jsx(ScrollBar, {}),
|
|
28
|
+
/* @__PURE__ */ jsx(ScrollAreaPrimitive.Corner, {})
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function ScrollBar({
|
|
34
|
+
className,
|
|
35
|
+
orientation = "vertical",
|
|
36
|
+
...props
|
|
37
|
+
}) {
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "scroll-area-scrollbar",
|
|
42
|
+
orientation,
|
|
43
|
+
className: cn(
|
|
44
|
+
"flex touch-none p-px transition-colors select-none",
|
|
45
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent",
|
|
46
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent",
|
|
47
|
+
className
|
|
48
|
+
),
|
|
49
|
+
...props,
|
|
50
|
+
children: /* @__PURE__ */ jsx(
|
|
51
|
+
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "scroll-area-thumb",
|
|
54
|
+
className: "bg-border relative flex-1 rounded-full"
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
6
60
|
export {
|
|
7
61
|
ScrollArea,
|
|
8
62
|
ScrollBar
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
1
|
+
// src/components/section/index.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function Section({ theme, className, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"section",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "section",
|
|
8
|
+
"data-section-theme": theme && theme !== "default" ? theme : void 0,
|
|
9
|
+
className: ["py-12 md:py-20", className].filter(Boolean).join(" "),
|
|
10
|
+
...props
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
}
|
|
4
14
|
export {
|
|
5
15
|
Section
|
|
6
16
|
};
|
|
@@ -1,16 +1,163 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
|
|
3
|
+
// src/components/select/index.tsx
|
|
4
|
+
import { cn } from "@foundrykit/utils";
|
|
5
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
6
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function Select({
|
|
9
|
+
...props
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
12
|
+
}
|
|
13
|
+
function SelectGroup({
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
17
|
+
}
|
|
18
|
+
function SelectValue({
|
|
19
|
+
...props
|
|
20
|
+
}) {
|
|
21
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
22
|
+
}
|
|
23
|
+
function SelectTrigger({
|
|
24
|
+
className,
|
|
25
|
+
size = "default",
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
SelectPrimitive.Trigger,
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "select-trigger",
|
|
33
|
+
"data-size": size,
|
|
34
|
+
className: cn(
|
|
35
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-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 dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
36
|
+
className
|
|
37
|
+
),
|
|
38
|
+
...props,
|
|
39
|
+
children: [
|
|
40
|
+
children,
|
|
41
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function SelectContent({
|
|
47
|
+
className,
|
|
48
|
+
children,
|
|
49
|
+
position = "popper",
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
53
|
+
SelectPrimitive.Content,
|
|
54
|
+
{
|
|
55
|
+
"data-slot": "select-content",
|
|
56
|
+
className: cn(
|
|
57
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:zoom-in-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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
58
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
59
|
+
className
|
|
60
|
+
),
|
|
61
|
+
position,
|
|
62
|
+
...props,
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
SelectPrimitive.Viewport,
|
|
67
|
+
{
|
|
68
|
+
className: cn(
|
|
69
|
+
"p-1",
|
|
70
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
71
|
+
),
|
|
72
|
+
children
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) });
|
|
79
|
+
}
|
|
80
|
+
function SelectLabel({
|
|
81
|
+
className,
|
|
82
|
+
...props
|
|
83
|
+
}) {
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
SelectPrimitive.Label,
|
|
86
|
+
{
|
|
87
|
+
"data-slot": "select-label",
|
|
88
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
89
|
+
...props
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function SelectItem({
|
|
94
|
+
className,
|
|
95
|
+
children,
|
|
96
|
+
...props
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsxs(
|
|
99
|
+
SelectPrimitive.Item,
|
|
100
|
+
{
|
|
101
|
+
"data-slot": "select-item",
|
|
102
|
+
className: cn(
|
|
103
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
104
|
+
className
|
|
105
|
+
),
|
|
106
|
+
...props,
|
|
107
|
+
children: [
|
|
108
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
109
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function SelectSeparator({
|
|
115
|
+
className,
|
|
116
|
+
...props
|
|
117
|
+
}) {
|
|
118
|
+
return /* @__PURE__ */ jsx(
|
|
119
|
+
SelectPrimitive.Separator,
|
|
120
|
+
{
|
|
121
|
+
"data-slot": "select-separator",
|
|
122
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
123
|
+
...props
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
function SelectScrollUpButton({
|
|
128
|
+
className,
|
|
129
|
+
...props
|
|
130
|
+
}) {
|
|
131
|
+
return /* @__PURE__ */ jsx(
|
|
132
|
+
SelectPrimitive.ScrollUpButton,
|
|
133
|
+
{
|
|
134
|
+
"data-slot": "select-scroll-up-button",
|
|
135
|
+
className: cn(
|
|
136
|
+
"flex cursor-default items-center justify-center py-1",
|
|
137
|
+
className
|
|
138
|
+
),
|
|
139
|
+
...props,
|
|
140
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
function SelectScrollDownButton({
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}) {
|
|
148
|
+
return /* @__PURE__ */ jsx(
|
|
149
|
+
SelectPrimitive.ScrollDownButton,
|
|
150
|
+
{
|
|
151
|
+
"data-slot": "select-scroll-down-button",
|
|
152
|
+
className: cn(
|
|
153
|
+
"flex cursor-default items-center justify-center py-1",
|
|
154
|
+
className
|
|
155
|
+
),
|
|
156
|
+
...props,
|
|
157
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
14
161
|
export {
|
|
15
162
|
Select,
|
|
16
163
|
SelectContent,
|