@g4rcez/components 2.0.19 → 2.0.21
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/components/display/notifications.d.ts +1 -1
- package/dist/components/floating/menu.d.ts +2 -2
- package/dist/components/floating/modal.d.ts +2 -2
- package/dist/components/index.d.ts +27 -25
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +27 -25
- package/dist/hooks/use-form.js +2 -2
- package/dist/hooks/use-preferences.d.ts +2 -0
- package/dist/hooks/use-preferences.d.ts.map +1 -0
- package/dist/hooks/use-preferences.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25351 -25323
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +65 -65
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
2
2
|
import { type PropsWithChildren } from "react";
|
|
3
3
|
import { Label } from "../../types";
|
|
4
4
|
declare const variants: (props?: ({
|
|
5
|
-
theme?: "
|
|
5
|
+
theme?: "info" | "warn" | "muted" | "danger" | "success" | "secondary" | "default" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
7
|
type NotificationOptions = Partial<{
|
|
8
8
|
title: Label;
|
|
@@ -22,7 +22,7 @@ type MenuItemProps = {
|
|
|
22
22
|
Right?: React.FC<LucideProps>;
|
|
23
23
|
};
|
|
24
24
|
export declare const MenuItem: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof MenuItemProps> & MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
-
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "
|
|
25
|
+
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "hover" | "open" | "asChild" | "restoreFocus" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
26
26
|
hover: boolean;
|
|
27
27
|
open?: boolean;
|
|
28
28
|
nested: boolean;
|
|
@@ -34,7 +34,7 @@ export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.Deta
|
|
|
34
34
|
FloatingComponent: React.ElementType;
|
|
35
35
|
} & {
|
|
36
36
|
label: string;
|
|
37
|
-
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "
|
|
37
|
+
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "hover" | "open" | "asChild" | "restoreFocus" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
38
38
|
hover: boolean;
|
|
39
39
|
open?: boolean;
|
|
40
40
|
nested: boolean;
|
|
@@ -35,7 +35,7 @@ type ModalRef = {
|
|
|
35
35
|
context: any;
|
|
36
36
|
floating: HTMLElement | null;
|
|
37
37
|
};
|
|
38
|
-
export declare const Modal: React.ForwardRefExoticComponent<(Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "className" | "role" | "onChange" | "
|
|
38
|
+
export declare const Modal: React.ForwardRefExoticComponent<(Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "className" | "role" | "onChange" | "position" | "open" | "resizer" | "type" | "asChild" | "layoutId" | "trigger" | "animated" | "closable" | "forceType" | "bodyClassName" | "overlayClassName" | "overlayClickClose" | "interactions" | "ariaTitle"> & {
|
|
39
39
|
title: Label;
|
|
40
40
|
ariaTitle?: string;
|
|
41
41
|
} & {
|
|
@@ -60,7 +60,7 @@ export declare const Modal: React.ForwardRefExoticComponent<(Omit<Omit<HTMLMotio
|
|
|
60
60
|
trigger: Label | React.FC<any>;
|
|
61
61
|
}> & {
|
|
62
62
|
children?: React.ReactNode | undefined;
|
|
63
|
-
}, "ref"> | Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "className" | "role" | "onChange" | "
|
|
63
|
+
}, "ref"> | Omit<Omit<HTMLMotionProps<"div">, "footer" | "title" | "className" | "role" | "onChange" | "position" | "open" | "resizer" | "type" | "asChild" | "layoutId" | "trigger" | "animated" | "closable" | "forceType" | "bodyClassName" | "overlayClassName" | "overlayClickClose" | "interactions" | "ariaTitle"> & {
|
|
64
64
|
ariaTitle: string;
|
|
65
65
|
title?: Label;
|
|
66
66
|
} & {
|
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
export * from "./core/button";
|
|
2
|
-
export * from "./core/polymorph";
|
|
3
|
-
export * from "./core/render-on-view";
|
|
4
1
|
export * from "./core/tag";
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
2
|
+
export * from "./form/form";
|
|
3
|
+
export * from "./form/input";
|
|
4
|
+
export * from "./core/button";
|
|
5
|
+
export * from "./form/select";
|
|
6
|
+
export * from "./form/slider";
|
|
7
|
+
export * from "./form/switch";
|
|
8
|
+
export * from "./table/index";
|
|
7
9
|
export * from "./display/card";
|
|
10
|
+
export * from "./display/list";
|
|
11
|
+
export * from "./display/tabs";
|
|
12
|
+
export * from "./display/alert";
|
|
8
13
|
export * from "./display/empty";
|
|
9
|
-
export * from "./display/notifications";
|
|
10
|
-
export * from "./display/progress";
|
|
11
14
|
export * from "./display/stats";
|
|
12
|
-
export * from "./display/tabs";
|
|
13
|
-
export * from "./display/timeline";
|
|
14
|
-
export * from "./display/list";
|
|
15
|
-
export * from "./floating/command-palette";
|
|
16
|
-
export * from "./floating/dropdown";
|
|
17
|
-
export * from "./floating/expand";
|
|
18
15
|
export * from "./floating/menu";
|
|
16
|
+
export * from "./form/checkbox";
|
|
17
|
+
export * from "./form/radiobox";
|
|
18
|
+
export * from "./form/textarea";
|
|
19
|
+
export * from "./core/polymorph";
|
|
19
20
|
export * from "./floating/modal";
|
|
21
|
+
export * from "./form/task-list";
|
|
22
|
+
export * from "./core/typography";
|
|
23
|
+
export * from "./display/spinner";
|
|
24
|
+
export * from "./floating/expand";
|
|
25
|
+
export * from "./display/calendar";
|
|
26
|
+
export * from "./display/progress";
|
|
27
|
+
export * from "./display/timeline";
|
|
20
28
|
export * from "./floating/toolbar";
|
|
21
29
|
export * from "./floating/tooltip";
|
|
22
|
-
export * from "./form/autocomplete";
|
|
23
|
-
export * from "./form/checkbox";
|
|
24
30
|
export * from "./form/date-picker";
|
|
25
31
|
export * from "./form/file-upload";
|
|
26
|
-
export * from "./form/form";
|
|
27
|
-
export * from "./form/input";
|
|
28
32
|
export * from "./form/input-field";
|
|
33
|
+
export * from "./floating/dropdown";
|
|
34
|
+
export * from "./form/autocomplete";
|
|
29
35
|
export * from "./form/multi-select";
|
|
30
|
-
export * from "./form/radiobox";
|
|
31
|
-
export * from "./form/select";
|
|
32
|
-
export * from "./form/slider";
|
|
33
|
-
export * from "./form/switch";
|
|
34
|
-
export * from "./form/task-list";
|
|
35
|
-
export * from "./form/textarea";
|
|
36
36
|
export * from "./form/transfer-list";
|
|
37
|
-
export * from "./
|
|
38
|
-
export
|
|
37
|
+
export * from "./core/render-on-view";
|
|
38
|
+
export * from "./display/notifications";
|
|
39
|
+
export * from "./floating/command-palette";
|
|
39
40
|
export { formReset } from "./form/formReset";
|
|
41
|
+
export { createColumns, createOptionCols, type ColType, useTablePreferences, type TablePagination } from "./table/table-lib";
|
|
40
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3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./core/button";
|
|
2
|
-
export * from "./core/polymorph";
|
|
3
|
-
export * from "./core/render-on-view";
|
|
4
1
|
export * from "./core/tag";
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
2
|
+
export * from "./form/form";
|
|
3
|
+
export * from "./form/input";
|
|
4
|
+
export * from "./core/button";
|
|
5
|
+
export * from "./form/select";
|
|
6
|
+
export * from "./form/slider";
|
|
7
|
+
export * from "./form/switch";
|
|
8
|
+
export * from "./table/index";
|
|
7
9
|
export * from "./display/card";
|
|
10
|
+
export * from "./display/list";
|
|
11
|
+
export * from "./display/tabs";
|
|
12
|
+
export * from "./display/alert";
|
|
8
13
|
export * from "./display/empty";
|
|
9
|
-
export * from "./display/notifications";
|
|
10
|
-
export * from "./display/progress";
|
|
11
14
|
export * from "./display/stats";
|
|
12
|
-
export * from "./display/tabs";
|
|
13
|
-
export * from "./display/timeline";
|
|
14
|
-
export * from "./display/list";
|
|
15
|
-
export * from "./floating/command-palette";
|
|
16
|
-
export * from "./floating/dropdown";
|
|
17
|
-
export * from "./floating/expand";
|
|
18
15
|
export * from "./floating/menu";
|
|
16
|
+
export * from "./form/checkbox";
|
|
17
|
+
export * from "./form/radiobox";
|
|
18
|
+
export * from "./form/textarea";
|
|
19
|
+
export * from "./core/polymorph";
|
|
19
20
|
export * from "./floating/modal";
|
|
21
|
+
export * from "./form/task-list";
|
|
22
|
+
export * from "./core/typography";
|
|
23
|
+
export * from "./display/spinner";
|
|
24
|
+
export * from "./floating/expand";
|
|
25
|
+
export * from "./display/calendar";
|
|
26
|
+
export * from "./display/progress";
|
|
27
|
+
export * from "./display/timeline";
|
|
20
28
|
export * from "./floating/toolbar";
|
|
21
29
|
export * from "./floating/tooltip";
|
|
22
|
-
export * from "./form/autocomplete";
|
|
23
|
-
export * from "./form/checkbox";
|
|
24
30
|
export * from "./form/date-picker";
|
|
25
31
|
export * from "./form/file-upload";
|
|
26
|
-
export * from "./form/form";
|
|
27
|
-
export * from "./form/input";
|
|
28
32
|
export * from "./form/input-field";
|
|
33
|
+
export * from "./floating/dropdown";
|
|
34
|
+
export * from "./form/autocomplete";
|
|
29
35
|
export * from "./form/multi-select";
|
|
30
|
-
export * from "./form/radiobox";
|
|
31
|
-
export * from "./form/select";
|
|
32
|
-
export * from "./form/slider";
|
|
33
|
-
export * from "./form/switch";
|
|
34
|
-
export * from "./form/task-list";
|
|
35
|
-
export * from "./form/textarea";
|
|
36
36
|
export * from "./form/transfer-list";
|
|
37
|
-
export * from "./
|
|
38
|
-
export
|
|
37
|
+
export * from "./core/render-on-view";
|
|
38
|
+
export * from "./display/notifications";
|
|
39
|
+
export * from "./floating/command-palette";
|
|
39
40
|
export { formReset } from "./form/formReset";
|
|
41
|
+
export { createColumns, createOptionCols, useTablePreferences } from "./table/table-lib";
|
package/dist/hooks/use-form.js
CHANGED
|
@@ -17,7 +17,7 @@ const isValidJSON = (value) => {
|
|
|
17
17
|
try {
|
|
18
18
|
value = JSON.stringify(value);
|
|
19
19
|
}
|
|
20
|
-
catch
|
|
20
|
+
catch {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -25,7 +25,7 @@ const isValidJSON = (value) => {
|
|
|
25
25
|
JSON.parse(value);
|
|
26
26
|
return true;
|
|
27
27
|
}
|
|
28
|
-
catch
|
|
28
|
+
catch {
|
|
29
29
|
return false;
|
|
30
30
|
}
|
|
31
31
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-preferences.d.ts","sourceRoot":"","sources":["../../src/hooks/use-preferences.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,EAChD,KAAK,CAAC,EACN,cAAc,CAAC,2BASJ,UAAU,6DAAiB,CAAC,CAAC,CAAC,cAc1C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
import { Is } from "sidekicker";
|
|
3
|
+
import { LocalStorage } from "storage-manager-js";
|
|
4
|
+
export const usePreferences = (key, defaultValue) => {
|
|
5
|
+
const [state, setState] = useState(() => {
|
|
6
|
+
const saved = LocalStorage.get(key);
|
|
7
|
+
if (saved)
|
|
8
|
+
return saved;
|
|
9
|
+
return defaultValue;
|
|
10
|
+
});
|
|
11
|
+
const setCallback = useCallback((params) => {
|
|
12
|
+
if (Is.function(params)) {
|
|
13
|
+
return setState((prev) => {
|
|
14
|
+
const result = params(prev);
|
|
15
|
+
LocalStorage.set(key, result);
|
|
16
|
+
return result;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
LocalStorage.set(key, params);
|
|
20
|
+
return params;
|
|
21
|
+
}, [key]);
|
|
22
|
+
return [state, setCallback];
|
|
23
|
+
};
|