@drawnagency/primitives 0.1.60 → 0.1.61
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/chunk-4OX3Z7SB.js +1421 -0
- package/dist/{chunk-RFZNNCAS.js → chunk-53DKVAB6.js} +1 -61
- package/dist/chunk-677NTHAZ.js +27 -0
- package/dist/chunk-7EOSDFS3.js +10 -0
- package/dist/{chunk-Q5EEYBMJ.js → chunk-AM5LZD6Q.js} +0 -25
- package/dist/chunk-UQ4OYRW7.js +670 -0
- package/dist/chunk-WDSVHKAH.js +54 -0
- package/dist/chunk-WLMJCNU7.js +70 -0
- package/dist/components/editor/index.js +640 -0
- package/dist/components/primitives/index.d.ts +10 -0
- package/dist/components/primitives/index.d.ts.map +1 -0
- package/dist/components/primitives/index.js +166 -0
- package/dist/components/sections/register-schemas.js +350 -2416
- package/dist/index.js +20 -14
- package/dist/lib/index.js +14 -8
- package/dist/schemas/index.js +6 -6
- package/dist/schemas/link.js +13 -0
- package/package.json +9 -1
- package/src/components/primitives/index.ts +11 -0
- /package/dist/{chunk-ZU2MKPTG.js → chunk-3DCG4DNU.js} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/lib/icons.ts
|
|
2
|
+
import {
|
|
3
|
+
Check,
|
|
4
|
+
X,
|
|
5
|
+
ArrowRight,
|
|
6
|
+
Star,
|
|
7
|
+
Info,
|
|
8
|
+
AlertTriangle,
|
|
9
|
+
Heart,
|
|
10
|
+
Lightbulb,
|
|
11
|
+
Flag,
|
|
12
|
+
Shield,
|
|
13
|
+
Zap,
|
|
14
|
+
Eye,
|
|
15
|
+
Lock,
|
|
16
|
+
Globe,
|
|
17
|
+
Users,
|
|
18
|
+
Target,
|
|
19
|
+
Bookmark,
|
|
20
|
+
Clock,
|
|
21
|
+
ThumbsUp,
|
|
22
|
+
ThumbsDown
|
|
23
|
+
} from "lucide-react";
|
|
24
|
+
var curatedIcons = [
|
|
25
|
+
{ id: "check", label: "Check", icon: Check },
|
|
26
|
+
{ id: "x", label: "X", icon: X },
|
|
27
|
+
{ id: "arrow-right", label: "Arrow Right", icon: ArrowRight },
|
|
28
|
+
{ id: "star", label: "Star", icon: Star },
|
|
29
|
+
{ id: "info", label: "Info", icon: Info },
|
|
30
|
+
{ id: "alert-triangle", label: "Warning", icon: AlertTriangle },
|
|
31
|
+
{ id: "heart", label: "Heart", icon: Heart },
|
|
32
|
+
{ id: "lightbulb", label: "Lightbulb", icon: Lightbulb },
|
|
33
|
+
{ id: "flag", label: "Flag", icon: Flag },
|
|
34
|
+
{ id: "shield", label: "Shield", icon: Shield },
|
|
35
|
+
{ id: "zap", label: "Zap", icon: Zap },
|
|
36
|
+
{ id: "eye", label: "Eye", icon: Eye },
|
|
37
|
+
{ id: "lock", label: "Lock", icon: Lock },
|
|
38
|
+
{ id: "globe", label: "Globe", icon: Globe },
|
|
39
|
+
{ id: "users", label: "Users", icon: Users },
|
|
40
|
+
{ id: "target", label: "Target", icon: Target },
|
|
41
|
+
{ id: "bookmark", label: "Bookmark", icon: Bookmark },
|
|
42
|
+
{ id: "clock", label: "Clock", icon: Clock },
|
|
43
|
+
{ id: "thumbs-up", label: "Thumbs Up", icon: ThumbsUp },
|
|
44
|
+
{ id: "thumbs-down", label: "Thumbs Down", icon: ThumbsDown }
|
|
45
|
+
];
|
|
46
|
+
var iconMap = new Map(curatedIcons.map((e) => [e.id, e]));
|
|
47
|
+
function getIcon(id) {
|
|
48
|
+
return iconMap.get(id);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export {
|
|
52
|
+
curatedIcons,
|
|
53
|
+
getIcon
|
|
54
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-7EOSDFS3.js";
|
|
4
|
+
|
|
5
|
+
// src/components/shared/PagesContext.tsx
|
|
6
|
+
import { createContext, useContext } from "react";
|
|
7
|
+
var PagesContext = createContext({ pages: [], getPageHeadings: () => [] });
|
|
8
|
+
function usePages() {
|
|
9
|
+
return useContext(PagesContext);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// src/components/shared/icons.tsx
|
|
13
|
+
import { GripVertical, Plus, Trash2, X, Settings } from "lucide-react";
|
|
14
|
+
import { GripVertical as GripVertical2, Plus as Plus2, Trash2 as Trash22, X as X2, Settings as Settings2 } from "lucide-react";
|
|
15
|
+
import { jsx } from "react/jsx-runtime";
|
|
16
|
+
function DragHandle({ size = 16 }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(GripVertical, { size });
|
|
18
|
+
}
|
|
19
|
+
function AddIcon({ size = 14 }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(Plus, { size });
|
|
21
|
+
}
|
|
22
|
+
function DeleteIcon({ size = 14 }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(Trash2, { size });
|
|
24
|
+
}
|
|
25
|
+
function SettingsIcon({ size = 14 }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(Settings, { size });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// src/components/shared/IconButton.tsx
|
|
30
|
+
import { forwardRef } from "react";
|
|
31
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
32
|
+
var sizeClasses = {
|
|
33
|
+
sm: "h-chrome-sm w-chrome-sm",
|
|
34
|
+
md: "h-chrome-md w-chrome-md",
|
|
35
|
+
lg: "h-chrome-lg w-chrome-lg"
|
|
36
|
+
};
|
|
37
|
+
var intentClasses = {
|
|
38
|
+
default: "text-base-contrast-light hover:text-base-contrast",
|
|
39
|
+
destructive: "text-destructive hover:text-destructive-hover",
|
|
40
|
+
primary: "text-primary/60 hover:text-primary"
|
|
41
|
+
};
|
|
42
|
+
var IconButton = forwardRef(
|
|
43
|
+
function IconButton2({ icon, label, size = "md", intent = "default", className, ...rest }, ref) {
|
|
44
|
+
return /* @__PURE__ */ jsx2(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
ref,
|
|
48
|
+
type: "button",
|
|
49
|
+
className: cn(
|
|
50
|
+
"cursor-pointer flex items-center justify-center rounded transition-colors",
|
|
51
|
+
sizeClasses[size],
|
|
52
|
+
intentClasses[intent],
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
"aria-label": label,
|
|
56
|
+
...rest,
|
|
57
|
+
children: icon
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
usePages,
|
|
65
|
+
DragHandle,
|
|
66
|
+
AddIcon,
|
|
67
|
+
DeleteIcon,
|
|
68
|
+
SettingsIcon,
|
|
69
|
+
IconButton
|
|
70
|
+
};
|