shadcn-nextjs-page-generator 1.0.2 → 1.0.4
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/index.cjs +19 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -605,7 +605,7 @@ function generateComponent(config) {
|
|
|
605
605
|
const hasAnimations = animations.listAnimations || animations.cardAnimations;
|
|
606
606
|
const imports = `'use client';
|
|
607
607
|
|
|
608
|
-
${hasAnimations ? `import { motion } from 'framer-motion';` : ""}
|
|
608
|
+
${hasAnimations ? `import { motion, type Variants } from 'framer-motion';` : ""}
|
|
609
609
|
import { useEffect, useState } from 'react';
|
|
610
610
|
import { ${entityName} } from '../../domain/entities/${moduleName}.entity';
|
|
611
611
|
import { Get${entityName}sUseCase } from '../../application/use-cases/get-${moduleName}s.use-case';
|
|
@@ -665,7 +665,7 @@ import {
|
|
|
665
665
|
${includeRowSelection ? `import { Checkbox } from "@/components/ui/checkbox";` : ""}`;
|
|
666
666
|
const animationVariants = hasAnimations ? `
|
|
667
667
|
// Framer Motion animation variants
|
|
668
|
-
const containerVariants = {
|
|
668
|
+
const containerVariants: Variants = {
|
|
669
669
|
hidden: { opacity: 0 },
|
|
670
670
|
visible: {
|
|
671
671
|
opacity: 1,
|
|
@@ -675,7 +675,7 @@ const containerVariants = {
|
|
|
675
675
|
}
|
|
676
676
|
};
|
|
677
677
|
|
|
678
|
-
const itemVariants = {
|
|
678
|
+
const itemVariants: Variants = {
|
|
679
679
|
hidden: { opacity: 0, x: -20 },
|
|
680
680
|
visible: {
|
|
681
681
|
opacity: 1,
|
|
@@ -683,6 +683,10 @@ const itemVariants = {
|
|
|
683
683
|
transition: { duration: ${animations.intensity === "bold" ? "0.3" : animations.intensity === "subtle" ? "0.15" : "0.2"} }
|
|
684
684
|
}
|
|
685
685
|
};
|
|
686
|
+
${animations.listAnimations ? `
|
|
687
|
+
// Create motion-wrapped TableRow component
|
|
688
|
+
const MotionTableRow = motion(TableRow);
|
|
689
|
+
` : ""}
|
|
686
690
|
` : "";
|
|
687
691
|
const dataFetchingCode = isTanStack ? `
|
|
688
692
|
// TanStack Query data fetching
|
|
@@ -985,7 +989,7 @@ ${tableHeaders}
|
|
|
985
989
|
) : (
|
|
986
990
|
${animations.listAnimations ? `
|
|
987
991
|
data.map((item, index) => (
|
|
988
|
-
<
|
|
992
|
+
<MotionTableRow
|
|
989
993
|
key={item.id}
|
|
990
994
|
variants={itemVariants}
|
|
991
995
|
initial="hidden"
|
|
@@ -1022,7 +1026,7 @@ ${tableCells}
|
|
|
1022
1026
|
</DropdownMenu>
|
|
1023
1027
|
</div>
|
|
1024
1028
|
</TableCell>
|
|
1025
|
-
${animations.listAnimations ? `</
|
|
1029
|
+
${animations.listAnimations ? `</MotionTableRow>` : `</TableRow>`}
|
|
1026
1030
|
))
|
|
1027
1031
|
)}
|
|
1028
1032
|
</TableBody>
|
|
@@ -1331,7 +1335,7 @@ ${mockDataFields}
|
|
|
1331
1335
|
${fetchFunction}`;
|
|
1332
1336
|
const imports = `'use client';
|
|
1333
1337
|
|
|
1334
|
-
${hasAnimations ? `import { motion } from 'framer-motion';` : ""}
|
|
1338
|
+
${hasAnimations ? `import { motion, type Variants } from 'framer-motion';` : ""}
|
|
1335
1339
|
import { useEffect, useState } from 'react';
|
|
1336
1340
|
${isTanStack ? `import { useQuery } from '@tanstack/react-query';` : ""}
|
|
1337
1341
|
import { Button } from '@/components/ui/button';
|
|
@@ -1388,7 +1392,7 @@ import {
|
|
|
1388
1392
|
${includeRowSelection ? `import { Checkbox } from "@/components/ui/checkbox";` : ""}`;
|
|
1389
1393
|
const animationVariants = hasAnimations ? `
|
|
1390
1394
|
// Framer Motion animation variants
|
|
1391
|
-
const containerVariants = {
|
|
1395
|
+
const containerVariants: Variants = {
|
|
1392
1396
|
hidden: { opacity: 0 },
|
|
1393
1397
|
visible: {
|
|
1394
1398
|
opacity: 1,
|
|
@@ -1398,7 +1402,7 @@ const containerVariants = {
|
|
|
1398
1402
|
}
|
|
1399
1403
|
};
|
|
1400
1404
|
|
|
1401
|
-
const itemVariants = {
|
|
1405
|
+
const itemVariants: Variants = {
|
|
1402
1406
|
hidden: { opacity: 0, x: -20 },
|
|
1403
1407
|
visible: {
|
|
1404
1408
|
opacity: 1,
|
|
@@ -1406,6 +1410,10 @@ const itemVariants = {
|
|
|
1406
1410
|
transition: { duration: ${animations.intensity === "bold" ? "0.3" : animations.intensity === "subtle" ? "0.15" : "0.2"} }
|
|
1407
1411
|
}
|
|
1408
1412
|
};
|
|
1413
|
+
${animations.listAnimations ? `
|
|
1414
|
+
// Create motion-wrapped TableRow component
|
|
1415
|
+
const MotionTableRow = motion(TableRow);
|
|
1416
|
+
` : ""}
|
|
1409
1417
|
` : "";
|
|
1410
1418
|
const rowSelectionCode = includeRowSelection ? `
|
|
1411
1419
|
const [selectedRows, setSelectedRows] = useState<Set<string>>(new Set());
|
|
@@ -1659,7 +1667,7 @@ ${tableHeaders}
|
|
|
1659
1667
|
) : (
|
|
1660
1668
|
${animations.listAnimations ? `
|
|
1661
1669
|
data.map((item, index) => (
|
|
1662
|
-
<
|
|
1670
|
+
<MotionTableRow
|
|
1663
1671
|
key={item.id}
|
|
1664
1672
|
variants={itemVariants}
|
|
1665
1673
|
initial="hidden"
|
|
@@ -1696,7 +1704,7 @@ ${tableCells}
|
|
|
1696
1704
|
</DropdownMenu>
|
|
1697
1705
|
</div>
|
|
1698
1706
|
</TableCell>
|
|
1699
|
-
${animations.listAnimations ? `</
|
|
1707
|
+
${animations.listAnimations ? `</MotionTableRow>` : `</TableRow>`}
|
|
1700
1708
|
))
|
|
1701
1709
|
)}
|
|
1702
1710
|
</TableBody>
|
|
@@ -1893,6 +1901,7 @@ async function run() {
|
|
|
1893
1901
|
process.exit(1);
|
|
1894
1902
|
}
|
|
1895
1903
|
}
|
|
1904
|
+
run();
|
|
1896
1905
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1897
1906
|
0 && (module.exports = {
|
|
1898
1907
|
run
|