@foundrykit/primitives 2.0.6 → 2.0.7
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/.turbo/turbo-build.log +233 -108
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +10 -0
- package/README.md +39 -136
- package/dist/chunk-25N35Z5M.js +42 -0
- package/dist/chunk-2JOT4DV4.js +66 -0
- package/dist/chunk-2PXD7LAX.js +172 -0
- package/dist/{chunk-VSXKLSEP.js → chunk-3BAO7TAS.js} +2 -2
- package/dist/chunk-3MEIDBWZ.js +225 -0
- package/dist/{chunk-A3U73FA7.js → chunk-3UKWAM5M.js} +2 -2
- package/dist/chunk-44I6VK3H.js +105 -0
- package/dist/chunk-46UI3AUE.js +62 -0
- package/dist/{chunk-AADRFFPH.js → chunk-5OSYIETI.js} +4 -4
- package/dist/chunk-67UXTT4O.js +116 -0
- package/dist/{chunk-J57CV3VT.js → chunk-6DRII3XC.js} +2 -2
- package/dist/chunk-727ACUWN.js +82 -0
- package/dist/chunk-76APYFRN.js +29 -0
- package/dist/chunk-AJAAMJYH.js +12 -0
- package/dist/chunk-BIFBYERK.js +69 -0
- package/dist/{chunk-PHMEWMFS.js → chunk-D4X2ZO5T.js} +7 -7
- package/dist/{chunk-UZIMC7AQ.js → chunk-DFGLEAZI.js} +2 -2
- package/dist/chunk-DKBMAFIR.js +65 -0
- package/dist/{chunk-U2EIVYWP.js → chunk-DXZ4GUQO.js} +2 -2
- package/dist/chunk-ED6T7ZZN.js +130 -0
- package/dist/{chunk-J4CRGO2P.js → chunk-EDKSYP4L.js} +2 -2
- package/dist/chunk-EEAK2RWF.js +23 -0
- package/dist/{chunk-FYCANIVJ.js → chunk-FF5D53KL.js} +2 -2
- package/dist/chunk-FIRYLO5W.js +253 -0
- package/dist/chunk-GPEL656S.js +84 -0
- package/dist/chunk-JKKCRFYB.js +36 -0
- package/dist/chunk-JTSIBZS4.js +194 -0
- package/dist/{chunk-QL4XJD7Y.js → chunk-MCXSVXO4.js} +2 -2
- package/dist/chunk-MMZJQ7RW.js +33 -0
- package/dist/{chunk-4GPFVBO2.js → chunk-MYIUX3DT.js} +3 -3
- package/dist/chunk-PAO3DSEF.js +48 -0
- package/dist/chunk-PLLG76QJ.js +32 -0
- package/dist/chunk-R3IEOV2B.js +155 -0
- package/dist/{chunk-KZMSLRLW.js → chunk-RDQF3IQE.js} +2 -2
- package/dist/{chunk-XQAJQKO7.js → chunk-SUEPE6OX.js} +3 -3
- package/dist/chunk-TA23RNS4.js +162 -0
- package/dist/chunk-TRXU4SOJ.js +224 -0
- package/dist/chunk-VA4MKQN7.js +40 -0
- package/dist/chunk-VPBVKBZ7.js +25 -0
- package/dist/{chunk-I44GXEPN.js → chunk-XVIHRZGJ.js} +1 -1
- package/dist/chunk-YT2ZIMZI.js +16 -0
- package/dist/components/accordion/index.cjs +104 -0
- package/dist/components/accordion/index.d.cts +25 -0
- package/dist/components/accordion/index.d.ts +25 -0
- package/dist/components/accordion/index.js +13 -0
- package/dist/components/alert/index.cjs +96 -0
- package/dist/components/alert/index.d.cts +28 -0
- package/dist/components/alert/index.d.ts +28 -0
- package/dist/components/alert/index.js +12 -0
- package/dist/components/alert-dialog/index.cjs +200 -0
- package/dist/components/alert-dialog/index.d.cts +42 -0
- package/dist/components/alert-dialog/index.d.ts +42 -0
- package/dist/components/alert-dialog/index.js +27 -0
- package/dist/components/aspect-ratio/index.cjs +47 -0
- package/dist/components/aspect-ratio/index.d.cts +19 -0
- package/dist/components/aspect-ratio/index.d.ts +19 -0
- package/dist/components/aspect-ratio/index.js +7 -0
- package/dist/components/avatar/index.cjs +1 -1
- package/dist/components/avatar/index.d.cts +16 -1
- package/dist/components/avatar/index.d.ts +16 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/badge/index.cjs +5 -5
- package/dist/components/badge/index.d.cts +13 -2
- package/dist/components/badge/index.d.ts +13 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/breadcrumb/index.cjs +2 -2
- package/dist/components/breadcrumb/index.d.cts +19 -0
- package/dist/components/breadcrumb/index.d.ts +19 -0
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/button/index.cjs +18 -8
- package/dist/components/button/index.d.cts +15 -2
- package/dist/components/button/index.d.ts +15 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/index.cjs +142 -0
- package/dist/components/button-group/index.d.cts +33 -0
- package/dist/components/button-group/index.d.ts +33 -0
- package/dist/components/button-group/index.js +13 -0
- package/dist/components/card/index.cjs +2 -2
- package/dist/components/card/index.d.cts +16 -0
- package/dist/components/card/index.d.ts +16 -0
- package/dist/components/card/index.js +1 -1
- package/dist/components/checkbox/index.cjs +2 -2
- package/dist/components/checkbox/index.d.cts +11 -1
- package/dist/components/checkbox/index.d.ts +11 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/collapsible/index.cjs +73 -0
- package/dist/components/collapsible/index.d.cts +22 -0
- package/dist/components/collapsible/index.d.ts +22 -0
- package/dist/components/collapsible/index.js +11 -0
- package/dist/components/context-menu/index.cjs +274 -0
- package/dist/components/context-menu/index.d.cts +48 -0
- package/dist/components/context-menu/index.d.ts +48 -0
- package/dist/components/context-menu/index.js +35 -0
- package/dist/components/direction/index.cjs +39 -0
- package/dist/components/direction/index.d.cts +20 -0
- package/dist/components/direction/index.d.ts +20 -0
- package/dist/components/direction/index.js +9 -0
- package/dist/components/drawer/index.cjs +164 -0
- package/dist/components/drawer/index.d.cts +35 -0
- package/dist/components/drawer/index.d.ts +35 -0
- package/dist/components/drawer/index.js +25 -0
- package/dist/components/dropdown/index.cjs +7 -7
- package/dist/components/dropdown/index.d.cts +25 -1
- package/dist/components/dropdown/index.d.ts +25 -1
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/empty/index.cjs +135 -0
- package/dist/components/empty/index.d.cts +38 -0
- package/dist/components/empty/index.d.ts +38 -0
- package/dist/components/empty/index.js +18 -0
- package/dist/components/field/index.cjs +269 -0
- package/dist/components/field/index.d.cts +42 -0
- package/dist/components/field/index.d.ts +42 -0
- package/dist/components/field/index.js +27 -0
- package/dist/components/hover-card/index.cjs +77 -0
- package/dist/components/hover-card/index.d.cts +22 -0
- package/dist/components/hover-card/index.d.ts +22 -0
- package/dist/components/hover-card/index.js +11 -0
- package/dist/components/input/index.cjs +2 -2
- package/dist/components/input/index.d.cts +11 -2
- package/dist/components/input/index.d.ts +11 -2
- package/dist/components/input/index.js +1 -1
- package/dist/components/item/index.cjs +262 -0
- package/dist/components/item/index.d.cts +47 -0
- package/dist/components/item/index.d.ts +47 -0
- package/dist/components/item/index.js +29 -0
- package/dist/components/kbd/index.cjs +57 -0
- package/dist/components/kbd/index.d.cts +19 -0
- package/dist/components/kbd/index.d.ts +19 -0
- package/dist/components/kbd/index.js +8 -0
- package/dist/components/label/index.cjs +2 -2
- package/dist/components/label/index.d.cts +10 -1
- package/dist/components/label/index.d.ts +10 -1
- package/dist/components/label/index.js +1 -1
- package/dist/components/menubar/index.cjs +303 -0
- package/dist/components/menubar/index.d.cts +49 -0
- package/dist/components/menubar/index.d.ts +49 -0
- package/dist/components/menubar/index.js +37 -0
- package/dist/components/native-select/index.cjs +53 -0
- package/dist/components/native-select/index.d.cts +19 -0
- package/dist/components/native-select/index.d.ts +19 -0
- package/dist/components/native-select/index.js +6 -0
- package/dist/components/navigation-menu/index.cjs +215 -0
- package/dist/components/navigation-menu/index.d.cts +37 -0
- package/dist/components/navigation-menu/index.d.ts +37 -0
- package/dist/components/navigation-menu/index.js +23 -0
- package/dist/components/popover/index.cjs +2 -2
- package/dist/components/popover/index.d.cts +14 -1
- package/dist/components/popover/index.d.ts +14 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/progress/index.cjs +68 -0
- package/dist/components/progress/index.d.cts +16 -0
- package/dist/components/progress/index.d.ts +16 -0
- package/dist/components/progress/index.js +7 -0
- package/dist/components/radio-group/index.cjs +3 -3
- package/dist/components/radio-group/index.d.cts +15 -1
- package/dist/components/radio-group/index.d.ts +15 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/resizable/index.cjs +75 -0
- package/dist/components/resizable/index.d.cts +25 -0
- package/dist/components/resizable/index.d.ts +25 -0
- package/dist/components/resizable/index.js +11 -0
- package/dist/components/scroll-area/index.cjs +3 -3
- package/dist/components/scroll-area/index.d.cts +14 -1
- package/dist/components/scroll-area/index.d.ts +14 -1
- package/dist/components/scroll-area/index.js +1 -1
- package/dist/components/select/index.cjs +4 -4
- package/dist/components/select/index.d.cts +19 -1
- package/dist/components/select/index.d.ts +19 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/separator/index.cjs +2 -2
- package/dist/components/separator/index.d.cts +12 -1
- package/dist/components/separator/index.d.ts +12 -1
- package/dist/components/separator/index.js +1 -1
- package/dist/components/skeleton/index.d.cts +9 -0
- package/dist/components/skeleton/index.d.ts +9 -0
- package/dist/components/slider/index.cjs +100 -0
- package/dist/components/slider/index.d.cts +18 -0
- package/dist/components/slider/index.d.ts +18 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/sonner/index.cjs +51 -0
- package/dist/components/sonner/index.d.cts +18 -0
- package/dist/components/sonner/index.d.ts +18 -0
- package/dist/components/sonner/index.js +9 -0
- package/dist/components/spinner/index.cjs +47 -0
- package/dist/components/spinner/index.d.cts +17 -0
- package/dist/components/spinner/index.d.ts +17 -0
- package/dist/components/spinner/index.js +6 -0
- package/dist/components/switch/index.cjs +2 -2
- package/dist/components/switch/index.d.cts +11 -1
- package/dist/components/switch/index.d.ts +11 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/table/index.cjs +147 -0
- package/dist/components/table/index.d.cts +35 -0
- package/dist/components/table/index.d.ts +35 -0
- package/dist/components/table/index.js +20 -0
- package/dist/components/tabs/index.cjs +2 -2
- package/dist/components/tabs/index.d.cts +18 -1
- package/dist/components/tabs/index.d.ts +18 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.d.cts +9 -0
- package/dist/components/textarea/index.d.ts +9 -0
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/toggle-group/index.cjs +120 -0
- package/dist/components/toggle-group/index.d.cts +27 -0
- package/dist/components/toggle-group/index.d.ts +27 -0
- package/dist/components/toggle-group/index.js +9 -0
- package/dist/components/typography/index.cjs +197 -0
- package/dist/components/typography/index.d.cts +28 -0
- package/dist/components/typography/index.d.ts +28 -0
- package/dist/components/typography/index.js +28 -0
- package/dist/index.cjs +3272 -781
- package/dist/index.d.cts +128 -24
- package/dist/index.d.ts +128 -24
- package/dist/index.js +485 -144
- package/package.json +25 -8
- package/postcss.config.mjs +1 -1
- package/registry.json +18 -5
- package/src/components/accordion/config.ts +28 -0
- package/src/components/accordion/index.tsx +80 -0
- package/src/components/alert/config.ts +40 -0
- package/src/components/alert/index.tsx +80 -0
- package/src/components/alert-dialog/config.ts +28 -0
- package/src/components/alert-dialog/index.tsx +188 -0
- package/src/components/aspect-ratio/config.ts +27 -0
- package/src/components/aspect-ratio/index.tsx +24 -0
- package/src/components/avatar/config.ts +1 -1
- package/src/components/avatar/index.tsx +18 -4
- package/src/components/badge/config.ts +1 -1
- package/src/components/badge/index.tsx +17 -7
- package/src/components/breadcrumb/config.ts +1 -1
- package/src/components/breadcrumb/index.tsx +24 -6
- package/src/components/button/config.ts +21 -1
- package/src/components/button/index.tsx +33 -9
- package/src/components/button-group/config.ts +39 -0
- package/src/components/button-group/index.tsx +99 -0
- package/src/components/card/config.ts +1 -1
- package/src/components/card/index.tsx +21 -6
- package/src/components/checkbox/config.ts +1 -1
- package/src/components/checkbox/index.tsx +13 -4
- package/src/components/collapsible/config.ts +27 -0
- package/src/components/collapsible/index.tsx +47 -0
- package/src/components/context-menu/config.ts +28 -0
- package/src/components/context-menu/index.tsx +271 -0
- package/src/components/dialog/config.ts +1 -1
- package/src/components/dialog/index.tsx +25 -6
- package/src/components/direction/config.ts +28 -0
- package/src/components/direction/index.tsx +27 -0
- package/src/components/drawer/config.ts +28 -0
- package/src/components/drawer/index.tsx +153 -0
- package/src/components/dropdown/config.ts +1 -1
- package/src/components/dropdown/index.tsx +37 -14
- package/src/components/empty/config.ts +38 -0
- package/src/components/empty/index.tsx +127 -0
- package/src/components/field/config.ts +40 -0
- package/src/components/field/index.tsx +252 -0
- package/src/components/hover-card/config.ts +27 -0
- package/src/components/hover-card/index.tsx +56 -0
- package/src/components/input/config.ts +1 -1
- package/src/components/input/index.tsx +13 -5
- package/src/components/input-group/index.tsx +33 -12
- package/src/components/item/config.ts +52 -0
- package/src/components/item/index.tsx +215 -0
- package/src/components/kbd/config.ts +38 -0
- package/src/components/kbd/index.tsx +40 -0
- package/src/components/label/config.ts +1 -1
- package/src/components/label/index.tsx +12 -4
- package/src/components/menubar/config.ts +28 -0
- package/src/components/menubar/index.tsx +295 -0
- package/src/components/native-select/config.ts +40 -0
- package/src/components/native-select/index.tsx +40 -0
- package/src/components/navigation-menu/config.ts +32 -0
- package/src/components/navigation-menu/index.tsx +188 -0
- package/src/components/popover/config.ts +1 -1
- package/src/components/popover/index.tsx +17 -5
- package/src/components/progress/config.ts +42 -0
- package/src/components/progress/index.tsx +39 -0
- package/src/components/radio-group/config.ts +1 -1
- package/src/components/radio-group/index.tsx +18 -5
- package/src/components/resizable/config.ts +28 -0
- package/src/components/resizable/index.tsx +67 -0
- package/src/components/scroll-area/index.tsx +17 -5
- package/src/components/select/config.ts +1 -1
- package/src/components/select/index.tsx +23 -6
- package/src/components/separator/config.ts +1 -1
- package/src/components/separator/index.tsx +14 -4
- package/src/components/sheet/index.tsx +21 -7
- package/src/components/skeleton/config.ts +1 -1
- package/src/components/skeleton/index.tsx +9 -0
- package/src/components/slider/config.ts +46 -0
- package/src/components/slider/index.tsx +73 -0
- package/src/components/sonner/config.ts +27 -0
- package/src/components/sonner/index.tsx +37 -0
- package/src/components/spinner/config.ts +40 -0
- package/src/components/spinner/index.tsx +30 -0
- package/src/components/switch/config.ts +1 -1
- package/src/components/switch/index.tsx +13 -4
- package/src/components/table/config.ts +38 -0
- package/src/components/table/index.tsx +135 -0
- package/src/components/tabs/config.ts +1 -1
- package/src/components/tabs/index.tsx +21 -5
- package/src/components/textarea/config.ts +1 -1
- package/src/components/textarea/index.tsx +11 -3
- package/src/components/toggle/index.tsx +20 -8
- package/src/components/toggle-group/config.ts +46 -0
- package/src/components/toggle-group/index.tsx +106 -0
- package/src/components/tooltip/index.tsx +19 -5
- package/src/components/typography/config.ts +38 -0
- package/src/components/typography/index.tsx +172 -0
- package/src/index.ts +239 -53
- package/tsup.config.ts +25 -0
- package/dist/chunk-FUWID6MC.js +0 -42
- package/dist/chunk-YTUI6MCB.js +0 -52
- package/eslint.config.js +0 -4
- package/dist/{chunk-VVNIYCKH.js → chunk-3TZXV53R.js} +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// src/components/button/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var buttonVariants = cva(
|
|
7
|
+
"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 shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all 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",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90 shadow-xs",
|
|
12
|
+
destructive: "bg-destructive hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 text-white shadow-xs",
|
|
13
|
+
outline: "bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 border shadow-xs",
|
|
14
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 shadow-xs",
|
|
15
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
16
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
17
|
+
"inline-link": "inline align-baseline text-inherit underline underline-offset-4 hover:text-inherit",
|
|
18
|
+
navlink: "text-foreground hover:text-accent-foreground underline-offset-4 hover:underline"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
22
|
+
sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
|
|
23
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
24
|
+
icon: "size-9"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
// The link-style variants read as inline text, not a button box: strip the
|
|
28
|
+
// height/padding/radius that `size` would otherwise apply, across all sizes.
|
|
29
|
+
compoundVariants: [
|
|
30
|
+
{
|
|
31
|
+
variant: ["inline-link", "navlink"],
|
|
32
|
+
className: "h-auto rounded-none p-0 has-[>svg]:px-0"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
size: "default"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
function Button({
|
|
42
|
+
className,
|
|
43
|
+
variant,
|
|
44
|
+
size,
|
|
45
|
+
asChild = false,
|
|
46
|
+
...props
|
|
47
|
+
}) {
|
|
48
|
+
const Comp = asChild ? Slot : "button";
|
|
49
|
+
return /* @__PURE__ */ jsx(
|
|
50
|
+
Comp,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "button",
|
|
53
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
54
|
+
...props
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
buttonVariants,
|
|
61
|
+
Button
|
|
62
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/select/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
2
3
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3
4
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
4
|
-
import { cn } from "@foundrykit/utils";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
function Select({
|
|
7
7
|
...props
|
|
@@ -30,7 +30,7 @@ function SelectTrigger({
|
|
|
30
30
|
"data-slot": "select-trigger",
|
|
31
31
|
"data-size": size,
|
|
32
32
|
className: cn(
|
|
33
|
-
"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
|
|
33
|
+
"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",
|
|
34
34
|
className
|
|
35
35
|
),
|
|
36
36
|
...props,
|
|
@@ -52,7 +52,7 @@ function SelectContent({
|
|
|
52
52
|
{
|
|
53
53
|
"data-slot": "select-content",
|
|
54
54
|
className: cn(
|
|
55
|
-
"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 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 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin)
|
|
55
|
+
"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 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 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",
|
|
56
56
|
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",
|
|
57
57
|
className
|
|
58
58
|
),
|
|
@@ -98,7 +98,7 @@ function SelectItem({
|
|
|
98
98
|
{
|
|
99
99
|
"data-slot": "select-item",
|
|
100
100
|
className: cn(
|
|
101
|
-
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
101
|
+
"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",
|
|
102
102
|
className
|
|
103
103
|
),
|
|
104
104
|
...props,
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// src/components/table/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function Table({ className, ...props }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
"data-slot": "table-container",
|
|
9
|
+
className: "relative w-full overflow-x-auto",
|
|
10
|
+
children: /* @__PURE__ */ jsx(
|
|
11
|
+
"table",
|
|
12
|
+
{
|
|
13
|
+
"data-slot": "table",
|
|
14
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
15
|
+
...props
|
|
16
|
+
}
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function TableHeader({ className, ...props }) {
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
"thead",
|
|
24
|
+
{
|
|
25
|
+
"data-slot": "table-header",
|
|
26
|
+
className: cn("[&_tr]:border-b", className),
|
|
27
|
+
...props
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
function TableBody({ className, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
"tbody",
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "table-body",
|
|
36
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
function TableFooter({ className, ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(
|
|
43
|
+
"tfoot",
|
|
44
|
+
{
|
|
45
|
+
"data-slot": "table-footer",
|
|
46
|
+
className: cn(
|
|
47
|
+
"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function TableRow({ className, ...props }) {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"tr",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "table-row",
|
|
59
|
+
className: cn(
|
|
60
|
+
"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
|
|
61
|
+
className
|
|
62
|
+
),
|
|
63
|
+
...props
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
function TableHead({ className, ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsx(
|
|
69
|
+
"th",
|
|
70
|
+
{
|
|
71
|
+
"data-slot": "table-head",
|
|
72
|
+
className: cn(
|
|
73
|
+
"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
...props
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function TableCell({ className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx(
|
|
82
|
+
"td",
|
|
83
|
+
{
|
|
84
|
+
"data-slot": "table-cell",
|
|
85
|
+
className: cn(
|
|
86
|
+
"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
87
|
+
className
|
|
88
|
+
),
|
|
89
|
+
...props
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
function TableCaption({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ jsx(
|
|
98
|
+
"caption",
|
|
99
|
+
{
|
|
100
|
+
"data-slot": "table-caption",
|
|
101
|
+
className: cn("text-muted-foreground mt-4 text-sm", className),
|
|
102
|
+
...props
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
Table,
|
|
109
|
+
TableHeader,
|
|
110
|
+
TableBody,
|
|
111
|
+
TableFooter,
|
|
112
|
+
TableRow,
|
|
113
|
+
TableHead,
|
|
114
|
+
TableCell,
|
|
115
|
+
TableCaption
|
|
116
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/separator/index.tsx
|
|
2
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
2
|
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function Separator({
|
|
6
6
|
className,
|
|
@@ -15,7 +15,7 @@ function Separator({
|
|
|
15
15
|
decorative,
|
|
16
16
|
orientation,
|
|
17
17
|
className: cn(
|
|
18
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=
|
|
18
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
19
19
|
className
|
|
20
20
|
),
|
|
21
21
|
...props
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Separator
|
|
3
|
+
} from "./chunk-6DRII3XC.js";
|
|
4
|
+
|
|
5
|
+
// src/components/button-group/index.tsx
|
|
6
|
+
import { cn } from "@foundrykit/utils";
|
|
7
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var buttonGroupVariants = cva(
|
|
11
|
+
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
orientation: {
|
|
15
|
+
horizontal: "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
|
|
16
|
+
vertical: "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
orientation: "horizontal"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
function ButtonGroup({
|
|
25
|
+
className,
|
|
26
|
+
orientation,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
"data-slot": "button-group",
|
|
33
|
+
"data-orientation": orientation,
|
|
34
|
+
role: "group",
|
|
35
|
+
className: cn(buttonGroupVariants({ orientation }), className),
|
|
36
|
+
...props
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function ButtonGroupText({
|
|
41
|
+
className,
|
|
42
|
+
asChild = false,
|
|
43
|
+
...props
|
|
44
|
+
}) {
|
|
45
|
+
const Comp = asChild ? Slot : "div";
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
Comp,
|
|
48
|
+
{
|
|
49
|
+
"data-slot": "button-group-text",
|
|
50
|
+
className: cn(
|
|
51
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
...props
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
function ButtonGroupSeparator({
|
|
59
|
+
className,
|
|
60
|
+
orientation = "vertical",
|
|
61
|
+
...props
|
|
62
|
+
}) {
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
Separator,
|
|
65
|
+
{
|
|
66
|
+
"data-slot": "button-group-separator",
|
|
67
|
+
orientation,
|
|
68
|
+
className: cn(
|
|
69
|
+
"bg-input relative !m-0 self-stretch data-[orientation=vertical]:h-auto",
|
|
70
|
+
className
|
|
71
|
+
),
|
|
72
|
+
...props
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export {
|
|
78
|
+
buttonGroupVariants,
|
|
79
|
+
ButtonGroup,
|
|
80
|
+
ButtonGroupText,
|
|
81
|
+
ButtonGroupSeparator
|
|
82
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// src/components/native-select/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
function NativeSelect({
|
|
6
|
+
className,
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { "data-slot": "native-select-wrapper", className: "relative w-full", children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
"select",
|
|
13
|
+
{
|
|
14
|
+
"data-slot": "native-select",
|
|
15
|
+
className: cn(
|
|
16
|
+
"border-input text-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 [&>option]:text-foreground flex h-9 w-full appearance-none items-center rounded-md border bg-transparent py-2 pr-8 pl-3 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...props,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none absolute top-1/2 right-3 size-4 -translate-y-1/2 opacity-50" })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
NativeSelect
|
|
29
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/components/aspect-ratio/index.tsx
|
|
2
|
+
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
function AspectRatio({
|
|
5
|
+
...props
|
|
6
|
+
}) {
|
|
7
|
+
return /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
AspectRatio
|
|
12
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/components/alert/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var alertVariants = cva(
|
|
6
|
+
"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-background text-foreground",
|
|
11
|
+
destructive: "text-destructive bg-background *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
variant: "default"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
function Alert({
|
|
20
|
+
className,
|
|
21
|
+
variant,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "alert",
|
|
28
|
+
role: "alert",
|
|
29
|
+
className: cn(alertVariants({ variant }), className),
|
|
30
|
+
...props
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function AlertTitle({ className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "alert-title",
|
|
39
|
+
className: cn(
|
|
40
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
43
|
+
...props
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
function AlertDescription({
|
|
48
|
+
className,
|
|
49
|
+
...props
|
|
50
|
+
}) {
|
|
51
|
+
return /* @__PURE__ */ jsx(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
"data-slot": "alert-description",
|
|
55
|
+
className: cn(
|
|
56
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
57
|
+
className
|
|
58
|
+
),
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
alertVariants,
|
|
66
|
+
Alert,
|
|
67
|
+
AlertTitle,
|
|
68
|
+
AlertDescription
|
|
69
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/dropdown/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
2
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
4
|
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
4
|
-
import { cn } from "@foundrykit/utils";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
function DropdownMenu({
|
|
7
7
|
...props
|
|
@@ -35,7 +35,7 @@ function DropdownMenuContent({
|
|
|
35
35
|
"data-slot": "dropdown-menu-content",
|
|
36
36
|
sideOffset,
|
|
37
37
|
className: cn(
|
|
38
|
-
"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 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 max-h-(--radix-dropdown-menu-content-available-height) origin-(--radix-dropdown-menu-content-transform-origin)
|
|
38
|
+
"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 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
39
39
|
className
|
|
40
40
|
),
|
|
41
41
|
...props
|
|
@@ -60,7 +60,7 @@ function DropdownMenuItem({
|
|
|
60
60
|
"data-inset": inset,
|
|
61
61
|
"data-variant": variant,
|
|
62
62
|
className: cn(
|
|
63
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
63
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
64
64
|
className
|
|
65
65
|
),
|
|
66
66
|
...props
|
|
@@ -78,7 +78,7 @@ function DropdownMenuCheckboxItem({
|
|
|
78
78
|
{
|
|
79
79
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
80
80
|
className: cn(
|
|
81
|
-
"focus:bg-accent focus:text-accent-foreground
|
|
81
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 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",
|
|
82
82
|
className
|
|
83
83
|
),
|
|
84
84
|
checked,
|
|
@@ -111,7 +111,7 @@ function DropdownMenuRadioItem({
|
|
|
111
111
|
{
|
|
112
112
|
"data-slot": "dropdown-menu-radio-item",
|
|
113
113
|
className: cn(
|
|
114
|
-
"focus:bg-accent focus:text-accent-foreground
|
|
114
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 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",
|
|
115
115
|
className
|
|
116
116
|
),
|
|
117
117
|
...props,
|
|
@@ -186,7 +186,7 @@ function DropdownMenuSubTrigger({
|
|
|
186
186
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
187
187
|
"data-inset": inset,
|
|
188
188
|
className: cn(
|
|
189
|
-
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground
|
|
189
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
|
|
190
190
|
className
|
|
191
191
|
),
|
|
192
192
|
...props,
|
|
@@ -206,7 +206,7 @@ function DropdownMenuSubContent({
|
|
|
206
206
|
{
|
|
207
207
|
"data-slot": "dropdown-menu-sub-content",
|
|
208
208
|
className: cn(
|
|
209
|
-
"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 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 origin-(--radix-dropdown-menu-content-transform-origin)
|
|
209
|
+
"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 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 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
210
210
|
className
|
|
211
211
|
),
|
|
212
212
|
...props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/card/index.tsx
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
var Card = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6
6
|
"div",
|
|
@@ -27,7 +27,7 @@ var CardTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
27
27
|
"h3",
|
|
28
28
|
{
|
|
29
29
|
ref,
|
|
30
|
-
className: cn("font-semibold
|
|
30
|
+
className: cn("leading-none font-semibold tracking-tight", className),
|
|
31
31
|
...props
|
|
32
32
|
}
|
|
33
33
|
));
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// src/components/slider/index.tsx
|
|
2
|
+
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
function Slider({
|
|
7
|
+
className,
|
|
8
|
+
defaultValue,
|
|
9
|
+
value,
|
|
10
|
+
min = 0,
|
|
11
|
+
max = 100,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
const _values = React.useMemo(
|
|
15
|
+
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
16
|
+
[value, defaultValue, min, max]
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ jsxs(
|
|
19
|
+
SliderPrimitive.Root,
|
|
20
|
+
{
|
|
21
|
+
"data-slot": "slider",
|
|
22
|
+
defaultValue,
|
|
23
|
+
value,
|
|
24
|
+
min,
|
|
25
|
+
max,
|
|
26
|
+
className: cn(
|
|
27
|
+
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
28
|
+
className
|
|
29
|
+
),
|
|
30
|
+
...props,
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
SliderPrimitive.Track,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "slider-track",
|
|
36
|
+
className: cn(
|
|
37
|
+
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
38
|
+
),
|
|
39
|
+
children: /* @__PURE__ */ jsx(
|
|
40
|
+
SliderPrimitive.Range,
|
|
41
|
+
{
|
|
42
|
+
"data-slot": "slider-range",
|
|
43
|
+
className: cn(
|
|
44
|
+
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
Array.from({ length: _values.length }, (_, index) => /* @__PURE__ */ jsx(
|
|
51
|
+
SliderPrimitive.Thumb,
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "slider-thumb",
|
|
54
|
+
className: "border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
55
|
+
},
|
|
56
|
+
index
|
|
57
|
+
))
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
Slider
|
|
65
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/components/switch/index.tsx
|
|
2
|
-
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
2
|
import { cn } from "@foundrykit/utils";
|
|
3
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
function Switch({
|
|
6
6
|
className,
|
|
@@ -11,7 +11,7 @@ function Switch({
|
|
|
11
11
|
{
|
|
12
12
|
"data-slot": "switch",
|
|
13
13
|
className: cn(
|
|
14
|
-
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80
|
|
14
|
+
"data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
15
15
|
className
|
|
16
16
|
),
|
|
17
17
|
...props,
|