@skalfa/skalfa-app 1.0.0 → 1.0.1
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/.env.example +43 -43
- package/.github/workflows/publish.yml +39 -0
- package/CONTRIBUTING.md +45 -0
- package/LICENSE +21 -0
- package/README.md +91 -28
- package/app/auth/edit/page.tsx +65 -65
- package/app/auth/login/page.tsx +63 -63
- package/app/auth/me/page.tsx +58 -58
- package/app/auth/register/page.tsx +69 -69
- package/app/auth/verify/page.tsx +53 -53
- package/app/dashboard/user/page.tsx +76 -76
- package/app/layout.tsx +37 -37
- package/app/manifest.ts +25 -0
- package/app/page.tsx +13 -13
- package/barrels.json +5 -5
- package/blueprints/starter.blueprint.json +102 -102
- package/bun.lock +916 -0
- package/components/base.components/chip/Chip.component.tsx +39 -39
- package/components/base.components/document/DocumentViewer.component.tsx +163 -163
- package/components/base.components/document/ExportExcel.component.tsx +340 -340
- package/components/base.components/document/ImportExcel.component.tsx +315 -315
- package/components/base.components/document/PrintTable.component.tsx +204 -204
- package/components/base.components/document/RenderPDF.component.tsx +415 -415
- package/components/base.components/input/Checkbox.component.tsx +109 -109
- package/components/base.components/input/Input.component.tsx +332 -332
- package/components/base.components/input/InputCheckbox.component.tsx +174 -174
- package/components/base.components/input/InputCurrency.component.tsx +163 -163
- package/components/base.components/input/InputDate.component.tsx +352 -352
- package/components/base.components/input/InputDatetime.component.tsx +260 -260
- package/components/base.components/input/InputDocument.component.tsx +351 -351
- package/components/base.components/input/InputImage.component.tsx +533 -533
- package/components/base.components/input/InputMap.component.tsx +317 -317
- package/components/base.components/input/InputNumber.component.tsx +192 -192
- package/components/base.components/input/InputOtp.component.tsx +169 -169
- package/components/base.components/input/InputPassword.component.tsx +236 -236
- package/components/base.components/input/InputRadio.component.tsx +175 -175
- package/components/base.components/input/InputTime.component.tsx +275 -275
- package/components/base.components/input/InputValues.component.tsx +68 -68
- package/components/base.components/input/Radio.component.tsx +102 -102
- package/components/base.components/input/Select.component.tsx +541 -541
- package/components/base.components/modal/BottomSheet.component.tsx +245 -245
- package/components/base.components/supervision/FormSupervision.component.tsx +433 -433
- package/components/base.components/supervision/TableSupervision.component.tsx +697 -697
- package/components/base.components/table/ControlBar.component.tsx +497 -497
- package/components/base.components/table/FilterComponent.tsx +518 -518
- package/components/base.components/table/Table.component.tsx +469 -469
- package/components/base.components/typography/TypographyArticle.component.tsx +26 -26
- package/components/base.components/typography/TypographyColumn.component.tsx +20 -20
- package/components/base.components/typography/TypographyContent.component.tsx +20 -20
- package/components/base.components/typography/TypographyTips.component.tsx +20 -20
- package/components/base.components/wrap/Draggable.component.tsx +303 -303
- package/components/base.components/wrap/IDBProvider.tsx +12 -12
- package/components/base.components/wrap/Image.component.tsx +9 -9
- package/components/base.components/wrap/ShortcutProvider.tsx +57 -57
- package/components/base.components/wrap/Swipe.component.tsx +93 -93
- package/components/index.ts +2 -2
- package/contexts/AppProvider.tsx +11 -11
- package/contexts/Auth.context.tsx +64 -64
- package/contexts/Toggle.context.tsx +44 -44
- package/next.config.ts +15 -1
- package/package.json +14 -13
- package/public/204.svg +19 -19
- package/public/500.svg +39 -39
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/images/logo-fill.png +0 -0
- package/public/images/logo-full-fill.png +0 -0
- package/public/images/logo-full.png +0 -0
- package/public/images/logo.png +0 -0
- package/schema/idb/app.schema.ts +8 -8
- package/src-tauri/Cargo.toml +14 -0
- package/src-tauri/build.rs +3 -0
- package/src-tauri/capabilities/default.json +11 -0
- package/src-tauri/icons/128x128.png +0 -0
- package/src-tauri/icons/128x128@2x.png +0 -0
- package/src-tauri/icons/32x32.png +0 -0
- package/src-tauri/icons/icon.icns +0 -0
- package/src-tauri/icons/icon.ico +0 -0
- package/src-tauri/src/main.rs +7 -0
- package/src-tauri/tauri.conf.json +36 -0
- package/styles/globals.css +231 -231
- package/styles/tailwind.safelist +68 -68
- package/utils/commands/barrels.ts +27 -27
- package/utils/commands/light.ts +21 -21
- package/utils/commands/logger.ts +42 -42
- package/utils/commands/stubs/table-blueprint.stub +12 -12
- package/utils/commands/use-pdf.ts +29 -29
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
|
-
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
-
import { cn } from '@utils';
|
|
5
|
-
|
|
6
|
-
export function InputValues({
|
|
7
|
-
value,
|
|
8
|
-
className,
|
|
9
|
-
onDelete,
|
|
10
|
-
isFocus,
|
|
11
|
-
onFocus,
|
|
12
|
-
style,
|
|
13
|
-
} : {
|
|
14
|
-
value?: string[] | number[];
|
|
15
|
-
className?: string;
|
|
16
|
-
onDelete?: (val: string | number, index: string | number) => void;
|
|
17
|
-
isFocus?: boolean,
|
|
18
|
-
onFocus?: () => void;
|
|
19
|
-
style?: CSSProperties
|
|
20
|
-
}) {
|
|
21
|
-
if(isFocus) {
|
|
22
|
-
return (
|
|
23
|
-
<>
|
|
24
|
-
{!!value?.length && (
|
|
25
|
-
<div className={cn(`p-2 rounded-sm absolute left-0 w-full bg-background border-b border-x z-30 overflow-hidden ease-in-out max-h-[200px] overflow-y-auto flex gap-2 flex-wrap`, className)} onClick={() => onFocus?.()}>
|
|
26
|
-
{value?.map((item, key) => {
|
|
27
|
-
return (
|
|
28
|
-
<div key={key} className={`input-values-item`}>
|
|
29
|
-
<span className="">{item}</span>
|
|
30
|
-
<FontAwesomeIcon
|
|
31
|
-
icon={faTimes}
|
|
32
|
-
className={`input-values-delete`}
|
|
33
|
-
onClick={() => onDelete?.(item, key)}
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
);
|
|
37
|
-
})}
|
|
38
|
-
</div>
|
|
39
|
-
)}
|
|
40
|
-
</>
|
|
41
|
-
)
|
|
42
|
-
} else {
|
|
43
|
-
return (
|
|
44
|
-
<>
|
|
45
|
-
<div
|
|
46
|
-
className={cn(`absolute top-1/2 -translate-y-1/2 overflow-x-hidden py-1.5 input-scroll w-max`, className)}
|
|
47
|
-
style={style}
|
|
48
|
-
onClick={() => onFocus?.()}
|
|
49
|
-
>
|
|
50
|
-
<div className={`input-values-container`}>
|
|
51
|
-
{value?.map((item, key) => {
|
|
52
|
-
return (
|
|
53
|
-
<div key={key} className={`input-values-item`}>
|
|
54
|
-
<span>{item}</span>
|
|
55
|
-
<FontAwesomeIcon
|
|
56
|
-
icon={faTimes}
|
|
57
|
-
className={`input-values-delete`}
|
|
58
|
-
onClick={() => onDelete?.(item, key)}
|
|
59
|
-
/>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
})}
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { cn } from '@utils';
|
|
5
|
+
|
|
6
|
+
export function InputValues({
|
|
7
|
+
value,
|
|
8
|
+
className,
|
|
9
|
+
onDelete,
|
|
10
|
+
isFocus,
|
|
11
|
+
onFocus,
|
|
12
|
+
style,
|
|
13
|
+
} : {
|
|
14
|
+
value?: string[] | number[];
|
|
15
|
+
className?: string;
|
|
16
|
+
onDelete?: (val: string | number, index: string | number) => void;
|
|
17
|
+
isFocus?: boolean,
|
|
18
|
+
onFocus?: () => void;
|
|
19
|
+
style?: CSSProperties
|
|
20
|
+
}) {
|
|
21
|
+
if(isFocus) {
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
{!!value?.length && (
|
|
25
|
+
<div className={cn(`p-2 rounded-sm absolute left-0 w-full bg-background border-b border-x z-30 overflow-hidden ease-in-out max-h-[200px] overflow-y-auto flex gap-2 flex-wrap`, className)} onClick={() => onFocus?.()}>
|
|
26
|
+
{value?.map((item, key) => {
|
|
27
|
+
return (
|
|
28
|
+
<div key={key} className={`input-values-item`}>
|
|
29
|
+
<span className="">{item}</span>
|
|
30
|
+
<FontAwesomeIcon
|
|
31
|
+
icon={faTimes}
|
|
32
|
+
className={`input-values-delete`}
|
|
33
|
+
onClick={() => onDelete?.(item, key)}
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
})}
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
</>
|
|
41
|
+
)
|
|
42
|
+
} else {
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<div
|
|
46
|
+
className={cn(`absolute top-1/2 -translate-y-1/2 overflow-x-hidden py-1.5 input-scroll w-max`, className)}
|
|
47
|
+
style={style}
|
|
48
|
+
onClick={() => onFocus?.()}
|
|
49
|
+
>
|
|
50
|
+
<div className={`input-values-container`}>
|
|
51
|
+
{value?.map((item, key) => {
|
|
52
|
+
return (
|
|
53
|
+
<div key={key} className={`input-values-item`}>
|
|
54
|
+
<span>{item}</span>
|
|
55
|
+
<FontAwesomeIcon
|
|
56
|
+
icon={faTimes}
|
|
57
|
+
className={`input-values-delete`}
|
|
58
|
+
onClick={() => onDelete?.(item, key)}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
})}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -1,102 +1,102 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
4
|
-
import { cn, pcn, useInputRandomId } from "@utils";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type CT = "label" | "checked" | "error" | "input";
|
|
9
|
-
|
|
10
|
-
export interface RadioProps {
|
|
11
|
-
name : string;
|
|
12
|
-
label ?: string;
|
|
13
|
-
|
|
14
|
-
value ?: string;
|
|
15
|
-
disabled ?: boolean;
|
|
16
|
-
checked ?: boolean;
|
|
17
|
-
invalid ?: string;
|
|
18
|
-
|
|
19
|
-
onChange ?: () => void;
|
|
20
|
-
|
|
21
|
-
/** Use custom class with: "label::", "checked::", "error::". */
|
|
22
|
-
className ?: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export function RadioComponent({
|
|
29
|
-
name,
|
|
30
|
-
label,
|
|
31
|
-
|
|
32
|
-
value,
|
|
33
|
-
disabled,
|
|
34
|
-
checked,
|
|
35
|
-
invalid,
|
|
36
|
-
|
|
37
|
-
onChange,
|
|
38
|
-
|
|
39
|
-
className = "",
|
|
40
|
-
}: RadioProps) {
|
|
41
|
-
|
|
42
|
-
// =========================>
|
|
43
|
-
// ## initial
|
|
44
|
-
// =========================>
|
|
45
|
-
const randomId = useInputRandomId()
|
|
46
|
-
const [invalidMessage, setInvalidMessage] = useState("");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// =========================>
|
|
50
|
-
// ## invalid handler
|
|
51
|
-
// =========================>
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
setInvalidMessage(invalid || "");
|
|
54
|
-
}, [invalid]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<>
|
|
59
|
-
<div className={`flex flex-col gap-1 `}>
|
|
60
|
-
<input
|
|
61
|
-
type="checkbox"
|
|
62
|
-
className="hidden"
|
|
63
|
-
id={randomId}
|
|
64
|
-
name={name}
|
|
65
|
-
onChange={onChange}
|
|
66
|
-
defaultChecked={checked}
|
|
67
|
-
value={value}
|
|
68
|
-
disabled={disabled}
|
|
69
|
-
/>
|
|
70
|
-
|
|
71
|
-
<label
|
|
72
|
-
htmlFor={randomId}
|
|
73
|
-
className={`flex gap-2 items-center cursor-pointer ${
|
|
74
|
-
disabled ? "pointer-events-none opacity-60" : ""
|
|
75
|
-
}`}
|
|
76
|
-
>
|
|
77
|
-
<div
|
|
78
|
-
className={cn(
|
|
79
|
-
`flex justify-center items-center rounded-full w-5 h-5 active:outline border border-light-foreground`,
|
|
80
|
-
checked && "border-[5px] outline-light-primary !border-primary",
|
|
81
|
-
checked && pcn<CT>(className, "checked"),
|
|
82
|
-
pcn<CT>(className, "input"),
|
|
83
|
-
)}
|
|
84
|
-
></div>
|
|
85
|
-
<div
|
|
86
|
-
className={cn(
|
|
87
|
-
"whitespace-nowrap",
|
|
88
|
-
pcn<CT>(className, "label"),
|
|
89
|
-
checked && "font-semibold",
|
|
90
|
-
checked && pcn<CT>(className, "label", "checked"),
|
|
91
|
-
disabled && pcn<CT>(className, "label", "disabled"),
|
|
92
|
-
)}
|
|
93
|
-
>{label}</div>
|
|
94
|
-
</label>
|
|
95
|
-
|
|
96
|
-
{invalidMessage && (
|
|
97
|
-
<small className={cn("input-error-message", pcn<CT>(className, "error"))}>{invalidMessage}</small>
|
|
98
|
-
)}
|
|
99
|
-
</div>
|
|
100
|
-
</>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { cn, pcn, useInputRandomId } from "@utils";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
type CT = "label" | "checked" | "error" | "input";
|
|
9
|
+
|
|
10
|
+
export interface RadioProps {
|
|
11
|
+
name : string;
|
|
12
|
+
label ?: string;
|
|
13
|
+
|
|
14
|
+
value ?: string;
|
|
15
|
+
disabled ?: boolean;
|
|
16
|
+
checked ?: boolean;
|
|
17
|
+
invalid ?: string;
|
|
18
|
+
|
|
19
|
+
onChange ?: () => void;
|
|
20
|
+
|
|
21
|
+
/** Use custom class with: "label::", "checked::", "error::". */
|
|
22
|
+
className ?: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export function RadioComponent({
|
|
29
|
+
name,
|
|
30
|
+
label,
|
|
31
|
+
|
|
32
|
+
value,
|
|
33
|
+
disabled,
|
|
34
|
+
checked,
|
|
35
|
+
invalid,
|
|
36
|
+
|
|
37
|
+
onChange,
|
|
38
|
+
|
|
39
|
+
className = "",
|
|
40
|
+
}: RadioProps) {
|
|
41
|
+
|
|
42
|
+
// =========================>
|
|
43
|
+
// ## initial
|
|
44
|
+
// =========================>
|
|
45
|
+
const randomId = useInputRandomId()
|
|
46
|
+
const [invalidMessage, setInvalidMessage] = useState("");
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// =========================>
|
|
50
|
+
// ## invalid handler
|
|
51
|
+
// =========================>
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setInvalidMessage(invalid || "");
|
|
54
|
+
}, [invalid]);
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
<div className={`flex flex-col gap-1 `}>
|
|
60
|
+
<input
|
|
61
|
+
type="checkbox"
|
|
62
|
+
className="hidden"
|
|
63
|
+
id={randomId}
|
|
64
|
+
name={name}
|
|
65
|
+
onChange={onChange}
|
|
66
|
+
defaultChecked={checked}
|
|
67
|
+
value={value}
|
|
68
|
+
disabled={disabled}
|
|
69
|
+
/>
|
|
70
|
+
|
|
71
|
+
<label
|
|
72
|
+
htmlFor={randomId}
|
|
73
|
+
className={`flex gap-2 items-center cursor-pointer ${
|
|
74
|
+
disabled ? "pointer-events-none opacity-60" : ""
|
|
75
|
+
}`}
|
|
76
|
+
>
|
|
77
|
+
<div
|
|
78
|
+
className={cn(
|
|
79
|
+
`flex justify-center items-center rounded-full w-5 h-5 active:outline border border-light-foreground`,
|
|
80
|
+
checked && "border-[5px] outline-light-primary !border-primary",
|
|
81
|
+
checked && pcn<CT>(className, "checked"),
|
|
82
|
+
pcn<CT>(className, "input"),
|
|
83
|
+
)}
|
|
84
|
+
></div>
|
|
85
|
+
<div
|
|
86
|
+
className={cn(
|
|
87
|
+
"whitespace-nowrap",
|
|
88
|
+
pcn<CT>(className, "label"),
|
|
89
|
+
checked && "font-semibold",
|
|
90
|
+
checked && pcn<CT>(className, "label", "checked"),
|
|
91
|
+
disabled && pcn<CT>(className, "label", "disabled"),
|
|
92
|
+
)}
|
|
93
|
+
>{label}</div>
|
|
94
|
+
</label>
|
|
95
|
+
|
|
96
|
+
{invalidMessage && (
|
|
97
|
+
<small className={cn("input-error-message", pcn<CT>(className, "error"))}>{invalidMessage}</small>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
</>
|
|
101
|
+
);
|
|
102
|
+
}
|