@skalfa/skalfa-app 1.0.3 → 1.0.5

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.
Files changed (90) hide show
  1. package/.env.example +8 -16
  2. package/app/auth/edit/page.tsx +1 -1
  3. package/app/auth/login/page.tsx +1 -1
  4. package/app/auth/me/page.tsx +1 -1
  5. package/app/auth/register/page.tsx +1 -1
  6. package/app/auth/verify/page.tsx +1 -1
  7. package/app/dashboard/layout.tsx +2 -2
  8. package/app/dashboard/page.tsx +1 -1
  9. package/app/index.ts +1 -0
  10. package/app/layout.tsx +2 -4
  11. package/app/page.tsx +2 -2
  12. package/bun.lock +7 -2
  13. package/components/index.ts +1 -3
  14. package/package.json +8 -6
  15. package/styles/components.css +1392 -0
  16. package/styles/globals.css +40 -175
  17. package/styles/utilities.css +37 -0
  18. package/tsconfig.json +4 -2
  19. package/utils/commands/skalfa.ts +1 -1
  20. package/components/base.components/accordion/Accordion.component.tsx +0 -82
  21. package/components/base.components/breadcrumb/Breadcrumb.component.tsx +0 -80
  22. package/components/base.components/button/Button.component.tsx +0 -91
  23. package/components/base.components/button/IconButton.component.tsx +0 -88
  24. package/components/base.components/button/button.decorate.ts +0 -82
  25. package/components/base.components/card/AlertCard.component.tsx +0 -69
  26. package/components/base.components/card/Card.component.tsx +0 -25
  27. package/components/base.components/card/DashboardCard.component.tsx +0 -44
  28. package/components/base.components/card/GalleryCard.component.tsx +0 -50
  29. package/components/base.components/card/ProductCard.component.tsx +0 -65
  30. package/components/base.components/card/ProfileCard.component.tsx +0 -71
  31. package/components/base.components/carousel/Carousel.component.tsx +0 -113
  32. package/components/base.components/chip/Chip.component.tsx +0 -39
  33. package/components/base.components/document/DocumentViewer.component.tsx +0 -164
  34. package/components/base.components/document/ExportExcel.component.tsx +0 -340
  35. package/components/base.components/document/ImportExcel.component.tsx +0 -315
  36. package/components/base.components/document/PrintTable.component.tsx +0 -204
  37. package/components/base.components/document/RenderPDF.component.tsx +0 -416
  38. package/components/base.components/index.ts +0 -85
  39. package/components/base.components/input/Checkbox.component.tsx +0 -109
  40. package/components/base.components/input/Input.component.tsx +0 -332
  41. package/components/base.components/input/InputCheckbox.component.tsx +0 -174
  42. package/components/base.components/input/InputCurrency.component.tsx +0 -163
  43. package/components/base.components/input/InputDate.component.tsx +0 -352
  44. package/components/base.components/input/InputDatetime.component.tsx +0 -260
  45. package/components/base.components/input/InputDocument.component.tsx +0 -352
  46. package/components/base.components/input/InputImage.component.tsx +0 -533
  47. package/components/base.components/input/InputMap.component.tsx +0 -318
  48. package/components/base.components/input/InputNumber.component.tsx +0 -192
  49. package/components/base.components/input/InputOtp.component.tsx +0 -169
  50. package/components/base.components/input/InputPassword.component.tsx +0 -236
  51. package/components/base.components/input/InputRadio.component.tsx +0 -175
  52. package/components/base.components/input/InputTime.component.tsx +0 -276
  53. package/components/base.components/input/InputValues.component.tsx +0 -68
  54. package/components/base.components/input/Radio.component.tsx +0 -102
  55. package/components/base.components/input/Select.component.tsx +0 -541
  56. package/components/base.components/modal/BottomSheet.component.tsx +0 -246
  57. package/components/base.components/modal/FloatingPage.component.tsx +0 -104
  58. package/components/base.components/modal/Modal.component.tsx +0 -96
  59. package/components/base.components/modal/ModalConfirm.component.tsx +0 -218
  60. package/components/base.components/modal/Toast.component.tsx +0 -126
  61. package/components/base.components/nav/Bottombar.component.tsx +0 -116
  62. package/components/base.components/nav/Footer.component.tsx +0 -144
  63. package/components/base.components/nav/Headbar.component.tsx +0 -104
  64. package/components/base.components/nav/Navbar.component.tsx +0 -100
  65. package/components/base.components/nav/Sidebar.component.tsx +0 -301
  66. package/components/base.components/nav/Tabbar.component.tsx +0 -60
  67. package/components/base.components/nav/Wizard.component.tsx +0 -73
  68. package/components/base.components/supervision/FormSupervision.component.tsx +0 -434
  69. package/components/base.components/supervision/TableSupervision.component.tsx +0 -697
  70. package/components/base.components/table/ControlBar.component.tsx +0 -497
  71. package/components/base.components/table/FilterComponent.tsx +0 -518
  72. package/components/base.components/table/Pagination.component.tsx +0 -159
  73. package/components/base.components/table/Table.component.tsx +0 -469
  74. package/components/base.components/typography/TypographyArticle.component.tsx +0 -26
  75. package/components/base.components/typography/TypographyColumn.component.tsx +0 -20
  76. package/components/base.components/typography/TypographyContent.component.tsx +0 -20
  77. package/components/base.components/typography/TypographyTips.component.tsx +0 -20
  78. package/components/base.components/wrap/Draggable.component.tsx +0 -303
  79. package/components/base.components/wrap/IDBProvider.tsx +0 -12
  80. package/components/base.components/wrap/Image.component.tsx +0 -10
  81. package/components/base.components/wrap/OutsideClick.component.tsx +0 -48
  82. package/components/base.components/wrap/ScrollContainer.component.tsx +0 -104
  83. package/components/base.components/wrap/ShortcutProvider.tsx +0 -57
  84. package/components/base.components/wrap/Swipe.component.tsx +0 -93
  85. package/components/construct.components/example.tsx +0 -1
  86. package/components/construct.components/index.ts +0 -5
  87. package/components/structure.components/example.tsx +0 -1
  88. package/components/structure.components/index.ts +0 -5
  89. package/schema/idb/app.schema.ts +0 -9
  90. package/schema/index.ts +0 -5
@@ -1,82 +0,0 @@
1
- export const buttonContainer = {
2
- lg: "px-14 py-3 flex items-center gap-3",
3
- md: "px-8 py-2 flex items-center gap-2",
4
- sm: "px-6 py-2 text-xs flex items-center gap-2",
5
- xs: "px-3 py-1 text-xs flex items-center gap-1.5",
6
- };
7
-
8
- export const iconButtonContainer = {
9
- lg: "w-10 h-10 flex items-center justify-center",
10
- md: "w-8 h-8 flex items-center justify-center",
11
- sm: "w-7 h-7 text-xs flex items-center justify-center",
12
- xs: "w-6 h-6 text-xs flex items-center justify-center",
13
- };
14
-
15
- export const buttonVariant = {
16
- solid: {
17
- primary: "bg-primary text-white",
18
- secondary: "bg-secondary text-white",
19
- warning: "bg-warning text-white",
20
- danger: "bg-danger text-white",
21
- success: "bg-success text-white",
22
- },
23
- outline: {
24
- primary: "border text-primary",
25
- secondary: "border text-secondary",
26
- warning: "border text-warning",
27
- danger: "border text-danger",
28
- success: "border text-success",
29
- },
30
- light: {
31
- primary: "bg-light-primary text-primary",
32
- secondary: "bg-light-secondary text-secondary",
33
- warning: "bg-light-warning text-warning",
34
- danger: "bg-light-danger text-danger",
35
- success: "bg-light-success text-success",
36
- },
37
- simple: {
38
- primary: "text-primary",
39
- secondary: "text-secondary",
40
- warning: "text-warning",
41
- danger: "text-danger",
42
- success: "text-success",
43
- },
44
- };
45
-
46
- export const buttonIcon = {
47
- solid: {
48
- primary: "text-white",
49
- secondary: "text-white",
50
- warning: "text-white",
51
- danger: "text-white",
52
- success: "text-white",
53
- },
54
- outline: {
55
- primary: "text-primary",
56
- secondary: "text-secondary",
57
- warning: "text-warning",
58
- danger: "text-danger",
59
- success: "text-success",
60
- },
61
- light: {
62
- primary: "text-primary",
63
- secondary: "text-secondary",
64
- warning: "text-warning",
65
- danger: "text-danger",
66
- success: "text-success",
67
- },
68
- simple: {
69
- primary: "text-primary",
70
- secondary: "text-secondary",
71
- warning: "text-warning",
72
- danger: "text-danger",
73
- success: "text-success",
74
- },
75
- };
76
-
77
- export const buttonRadius = {
78
- lg: "rounded-sm",
79
- md: "rounded-sm",
80
- sm: "rounded-sm",
81
- xs: "rounded-xs",
82
- };
@@ -1,69 +0,0 @@
1
- "use client"
2
-
3
- import { ReactNode } from "react";
4
- import { cn, pcn } from "@utils";
5
-
6
-
7
-
8
- type CT = "badge" | "title" | "base";
9
-
10
- export interface AlertCardProps {
11
- title ?: string | ReactNode;
12
- leftContent ?: string | ReactNode;
13
- badge ?: string | ReactNode;
14
- content ?: string | ReactNode;
15
- footer ?: string | ReactNode;
16
-
17
- /** Use custom class with: "badge::", "title::". */
18
- className ?: string;
19
- }
20
-
21
-
22
-
23
- export function AlertCardComponent({
24
- title,
25
- leftContent,
26
- badge,
27
- content,
28
- footer,
29
- className = "",
30
- }: AlertCardProps) {
31
- return (
32
- <>
33
- <section
34
- className={cn(
35
- "rounded-[6px] bg-white p-4 border sm:p-6",
36
- pcn<CT>(className, "base"),
37
- )}
38
- >
39
- <div className="flex items-start sm:gap-8">
40
- {leftContent}
41
-
42
- <div>
43
- <strong
44
- className={cn(
45
- "rounded-[4px] border text-primary bg-primary/20 px-3 py-1.5 text-xs font-bold",
46
- pcn<CT>(className, "badge"),
47
- )}
48
- >
49
- {badge}
50
- </strong>
51
-
52
- <h3
53
- className={cn(
54
- "mt-4 text-lg font-medium sm:text-xl",
55
- pcn<CT>(className, "title"),
56
- )}
57
- >
58
- {title}
59
- </h3>
60
-
61
- {content}
62
-
63
- {footer && <div className="pt-4">{footer}</div>}
64
- </div>
65
- </div>
66
- </section>
67
- </>
68
- );
69
- }
@@ -1,25 +0,0 @@
1
- "use client"
2
-
3
- import { cn } from "@utils";
4
-
5
-
6
-
7
- export interface CardProps {
8
- children : React.ReactNode;
9
- className ?: string;
10
- }
11
-
12
-
13
-
14
- export function CardComponent({
15
- children,
16
- className,
17
- }: CardProps) {
18
- return (
19
- <>
20
- <div className={cn("px-4 py-2.5 rounded-[6px] border bg-white", className)}>
21
- {children}
22
- </div>
23
- </>
24
- );
25
- }
@@ -1,44 +0,0 @@
1
- "use client"
2
-
3
- import Link from "next/link";
4
- import { ReactNode } from "react";
5
- import { cn } from "@utils";
6
-
7
-
8
-
9
- export interface DashboardCardProps {
10
- content ?: string | ReactNode;
11
- title ?: string | ReactNode;
12
- rightContent ?: string | ReactNode;
13
- path ?: string;
14
- className ?: string;
15
- }
16
-
17
-
18
-
19
- export function DashboardCardComponent({
20
- content,
21
- title,
22
- rightContent,
23
- path,
24
- className,
25
- } : DashboardCardProps) {
26
- return (
27
- <>
28
- <Link href={path || ""}>
29
- <div
30
- className={cn(
31
- `bg-white border py-4 px-6 rounded-[6px] flex justify-between gap-4 items-center`,
32
- className,
33
- )}
34
- >
35
- <div>
36
- <div className="flex gap-4 items-center">{content}</div>
37
- {title}
38
- </div>
39
- <div>{rightContent}</div>
40
- </div>
41
- </Link>
42
- </>
43
- );
44
- }
@@ -1,50 +0,0 @@
1
- "use client"
2
-
3
- import Image from "next/image";
4
- import { cn, pcn } from "@utils";
5
-
6
-
7
-
8
- type CT = "label" | "image" | "base";
9
-
10
- export interface GalleryCardProps {
11
- src : string;
12
- alt ?: string;
13
-
14
- /** Use custom class with: "label::", "image::". */
15
- className?: string;
16
- }
17
-
18
-
19
-
20
- export function GalleryCardComponent({
21
- src,
22
- alt = "",
23
- className = "",
24
- } : GalleryCardProps) {
25
- return (
26
- <>
27
- <div className={pcn<CT>(className, "base")}>
28
- <Image
29
- src={src}
30
- alt={src}
31
- width={400}
32
- height={300}
33
- className={cn(
34
- "w-full rounded-bl-4xl rounded-tr-3xl object-cover aspect-[4/3]",
35
- pcn<CT>(className, "image"),
36
- )}
37
- />
38
-
39
- <div
40
- className={cn(
41
- "mt-1 text-center text-sm text-light-foreground",
42
- pcn<CT>(className, "label"),
43
- )}
44
- >
45
- {alt}
46
- </div>
47
- </div>
48
- </>
49
- );
50
- }
@@ -1,65 +0,0 @@
1
- "use client"
2
-
3
- import Image from "next/image";
4
- import { cn, pcn } from "@utils";
5
-
6
-
7
-
8
- type CT = "image" | "base" | "content";
9
-
10
- export interface ProductCardProps {
11
- name : string;
12
- price ?: string;
13
- image ?: string;
14
- description ?: string | React.ReactNode;
15
-
16
- /** Use custom class with: "image::", "content::". */
17
- className ?: string;
18
- }
19
-
20
-
21
-
22
- export function ProductCardComponent({
23
- image = "",
24
- name,
25
- price,
26
- description,
27
- className = "",
28
- } : ProductCardProps) {
29
- return (
30
- <>
31
- <div
32
- className={cn(
33
- "rounded-[6px] border p-2 bg-white",
34
- pcn<CT>(className, "base"),
35
- )}
36
- >
37
- <Image
38
- src={image}
39
- alt={image}
40
- width={400}
41
- height={300}
42
- className={cn(
43
- "h-56 w-full rounded-[4px] object-cover",
44
- pcn<CT>(className, "image"),
45
- )}
46
- />
47
-
48
- <div className={cn("p-2", pcn<CT>(className, "content"))}>
49
- <dl>
50
- <div>
51
- <dt className="sr-only">Name</dt>
52
- <dd className="text-sm">{name}</dd>
53
- </div>
54
- <div>
55
- <dt className="sr-only">Price</dt>
56
- <dd className="font-semibold">{price}</dd>
57
- </div>
58
- </dl>
59
-
60
- {description && <div>{description}</div>}
61
- </div>
62
- </div>
63
- </>
64
- );
65
- }
@@ -1,71 +0,0 @@
1
- "use client"
2
-
3
- import Image from "next/image";
4
- import { cn, pcn } from "@utils";
5
-
6
-
7
-
8
- type CT = "image" | "base" | "content";
9
-
10
- export interface ProfileCardProps {
11
- name : string;
12
- short ?: string;
13
- image ?: string;
14
- description ?: string | React.ReactNode;
15
- footer ?: string | React.ReactNode;
16
-
17
- /** Use custom class with: "image::", "content::". */
18
- className ?: string;
19
- }
20
-
21
-
22
-
23
- export function ProfileCardComponent({
24
- image = "",
25
- name,
26
- short,
27
- description,
28
- footer,
29
- className = "",
30
- } : ProfileCardProps) {
31
- return (
32
- <>
33
- <div
34
- className={cn(
35
- "relative block overflow-hidden rounded-[6px] border bg-white p-4 sm:p-6",
36
- pcn<CT>(className, "base"),
37
- )}
38
- >
39
- <span className="absolute inset-x-0 bottom-0 h-1 bg-primary"></span>
40
-
41
- <div className="sm:flex sm:gap-4 sm:items-center">
42
- {image && (
43
- <div className="hidden sm:block sm:shrink-0">
44
- <Image
45
- src={image}
46
- alt={image}
47
- width={400}
48
- height={400}
49
- className={cn(
50
- "size-16 rounded-full object-cover shadow-sm",
51
- pcn<CT>(className, "image"),
52
- )}
53
- />
54
- </div>
55
- )}
56
- <div className={pcn<CT>(className, "content")}>
57
- <h3 className="text-lg font-bold sm:text-xl">{name}</h3>
58
-
59
- <p className="mt-1 text-xs font-medium text-light-foreground">
60
- {short}
61
- </p>
62
- </div>
63
- </div>
64
-
65
- {description}
66
-
67
- {footer && <dl className="mt-4">{footer}</dl>}
68
- </div>
69
- </>
70
- );
71
- }
@@ -1,113 +0,0 @@
1
- "use client"
2
-
3
- import { useState, useRef, useEffect } from "react";
4
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
- import { faChevronLeft, faChevronRight } from "@fortawesome/free-solid-svg-icons";
6
- import { cn, pcn } from "@utils";
7
-
8
-
9
-
10
- type CT = "item" | "prev-button" | "next-button" | "navigation" | "base";
11
-
12
- interface CarouselItem {
13
- background : string;
14
- content ?: string;
15
- }
16
-
17
- interface CarouselProps {
18
- items : CarouselItem[];
19
- noButton ?: boolean;
20
- noNavigation ?: boolean;
21
-
22
- /** Use custom class with: "item::", "prev-button::", "next-button::", "navigation::". */
23
- className ?: string;
24
- }
25
-
26
-
27
-
28
- export function CarouselComponent({
29
- items,
30
- className = "",
31
- noButton,
32
- noNavigation,
33
- }: CarouselProps) {
34
- const [currentIndex, setCurrentIndex] = useState<number>(0);
35
- const touchStartX = useRef<number | null>(null);
36
- const touchEndX = useRef<number | null>(null);
37
- const intervalRef = useRef<NodeJS.Timeout | null>(null);
38
-
39
- const handlePrev = (): void => setCurrentIndex((prevIndex) => (prevIndex - 1 + items.length) % items.length);
40
-
41
- const handleNext = (): void => setCurrentIndex((prevIndex) => (prevIndex + 1) % items.length);
42
-
43
- const handleTouchStart = (e: React.TouchEvent<HTMLDivElement>): void => {
44
- touchStartX.current = e.touches[0].clientX;
45
- };
46
-
47
- const handleTouchEnd = (e: React.TouchEvent<HTMLDivElement>): void => {
48
- touchEndX.current = e.changedTouches[0].clientX;
49
- if (touchStartX.current !== null && touchEndX.current !== null) {
50
- if (touchStartX.current - touchEndX.current > 50) handleNext();
51
- if (touchEndX.current - touchStartX.current > 50) handlePrev();
52
- }
53
- };
54
-
55
- useEffect(() => {
56
- intervalRef.current = setInterval(handleNext, 10000);
57
- return () => {
58
- if (intervalRef.current) clearInterval(intervalRef.current);
59
- };
60
- }, []);
61
-
62
- const styles = {
63
- base : cn("relative w-full overflow-hidden rounded-[6px]", pcn<CT>(className, "base")),
64
- item : cn("flex-shrink-0 w-full aspect-[16/6] flex items-center justify-center bg-cover bg-center", pcn<CT>(className, "item")),
65
- prevButton : cn("absolute top-1/2 left-4 transform -translate-y-1/2 bg-light-foreground/40 text-white p-2 rounded-[6px] cursor-pointer",pcn<CT>(className, "prev-button")),
66
- nextButton : cn("absolute top-1/2 right-4 transform -translate-y-1/2 bg-light-foreground/40 text-white p-2 rounded-[6px] cursor-pointer",pcn<CT>(className, "next-button")),
67
- navigation : cn("absolute bottom-4 left-1/2 transform -translate-x-1/2 flex space-x-2",pcn<CT>(className, "navigation")),
68
- };
69
-
70
- return (
71
- <div className={styles.base}>
72
- <div
73
- className="flex transition-transform duration-500"
74
- style={{ transform: `translateX(-${currentIndex * 100}%)` }}
75
- onTouchStart={handleTouchStart}
76
- onTouchEnd={handleTouchEnd}
77
- >
78
- {items.map((item, index) => (
79
- <div
80
- key={index}
81
- className={styles.item}
82
- style={{ backgroundImage: `url(${item.background})` }}
83
- >
84
- {item.content}
85
- </div>
86
- ))}
87
- </div>
88
-
89
- {!noNavigation && (
90
- <div className={styles.navigation}>
91
- {items.map((_, index) => (
92
- <button
93
- key={index}
94
- className={`w-8 h-1 rounded-full ${currentIndex === index ? "bg-primary" : "bg-light-foreground/40"}`}
95
- onClick={() => setCurrentIndex(index)}
96
- ></button>
97
- ))}
98
- </div>
99
- )}
100
-
101
- {!noButton && (
102
- <>
103
- <button className={styles.prevButton} onClick={handlePrev}>
104
- <FontAwesomeIcon icon={faChevronLeft} />
105
- </button>
106
- <button className={styles.nextButton} onClick={handleNext}>
107
- <FontAwesomeIcon icon={faChevronRight} />
108
- </button>
109
- </>
110
- )}
111
- </div>
112
- );
113
- }
@@ -1,39 +0,0 @@
1
- import { faTimes } from "@fortawesome/free-solid-svg-icons";
2
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
3
- import { cn } from "@utils";
4
-
5
- export function ChipComponent({
6
- items,
7
- onClick,
8
- onDelete,
9
- className,
10
- } : {
11
- items : Record<string, any>,
12
- onClick ?: (item: any, index: number) => void,
13
- onDelete ?: (item: any, index: number) => void,
14
- className ?: string,
15
- }) {
16
- return (
17
- <div className={cn(`overflow-hidden flex gap-2 flex-wrap`, className)}>
18
- {items?.map((item: any, key: number) => {
19
- return (
20
- <div
21
- key={key}
22
- className={`flex text-xs py-0.5 px-2 justify-between text-foreground border items-center rounded-md cursor-pointer`}
23
- onClick={() => onClick?.(item, key)}
24
- >
25
- <span>{item}</span>
26
-
27
- {onDelete && (
28
- <FontAwesomeIcon
29
- icon={faTimes}
30
- className={`text-xs cursor-pointer text-light-foreground pl-2 py-1 hover:text-danger`}
31
- onClick={() => onDelete?.(item, key)}
32
- />
33
- )}
34
- </div>
35
- );
36
- })}
37
- </div>
38
- )
39
- }