@code0-tech/pictor 0.13.1 → 0.15.0
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/LICENSE +2 -3
- package/dist/assets/components/avatar/Avatar.style.css +1 -1
- package/dist/assets/components/form/DateInput.style.css +1 -0
- package/dist/assets/components/toast/Toast.style.css +1 -1
- package/dist/components/command/Command.js +29 -21
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/form/DateInput.d.ts +37 -0
- package/dist/components/form/DateInput.js +285 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/index.js +71 -63
- package/dist/components/toast/Toast.d.ts +5 -4
- package/dist/components/toast/Toast.js +76 -57
- package/dist/index.js +166 -158
- package/package.json +23 -21
- package/dist/assets/components/island/Island.style.css +0 -1
- package/dist/components/island/Island.d.ts +0 -6
- package/dist/components/island/Island.hook.d.ts +0 -19
- package/dist/components/island/Island.hook.js +0 -58
- package/dist/components/island/Island.js +0 -71
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/pictor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A simple template for a custom React component library",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"author": "CodeZero",
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@ark-ui/react": "^5.36.2",
|
|
21
|
+
"@internationalized/date": "^3.12.0",
|
|
21
22
|
"@babel/plugin-proposal-decorators": "^7.29.7",
|
|
22
23
|
"@babel/plugin-transform-class-properties": "^7.29.7",
|
|
23
24
|
"@codemirror/autocomplete": "^6.20.3",
|
|
@@ -25,24 +26,24 @@
|
|
|
25
26
|
"@codemirror/language": "^6.12.4",
|
|
26
27
|
"@codemirror/lint": "^6.9.7",
|
|
27
28
|
"@codemirror/state": "^6.7.1",
|
|
28
|
-
"@codemirror/view": "^6.43.
|
|
29
|
+
"@codemirror/view": "^6.43.6",
|
|
29
30
|
"@dagrejs/dagre": "^3.0.0",
|
|
30
31
|
"@icons-pack/react-simple-icons": "^13.13.0",
|
|
31
32
|
"@lezer/common": "^1.5.2",
|
|
32
33
|
"@mdx-js/react": "^3.1.1",
|
|
33
|
-
"@radix-ui/react-checkbox": "^1.3.
|
|
34
|
-
"@radix-ui/react-context-menu": "^2.
|
|
35
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
36
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
37
|
-
"@radix-ui/react-hover-card": "^1.1.
|
|
38
|
-
"@radix-ui/react-one-time-password-field": "^0.1.
|
|
39
|
-
"@radix-ui/react-progress": "^1.1.
|
|
40
|
-
"@radix-ui/react-radio-group": "^1.
|
|
41
|
-
"@radix-ui/react-scroll-area": "^1.2.
|
|
42
|
-
"@radix-ui/react-select": "^2.
|
|
43
|
-
"@radix-ui/react-tabs": "^1.1.
|
|
44
|
-
"@radix-ui/react-toggle-group": "^1.1.
|
|
45
|
-
"@radix-ui/react-tooltip": "^1.2.
|
|
34
|
+
"@radix-ui/react-checkbox": "^1.3.9",
|
|
35
|
+
"@radix-ui/react-context-menu": "^2.3.5",
|
|
36
|
+
"@radix-ui/react-dialog": "^1.1.21",
|
|
37
|
+
"@radix-ui/react-dropdown-menu": "^2.1.22",
|
|
38
|
+
"@radix-ui/react-hover-card": "^1.1.21",
|
|
39
|
+
"@radix-ui/react-one-time-password-field": "^0.1.14",
|
|
40
|
+
"@radix-ui/react-progress": "^1.1.14",
|
|
41
|
+
"@radix-ui/react-radio-group": "^1.4.5",
|
|
42
|
+
"@radix-ui/react-scroll-area": "^1.2.16",
|
|
43
|
+
"@radix-ui/react-select": "^2.3.5",
|
|
44
|
+
"@radix-ui/react-tabs": "^1.1.19",
|
|
45
|
+
"@radix-ui/react-toggle-group": "^1.1.17",
|
|
46
|
+
"@radix-ui/react-tooltip": "^1.2.14",
|
|
46
47
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
47
48
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
48
49
|
"@rollup/plugin-terser": "^1.0.0",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"@storybook/react-vite": "^10.4.2",
|
|
58
59
|
"@tabler/icons-react": "3.41.1",
|
|
59
60
|
"@types/jest-image-snapshot": "^6.4.1",
|
|
60
|
-
"@types/react": "^19.2.
|
|
61
|
+
"@types/react": "^19.2.17",
|
|
61
62
|
"@types/react-dom": "^19.2.3",
|
|
62
63
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
63
64
|
"@uiw/codemirror-themes": "^4.25.10",
|
|
@@ -80,8 +81,8 @@
|
|
|
80
81
|
"merge-props": "^6.0.0",
|
|
81
82
|
"motion": "^12.40.0",
|
|
82
83
|
"playwright": "1.58.1",
|
|
83
|
-
"react": "^19.2.
|
|
84
|
-
"react-dom": "^19.2.
|
|
84
|
+
"react": "^19.2.7",
|
|
85
|
+
"react-dom": "^19.2.7",
|
|
85
86
|
"react-resizable-panels": "^4.9.0",
|
|
86
87
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
87
88
|
"rimraf": "^6.1.3",
|
|
@@ -93,15 +94,15 @@
|
|
|
93
94
|
"sonner": "^2.0.7",
|
|
94
95
|
"storybook": "^10.4.2",
|
|
95
96
|
"style-loader": "^4.0.0",
|
|
96
|
-
"ts-jest": "^29.4.
|
|
97
|
+
"ts-jest": "^29.4.11",
|
|
97
98
|
"ts-node": "^10.9.2",
|
|
98
99
|
"typescript": "^5.9.3",
|
|
99
|
-
"vite": "^7.3.
|
|
100
|
+
"vite": "^7.3.6",
|
|
100
101
|
"vite-plugin-dts": "^4.5.4",
|
|
101
102
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
102
103
|
"vite-plugin-svgr": "^5.2.0",
|
|
103
104
|
"vitest": "^4.1.2",
|
|
104
|
-
"zustand": "^4.
|
|
105
|
+
"zustand": "^4.5.7"
|
|
105
106
|
},
|
|
106
107
|
"main": "dist/index.js",
|
|
107
108
|
"repository": {
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
"types": "dist/index.d.ts",
|
|
115
116
|
"peerDependencies": {
|
|
116
117
|
"@ark-ui/react": "^5.36.2",
|
|
118
|
+
"@internationalized/date": "^3.12.0",
|
|
117
119
|
"@icons-pack/react-simple-icons": "^13.13.0",
|
|
118
120
|
"@codemirror/autocomplete": "^6.20.0",
|
|
119
121
|
"@codemirror/lang-json": "^6.0.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.island{background:#070514;box-shadow:inset 0 1px 1px #bfbfbf1a;border:none;color:#ffffffbf;position:relative;box-sizing:border-box;border-radius:1rem;cursor:pointer;overflow:hidden;max-width:max-content;min-height:max-content}.island *{box-sizing:border-box}.island__icon{--path-offset: 300%;display:inline-flex;padding-left:.7rem}.island__icon svg path{stroke-dasharray:300%;stroke-dashoffset:inherit}.island__message{padding-right:.7rem}.island__content{padding:.7rem;position:relative;width:100%;max-width:100%;height:100%;overflow:hidden}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
export interface IslandNotificationProps {
|
|
3
|
-
id?: number;
|
|
4
|
-
icon: React.ReactNode;
|
|
5
|
-
message: React.ReactNode;
|
|
6
|
-
content?: React.ReactNode;
|
|
7
|
-
duration?: number;
|
|
8
|
-
index?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const useIsland: import('zustand').UseBoundStore<import('zustand').StoreApi<{
|
|
11
|
-
toasts: IslandNotificationProps[];
|
|
12
|
-
addToast: (toast: IslandNotificationProps) => void;
|
|
13
|
-
removeToast: (id: number) => void;
|
|
14
|
-
}>>;
|
|
15
|
-
export declare const addIslandNotification: (toast: IslandNotificationProps) => void;
|
|
16
|
-
export declare const addIslandInfoNotification: (toast: Partial<IslandNotificationProps>) => void;
|
|
17
|
-
export declare const addIslandSuccessNotification: (toast: Partial<IslandNotificationProps>) => void;
|
|
18
|
-
export declare const addIslandWarningNotification: (toast: Partial<IslandNotificationProps>) => void;
|
|
19
|
-
export declare const addIslandErrorNotification: (toast: Partial<IslandNotificationProps>) => void;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { create as n } from "zustand";
|
|
3
|
-
import { IconCircleX as d, IconInfoCircle as r, IconCircleCheck as l, IconAlertCircle as m } from "@tabler/icons-react";
|
|
4
|
-
import { Text as s } from "../text/Text.js";
|
|
5
|
-
const t = n((o) => ({
|
|
6
|
-
toasts: [],
|
|
7
|
-
addToast: (a) => {
|
|
8
|
-
const i = Date.now();
|
|
9
|
-
o((c) => ({
|
|
10
|
-
toasts: [...c.toasts, {
|
|
11
|
-
id: i,
|
|
12
|
-
...a
|
|
13
|
-
}]
|
|
14
|
-
}));
|
|
15
|
-
},
|
|
16
|
-
removeToast: (a) => {
|
|
17
|
-
o((i) => ({
|
|
18
|
-
toasts: i.toasts.filter((c) => c.id !== a)
|
|
19
|
-
}));
|
|
20
|
-
}
|
|
21
|
-
})), x = (o) => {
|
|
22
|
-
t.getState().addToast(o);
|
|
23
|
-
}, B = (o) => {
|
|
24
|
-
t.getState().addToast({
|
|
25
|
-
icon: /* @__PURE__ */ e(r, { color: "#70ffb2", size: 16 }),
|
|
26
|
-
...o,
|
|
27
|
-
message: /* @__PURE__ */ e(s, { c: "#70ffb2", children: o.message })
|
|
28
|
-
});
|
|
29
|
-
}, F = (o) => {
|
|
30
|
-
t.getState().addToast({
|
|
31
|
-
icon: /* @__PURE__ */ e(l, { color: "#29BF12", size: 16 }),
|
|
32
|
-
index: 1,
|
|
33
|
-
...o,
|
|
34
|
-
message: /* @__PURE__ */ e(s, { c: "#29BF12", children: o.message })
|
|
35
|
-
});
|
|
36
|
-
}, S = (o) => {
|
|
37
|
-
t.getState().addToast({
|
|
38
|
-
icon: /* @__PURE__ */ e(m, { color: "#FFBE0B", size: 16 }),
|
|
39
|
-
index: 2,
|
|
40
|
-
...o,
|
|
41
|
-
message: /* @__PURE__ */ e(s, { c: "#FFBE0B", children: o.message })
|
|
42
|
-
});
|
|
43
|
-
}, h = (o) => {
|
|
44
|
-
t.getState().addToast({
|
|
45
|
-
icon: /* @__PURE__ */ e(d, { color: "#D90429", size: 16 }),
|
|
46
|
-
index: 3,
|
|
47
|
-
...o,
|
|
48
|
-
message: /* @__PURE__ */ e(s, { c: "#D90429", children: o.message })
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
h as addIslandErrorNotification,
|
|
53
|
-
B as addIslandInfoNotification,
|
|
54
|
-
x as addIslandNotification,
|
|
55
|
-
F as addIslandSuccessNotification,
|
|
56
|
-
S as addIslandWarningNotification,
|
|
57
|
-
t as useIsland
|
|
58
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { jsxs as h, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import "../../utils/contextStore.js";
|
|
3
|
-
import { useRef as a, useState as R, useCallback as v, useEffect as D } from "react";
|
|
4
|
-
import { mergeComponentProps as k } from "../../utils/component.js";
|
|
5
|
-
import "js-md5";
|
|
6
|
-
import '../../assets/components/island/Island.style.css';/* empty css */
|
|
7
|
-
import { Flex as E } from "../flex/Flex.js";
|
|
8
|
-
import { useIsland as g } from "./Island.hook.js";
|
|
9
|
-
import { motion as s } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
10
|
-
const b = (x) => {
|
|
11
|
-
const {
|
|
12
|
-
children: T,
|
|
13
|
-
...I
|
|
14
|
-
} = x, l = g((t) => t.toasts), m = g((t) => t.removeToast), o = a(null), f = a(0), n = a(4e3), [c, u] = R(!1), p = a(null), e = l.length > 0 ? l.reduce((t, y) => (y.index ?? 0) > (t.index ?? 0) ? y : t) : void 0, r = v(() => {
|
|
15
|
-
o.current && (clearTimeout(o.current), o.current = null);
|
|
16
|
-
}, []), d = v(() => {
|
|
17
|
-
const t = e?.id;
|
|
18
|
-
t && (r(), f.current = Date.now(), isFinite(n.current) && (o.current = setTimeout(() => {
|
|
19
|
-
m(t);
|
|
20
|
-
}, n.current)));
|
|
21
|
-
}, [e?.id, m, r]);
|
|
22
|
-
D(() => (e?.id ? (n.current = e?.duration ?? 4e3, d()) : (r(), u(!1)), () => r()), [e?.id, e?.duration, d, r]);
|
|
23
|
-
const _ = () => {
|
|
24
|
-
if (!e?.id) return;
|
|
25
|
-
r();
|
|
26
|
-
const t = Date.now() - f.current;
|
|
27
|
-
n.current = Math.max(0, n.current - t), e?.content && u(!0);
|
|
28
|
-
}, M = () => {
|
|
29
|
-
u(!1), e?.id && n.current > 0 && d();
|
|
30
|
-
};
|
|
31
|
-
return /* @__PURE__ */ h(s.div, { layout: !0, onMouseEnter: _, onMouseLeave: M, transition: {
|
|
32
|
-
type: "spring",
|
|
33
|
-
stiffness: 300,
|
|
34
|
-
damping: 20,
|
|
35
|
-
mass: 0.8
|
|
36
|
-
}, ...k("island", I), children: [
|
|
37
|
-
/* @__PURE__ */ h(E, { align: "center", style: {
|
|
38
|
-
gap: "0.35rem"
|
|
39
|
-
}, ref: p, children: [
|
|
40
|
-
e && /* @__PURE__ */ i(s.div, { layout: !0, initial: {
|
|
41
|
-
y: 0,
|
|
42
|
-
opacity: 1,
|
|
43
|
-
strokeDashoffset: "300%"
|
|
44
|
-
}, animate: {
|
|
45
|
-
y: 0,
|
|
46
|
-
opacity: 1,
|
|
47
|
-
strokeDashoffset: "0%"
|
|
48
|
-
}, transition: {
|
|
49
|
-
duration: 0.75,
|
|
50
|
-
ease: "easeInOut"
|
|
51
|
-
}, className: "island__icon", children: e.icon }, e?.id),
|
|
52
|
-
/* @__PURE__ */ i(s.div, { layout: !0, children: T }),
|
|
53
|
-
e?.message && /* @__PURE__ */ i(s.div, { layout: !0, className: "island__message", children: e?.message })
|
|
54
|
-
] }, e?.id),
|
|
55
|
-
/* @__PURE__ */ i("div", { style: {
|
|
56
|
-
maxWidth: `${p.current?.offsetWidth}px`
|
|
57
|
-
}, children: c && !!e?.content && /* @__PURE__ */ i(s.div, { initial: {
|
|
58
|
-
y: 10,
|
|
59
|
-
opacity: 0
|
|
60
|
-
}, animate: {
|
|
61
|
-
y: c && e?.content ? 0 : 100,
|
|
62
|
-
opacity: c && e?.content ? 1 : 0
|
|
63
|
-
}, transition: {
|
|
64
|
-
duration: 0.25,
|
|
65
|
-
ease: "easeInOut"
|
|
66
|
-
}, className: "island__content", children: e?.content }) })
|
|
67
|
-
] });
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
b as Island
|
|
71
|
-
};
|