@foundrykit/primitives 2.0.5 → 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 +235 -73
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +19 -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 +486 -145
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foundrykit/primitives",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,20 +20,32 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@radix-ui/react-accordion": "^1.2.17",
|
|
24
|
+
"@radix-ui/react-alert-dialog": "^1.1.20",
|
|
25
|
+
"@radix-ui/react-aspect-ratio": "^1.1.12",
|
|
23
26
|
"@radix-ui/react-avatar": "^1.1.3",
|
|
24
27
|
"@radix-ui/react-checkbox": "^1.3.3",
|
|
28
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
29
|
+
"@radix-ui/react-context-menu": "^2.3.4",
|
|
25
30
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
31
|
+
"@radix-ui/react-direction": "^1.1.2",
|
|
26
32
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
33
|
+
"@radix-ui/react-hover-card": "^1.1.20",
|
|
27
34
|
"@radix-ui/react-label": "^2.1.7",
|
|
35
|
+
"@radix-ui/react-menubar": "^1.1.21",
|
|
36
|
+
"@radix-ui/react-navigation-menu": "^1.2.19",
|
|
28
37
|
"@radix-ui/react-popover": "^1.1.15",
|
|
38
|
+
"@radix-ui/react-progress": "^1.1.13",
|
|
29
39
|
"@radix-ui/react-radio-group": "^1.3.8",
|
|
30
40
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
31
41
|
"@radix-ui/react-select": "^2.2.6",
|
|
32
42
|
"@radix-ui/react-separator": "^1.1.7",
|
|
43
|
+
"@radix-ui/react-slider": "^1.4.4",
|
|
33
44
|
"@radix-ui/react-slot": "^1.2.3",
|
|
34
45
|
"@radix-ui/react-switch": "^1.2.6",
|
|
35
46
|
"@radix-ui/react-tabs": "^1.1.13",
|
|
36
47
|
"@radix-ui/react-toggle": "^1.1.10",
|
|
48
|
+
"@radix-ui/react-toggle-group": "^1.1.16",
|
|
37
49
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
38
50
|
"class-variance-authority": "^0.7.1",
|
|
39
51
|
"clsx": "^2.1.1",
|
|
@@ -41,30 +53,35 @@
|
|
|
41
53
|
"next-themes": "^0.4.6",
|
|
42
54
|
"react": "^19.1.1",
|
|
43
55
|
"react-dom": "^19.1.1",
|
|
56
|
+
"react-resizable-panels": "^4.12.2",
|
|
57
|
+
"sonner": "^2.0.7",
|
|
44
58
|
"tailwind-merge": "^3.3.1",
|
|
59
|
+
"vaul": "^1.1.2",
|
|
45
60
|
"zod": "^3.25.76",
|
|
46
|
-
"@foundrykit/types": "2.0.
|
|
47
|
-
"@foundrykit/utils": "1.0.
|
|
61
|
+
"@foundrykit/types": "2.0.7",
|
|
62
|
+
"@foundrykit/utils": "1.0.7"
|
|
48
63
|
},
|
|
49
64
|
"devDependencies": {
|
|
50
65
|
"@types/node": "^20.19.9",
|
|
51
66
|
"@types/react": "^19.1.9",
|
|
52
67
|
"@types/react-dom": "^19.1.7",
|
|
53
|
-
"eslint": "^9.0.0",
|
|
54
68
|
"fs-extra": "^11.2.0",
|
|
55
69
|
"tsup": "^8.0.0",
|
|
56
70
|
"typescript": "^5.9.2",
|
|
57
|
-
"@foundrykit/typescript-config": "1.0.
|
|
58
|
-
"@foundrykit/eslint-config": "1.0.5"
|
|
71
|
+
"@foundrykit/typescript-config": "1.0.6"
|
|
59
72
|
},
|
|
60
73
|
"peerDependencies": {
|
|
61
74
|
"react": "^19.1.1",
|
|
62
75
|
"react-dom": "^19.1.1"
|
|
63
76
|
},
|
|
77
|
+
"repository": {
|
|
78
|
+
"type": "git",
|
|
79
|
+
"url": "git+https://github.com/umi-labs/foundry.git",
|
|
80
|
+
"directory": "packages/primitives"
|
|
81
|
+
},
|
|
64
82
|
"scripts": {
|
|
65
|
-
"build": "tsup --dts --format esm,cjs --clean",
|
|
83
|
+
"build": "NODE_OPTIONS=--max-old-space-size=8192 tsup --dts --format esm,cjs --clean",
|
|
66
84
|
"dev": "tsup --watch",
|
|
67
|
-
"lint": "eslint . --max-warnings 0",
|
|
68
85
|
"type-check": "tsc --noEmit"
|
|
69
86
|
}
|
|
70
87
|
}
|
package/postcss.config.mjs
CHANGED
package/registry.json
CHANGED
|
@@ -8,13 +8,20 @@
|
|
|
8
8
|
"tags": ["form", "interactive"],
|
|
9
9
|
"files": ["components/button.tsx"],
|
|
10
10
|
"props": {
|
|
11
|
-
"variant": [
|
|
11
|
+
"variant": [
|
|
12
|
+
"default",
|
|
13
|
+
"destructive",
|
|
14
|
+
"outline",
|
|
15
|
+
"secondary",
|
|
16
|
+
"ghost",
|
|
17
|
+
"link"
|
|
18
|
+
],
|
|
12
19
|
"size": ["default", "sm", "lg", "icon"],
|
|
13
20
|
"asChild": "boolean"
|
|
14
21
|
}
|
|
15
22
|
},
|
|
16
23
|
{
|
|
17
|
-
"name": "input",
|
|
24
|
+
"name": "input",
|
|
18
25
|
"description": "Form input component with consistent styling",
|
|
19
26
|
"tags": ["form"],
|
|
20
27
|
"files": ["components/input.tsx"],
|
|
@@ -26,7 +33,7 @@
|
|
|
26
33
|
},
|
|
27
34
|
{
|
|
28
35
|
"name": "badge",
|
|
29
|
-
"description": "Small status indicators and labels",
|
|
36
|
+
"description": "Small status indicators and labels",
|
|
30
37
|
"tags": ["status", "label"],
|
|
31
38
|
"files": ["components/badge.tsx"],
|
|
32
39
|
"props": {
|
|
@@ -36,9 +43,15 @@
|
|
|
36
43
|
{
|
|
37
44
|
"name": "card",
|
|
38
45
|
"description": "Container for content sections",
|
|
39
|
-
"tags": ["layout", "container"],
|
|
46
|
+
"tags": ["layout", "container"],
|
|
40
47
|
"files": ["components/card.tsx"],
|
|
41
|
-
"subcomponents": [
|
|
48
|
+
"subcomponents": [
|
|
49
|
+
"CardHeader",
|
|
50
|
+
"CardTitle",
|
|
51
|
+
"CardDescription",
|
|
52
|
+
"CardContent",
|
|
53
|
+
"CardFooter"
|
|
54
|
+
]
|
|
42
55
|
},
|
|
43
56
|
{
|
|
44
57
|
"name": "avatar",
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
+
|
|
3
|
+
export const AccordionConfig: ComponentConfig = {
|
|
4
|
+
name: 'Accordion',
|
|
5
|
+
description:
|
|
6
|
+
'A vertically stacked set of interactive headings that each reveal a section of content.',
|
|
7
|
+
category: 'primitives',
|
|
8
|
+
tags: ['accordion', 'disclosure', 'interactive'],
|
|
9
|
+
preview: {
|
|
10
|
+
type: 'static',
|
|
11
|
+
html: '<div class="flex h-12 w-full items-center justify-between rounded-md border border-gray-300 bg-gray-100 px-3"><span class="text-sm text-gray-600">Accordion</span><div class="h-2 w-2 rotate-45 border-b border-r border-gray-400"></div></div>',
|
|
12
|
+
},
|
|
13
|
+
variants: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Default',
|
|
16
|
+
description: 'Default accordion',
|
|
17
|
+
code: '<Accordion type="single" collapsible>...</Accordion>',
|
|
18
|
+
preview: {
|
|
19
|
+
type: 'component',
|
|
20
|
+
component: 'Accordion',
|
|
21
|
+
props: {},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
dependencies: ['utils'],
|
|
26
|
+
packageDependencies: ['@radix-ui/react-accordion', 'lucide-react'],
|
|
27
|
+
files: ['components/primitives/accordion/index.tsx'],
|
|
28
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@foundrykit/utils';
|
|
4
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
5
|
+
import { ChevronDownIcon } from 'lucide-react';
|
|
6
|
+
import type * as React from 'react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Vertically stacked set of interactive headings built on Radix
|
|
10
|
+
* `Accordion.Root`. Compose with {@link AccordionItem},
|
|
11
|
+
* {@link AccordionTrigger} and {@link AccordionContent}.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Accordion type="single" collapsible>
|
|
16
|
+
* <AccordionItem value="item-1">
|
|
17
|
+
* <AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
18
|
+
* <AccordionContent>Yes. It follows WAI-ARIA.</AccordionContent>
|
|
19
|
+
* </AccordionItem>
|
|
20
|
+
* </Accordion>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function Accordion({
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Root>) {
|
|
26
|
+
return <AccordionPrimitive.Root data-slot='accordion' {...props} />;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function AccordionItem({
|
|
30
|
+
className,
|
|
31
|
+
...props
|
|
32
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Item>) {
|
|
33
|
+
return (
|
|
34
|
+
<AccordionPrimitive.Item
|
|
35
|
+
data-slot='accordion-item'
|
|
36
|
+
className={cn('border-b last:border-b-0', className)}
|
|
37
|
+
{...props}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function AccordionTrigger({
|
|
43
|
+
className,
|
|
44
|
+
children,
|
|
45
|
+
...props
|
|
46
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Trigger>) {
|
|
47
|
+
return (
|
|
48
|
+
<AccordionPrimitive.Header className='flex'>
|
|
49
|
+
<AccordionPrimitive.Trigger
|
|
50
|
+
data-slot='accordion-trigger'
|
|
51
|
+
className={cn(
|
|
52
|
+
'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',
|
|
53
|
+
className
|
|
54
|
+
)}
|
|
55
|
+
{...props}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
<ChevronDownIcon className='text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200' />
|
|
59
|
+
</AccordionPrimitive.Trigger>
|
|
60
|
+
</AccordionPrimitive.Header>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function AccordionContent({
|
|
65
|
+
className,
|
|
66
|
+
children,
|
|
67
|
+
...props
|
|
68
|
+
}: React.ComponentProps<typeof AccordionPrimitive.Content>) {
|
|
69
|
+
return (
|
|
70
|
+
<AccordionPrimitive.Content
|
|
71
|
+
data-slot='accordion-content'
|
|
72
|
+
className='data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm'
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
<div className={cn('pt-0 pb-4', className)}>{children}</div>
|
|
76
|
+
</AccordionPrimitive.Content>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
+
|
|
3
|
+
export const AlertConfig: ComponentConfig = {
|
|
4
|
+
name: 'Alert',
|
|
5
|
+
description:
|
|
6
|
+
'Displays a callout for user attention with an optional icon, title, and description.',
|
|
7
|
+
category: 'primitives',
|
|
8
|
+
tags: ['alert', 'callout', 'feedback'],
|
|
9
|
+
preview: {
|
|
10
|
+
type: 'static',
|
|
11
|
+
html: '<div class="w-full rounded-lg border border-gray-300 bg-gray-100 px-4 py-3"><div class="mb-1 h-3 w-24 rounded bg-gray-400"></div><div class="h-2 w-40 rounded bg-gray-300"></div></div>',
|
|
12
|
+
},
|
|
13
|
+
variants: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Default',
|
|
16
|
+
description: 'Default alert',
|
|
17
|
+
code: '<Alert><AlertTitle>Heads up!</AlertTitle><AlertDescription>You can add components.</AlertDescription></Alert>',
|
|
18
|
+
preview: {
|
|
19
|
+
type: 'component',
|
|
20
|
+
component: 'Alert',
|
|
21
|
+
props: {},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Destructive',
|
|
26
|
+
description: 'Destructive alert',
|
|
27
|
+
code: '<Alert variant="destructive"><AlertTitle>Error</AlertTitle><AlertDescription>Something went wrong.</AlertDescription></Alert>',
|
|
28
|
+
preview: {
|
|
29
|
+
type: 'component',
|
|
30
|
+
component: 'Alert',
|
|
31
|
+
props: {
|
|
32
|
+
variant: 'destructive',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
dependencies: ['utils'],
|
|
38
|
+
packageDependencies: ['class-variance-authority'],
|
|
39
|
+
files: ['components/primitives/alert/index.tsx'],
|
|
40
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { cn } from '@foundrykit/utils';
|
|
2
|
+
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type * as React from 'react';
|
|
4
|
+
|
|
5
|
+
const 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:
|
|
12
|
+
'text-destructive bg-background *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
defaultVariants: {
|
|
16
|
+
variant: 'default',
|
|
17
|
+
},
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Callout banner for surfacing a short, important message. Compose with
|
|
23
|
+
* {@link AlertTitle} and {@link AlertDescription}, and optionally lead with a
|
|
24
|
+
* lucide icon. Styled via {@link alertVariants} with a `variant`
|
|
25
|
+
* (default, destructive).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Alert variant="destructive">
|
|
30
|
+
* <AlertCircleIcon />
|
|
31
|
+
* <AlertTitle>Something went wrong</AlertTitle>
|
|
32
|
+
* <AlertDescription>Please try again later.</AlertDescription>
|
|
33
|
+
* </Alert>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
function Alert({
|
|
37
|
+
className,
|
|
38
|
+
variant,
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof alertVariants>) {
|
|
41
|
+
return (
|
|
42
|
+
<div
|
|
43
|
+
data-slot='alert'
|
|
44
|
+
role='alert'
|
|
45
|
+
className={cn(alertVariants({ variant }), className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
52
|
+
return (
|
|
53
|
+
<div
|
|
54
|
+
data-slot='alert-title'
|
|
55
|
+
className={cn(
|
|
56
|
+
'col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight',
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
/>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function AlertDescription({
|
|
65
|
+
className,
|
|
66
|
+
...props
|
|
67
|
+
}: React.ComponentProps<'div'>) {
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
data-slot='alert-description'
|
|
71
|
+
className={cn(
|
|
72
|
+
'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
|
|
73
|
+
className
|
|
74
|
+
)}
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { Alert, AlertDescription, AlertTitle, alertVariants };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
+
|
|
3
|
+
export const AlertDialogConfig: ComponentConfig = {
|
|
4
|
+
name: 'Alert Dialog',
|
|
5
|
+
description:
|
|
6
|
+
'A modal dialog that interrupts the user with important content and expects a response.',
|
|
7
|
+
category: 'primitives',
|
|
8
|
+
tags: ['alert-dialog', 'modal', 'overlay', 'confirmation'],
|
|
9
|
+
preview: {
|
|
10
|
+
type: 'static',
|
|
11
|
+
html: '<div class="flex h-12 w-full items-center rounded-md border border-gray-300 bg-gray-100 px-3"><span class="text-sm text-gray-600">Alert Dialog</span></div>',
|
|
12
|
+
},
|
|
13
|
+
variants: [
|
|
14
|
+
{
|
|
15
|
+
name: 'Default',
|
|
16
|
+
description: 'Default alert dialog',
|
|
17
|
+
code: '<AlertDialog>...</AlertDialog>',
|
|
18
|
+
preview: {
|
|
19
|
+
type: 'component',
|
|
20
|
+
component: 'AlertDialog',
|
|
21
|
+
props: {},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
dependencies: ['utils'],
|
|
26
|
+
packageDependencies: ['@radix-ui/react-alert-dialog'],
|
|
27
|
+
files: ['components/primitives/alert-dialog/index.tsx'],
|
|
28
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@foundrykit/utils';
|
|
4
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
|
+
import type * as React from 'react';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Modal confirmation dialog built on Radix `AlertDialog.Root` that interrupts
|
|
9
|
+
* the user with important content and expects a response. Compose with
|
|
10
|
+
* {@link AlertDialogTrigger}, {@link AlertDialogContent},
|
|
11
|
+
* {@link AlertDialogHeader}, {@link AlertDialogFooter},
|
|
12
|
+
* {@link AlertDialogTitle}, {@link AlertDialogDescription},
|
|
13
|
+
* {@link AlertDialogAction} and {@link AlertDialogCancel}.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <AlertDialog>
|
|
18
|
+
* <AlertDialogTrigger>Delete</AlertDialogTrigger>
|
|
19
|
+
* <AlertDialogContent>
|
|
20
|
+
* <AlertDialogHeader>
|
|
21
|
+
* <AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
22
|
+
* <AlertDialogDescription>This cannot be undone.</AlertDialogDescription>
|
|
23
|
+
* </AlertDialogHeader>
|
|
24
|
+
* <AlertDialogFooter>
|
|
25
|
+
* <AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
26
|
+
* <AlertDialogAction>Continue</AlertDialogAction>
|
|
27
|
+
* </AlertDialogFooter>
|
|
28
|
+
* </AlertDialogContent>
|
|
29
|
+
* </AlertDialog>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
function AlertDialog({
|
|
33
|
+
...props
|
|
34
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {
|
|
35
|
+
return <AlertDialogPrimitive.Root data-slot='alert-dialog' {...props} />;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function AlertDialogTrigger({
|
|
39
|
+
...props
|
|
40
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {
|
|
41
|
+
return (
|
|
42
|
+
<AlertDialogPrimitive.Trigger data-slot='alert-dialog-trigger' {...props} />
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function AlertDialogPortal({
|
|
47
|
+
...props
|
|
48
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {
|
|
49
|
+
return (
|
|
50
|
+
<AlertDialogPrimitive.Portal data-slot='alert-dialog-portal' {...props} />
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function AlertDialogOverlay({
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {
|
|
58
|
+
return (
|
|
59
|
+
<AlertDialogPrimitive.Overlay
|
|
60
|
+
data-slot='alert-dialog-overlay'
|
|
61
|
+
className={cn(
|
|
62
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function AlertDialogContent({
|
|
71
|
+
className,
|
|
72
|
+
...props
|
|
73
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Content>) {
|
|
74
|
+
return (
|
|
75
|
+
<AlertDialogPortal>
|
|
76
|
+
<AlertDialogOverlay />
|
|
77
|
+
<AlertDialogPrimitive.Content
|
|
78
|
+
data-slot='alert-dialog-content'
|
|
79
|
+
className={cn(
|
|
80
|
+
'bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
|
|
81
|
+
className
|
|
82
|
+
)}
|
|
83
|
+
{...props}
|
|
84
|
+
/>
|
|
85
|
+
</AlertDialogPortal>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function AlertDialogHeader({
|
|
90
|
+
className,
|
|
91
|
+
...props
|
|
92
|
+
}: React.ComponentProps<'div'>) {
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
data-slot='alert-dialog-header'
|
|
96
|
+
className={cn('flex flex-col gap-2 text-center sm:text-left', className)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function AlertDialogFooter({
|
|
103
|
+
className,
|
|
104
|
+
...props
|
|
105
|
+
}: React.ComponentProps<'div'>) {
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
data-slot='alert-dialog-footer'
|
|
109
|
+
className={cn(
|
|
110
|
+
'flex flex-col-reverse gap-2 sm:flex-row sm:justify-end',
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
{...props}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function AlertDialogTitle({
|
|
119
|
+
className,
|
|
120
|
+
...props
|
|
121
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
122
|
+
return (
|
|
123
|
+
<AlertDialogPrimitive.Title
|
|
124
|
+
data-slot='alert-dialog-title'
|
|
125
|
+
className={cn('text-lg font-semibold', className)}
|
|
126
|
+
{...props}
|
|
127
|
+
/>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function AlertDialogDescription({
|
|
132
|
+
className,
|
|
133
|
+
...props
|
|
134
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
135
|
+
return (
|
|
136
|
+
<AlertDialogPrimitive.Description
|
|
137
|
+
data-slot='alert-dialog-description'
|
|
138
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
139
|
+
{...props}
|
|
140
|
+
/>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function AlertDialogAction({
|
|
145
|
+
className,
|
|
146
|
+
...props
|
|
147
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Action>) {
|
|
148
|
+
return (
|
|
149
|
+
<AlertDialogPrimitive.Action
|
|
150
|
+
data-slot='alert-dialog-action'
|
|
151
|
+
className={cn(
|
|
152
|
+
"bg-primary text-primary-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 hover:bg-primary/90 inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 has-[>svg]:px-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
153
|
+
className
|
|
154
|
+
)}
|
|
155
|
+
{...props}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function AlertDialogCancel({
|
|
161
|
+
className,
|
|
162
|
+
...props
|
|
163
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>) {
|
|
164
|
+
return (
|
|
165
|
+
<AlertDialogPrimitive.Cancel
|
|
166
|
+
data-slot='alert-dialog-cancel'
|
|
167
|
+
className={cn(
|
|
168
|
+
"bg-background 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:border-input dark:hover:bg-input/50 hover:bg-accent hover:text-accent-foreground inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-md border px-4 py-2 text-sm font-medium whitespace-nowrap shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 has-[>svg]:px-3 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
169
|
+
className
|
|
170
|
+
)}
|
|
171
|
+
{...props}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export {
|
|
177
|
+
AlertDialog,
|
|
178
|
+
AlertDialogAction,
|
|
179
|
+
AlertDialogCancel,
|
|
180
|
+
AlertDialogContent,
|
|
181
|
+
AlertDialogDescription,
|
|
182
|
+
AlertDialogFooter,
|
|
183
|
+
AlertDialogHeader,
|
|
184
|
+
AlertDialogOverlay,
|
|
185
|
+
AlertDialogPortal,
|
|
186
|
+
AlertDialogTitle,
|
|
187
|
+
AlertDialogTrigger,
|
|
188
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
+
|
|
3
|
+
export const AspectRatioConfig: ComponentConfig = {
|
|
4
|
+
name: 'Aspect Ratio',
|
|
5
|
+
description: 'Constrains content to a desired width-to-height ratio.',
|
|
6
|
+
category: 'primitives',
|
|
7
|
+
tags: ['aspect-ratio', 'media', 'layout'],
|
|
8
|
+
preview: {
|
|
9
|
+
type: 'static',
|
|
10
|
+
html: '<div class="flex h-12 w-full items-center rounded-md border border-gray-300 bg-gray-100 px-3"><span class="text-sm text-gray-600">Aspect Ratio</span></div>',
|
|
11
|
+
},
|
|
12
|
+
variants: [
|
|
13
|
+
{
|
|
14
|
+
name: 'Default',
|
|
15
|
+
description: 'Sixteen-by-nine aspect ratio',
|
|
16
|
+
code: '<AspectRatio ratio={16 / 9}>...</AspectRatio>',
|
|
17
|
+
preview: {
|
|
18
|
+
type: 'component',
|
|
19
|
+
component: 'AspectRatio',
|
|
20
|
+
props: {},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
dependencies: ['utils'],
|
|
25
|
+
packageDependencies: ['@radix-ui/react-aspect-ratio'],
|
|
26
|
+
files: ['components/primitives/aspect-ratio/index.tsx'],
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
4
|
+
import type * as React from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Constrains its content to a given width-to-height `ratio`, built on Radix
|
|
8
|
+
* `AspectRatio.Root`. Handy for images, video embeds and media placeholders
|
|
9
|
+
* that must keep a consistent shape as they scale.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <AspectRatio ratio={16 / 9}>
|
|
14
|
+
* <img src="/cover.jpg" alt="Cover" className="h-full w-full object-cover" />
|
|
15
|
+
* </AspectRatio>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
function AspectRatio({
|
|
19
|
+
...props
|
|
20
|
+
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
|
|
21
|
+
return <AspectRatioPrimitive.Root data-slot='aspect-ratio' {...props} />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { AspectRatio };
|